One last comment about the if/then/else, and that is that there is a JMP ENDIF right before the ELSE clause. This points out once again that there are no control structures in machine language -- only sequence and gotos. All the constructs of high level languages: while, do/while, if/then/else, switch, etc. are fictions created by compilers. The gcd program does not do input and output, which is deliberate. The results of this algorithm are found in either X or Y. Just inspect memory to find this "output." The CSC-1 computer does not have explicit I/O instructions, which is not an oversight. Many real computers do not have them either, but rather rely on memory-mapped I/O. What this means is that I/O devices respond to signals that are done by reading from or writing to special memory locations. This is the way the Motorola 68000 chip communicates with the outside world. Other chips, like the Intel x86 series, actually have explicit IN and OUT instructions, but may still use memory-mapped I/O. |