Subleq: Difference between revisions

m
fix wording.
No edit summary
m (fix wording.)
Line 16:
The program should load the initial contents of the emulated machine's memory, set the instruction pointer to the first address (which is defined to be address 0), and begin emulating the machine, which works as follows:
:#   Let '''A''' be the value in the memory location identified by the instruction pointer;   let '''B''' and '''C''' be the values stored in the next two consecutive addresses in memory.
:#   Advance the instruction pointer three words   (it will then point at the address ''after'' the address contained incontaining '''C''').
:#   If '''A''' is   '''-1'''   (negative unity),   then a character is read from the machine's input and stored in the address given by '''B'''.   '''C''' is unused.
:#   If '''B''' is   '''-1'''   (negative unity),   then the number contained in the address given by '''A''' is interpreted as a character and written to the machine's output.   '''C''' is unused.
1,480

edits