Subleq: Difference between revisions

16 bytes removed ,  10 months ago
m
Clarify that the control transfer is to C itself, not the contents of memory location C.
(Added XPL0 example.)
m (Clarify that the control transfer is to C itself, not the contents of memory location C.)
Line 19:
:#   If '''A''' is   '''-1'''   (negative unity),   then a character is read from the machine's input and its numeric value 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.
:#   Otherwise, both '''A''' and '''B''' are treated as addresses.   The number contained in address '''A''' is subtracted from the number in address '''B''' (and the difference left in address '''B''').   If the result is positive, execution continues uninterrupted; if the result is zero or negative, the numberinstruction inpointer is set to '''C''' becomes the new instruction pointer.
:#   If the instruction pointer becomes negative, execution halts.
 
1,479

edits