Assume that a programmer forgot to put any 00 (STOP) instructions into an otherwise correct Pep/8 program. Would such a program ever stop? There are three possible answers:
The correct answer is the third option that Some such programs would stop and others would not stop.
The reason for this is that for sequential programs without any jump etc. instructions, the processor would continue executing whatever is in memory after your code, it may try to execute invalid instruction or to access memory that it is not allowed to access thus causing a segmentation fault, eventually leading to the crash & thus termination of the program. This would happen with those programs that do not enter an infinite loop.
For some programs, it may the case that a missing stop instruction may be at a place where it would make the program to continue a loop indefinitely. Such programs will not crash but would keep executing.
Get Answers For Free
Most questions answered within 1 hours.