Subleq: Difference between revisions

238 bytes added ,  10 months ago
Add comments to subleq "assembly" listing
m (Add note about EOF on input.)
(Add comments to subleq "assembly" listing)
Line 33:
 
<pre>start:
0f 11 ff subleq (zero), (message), -1 ; subtract 0 from next character value to print;
; terminate if it's <=0
11 ff ff subleq (message), -1, -1 ; output character at message
1011 01ff ff subleq (neg1message), (start+-1), -1 ; output character
10 0301 ff subleq (neg1), (start+31), -1 ; modify above two instructions by subtracting -1
0f10 0f03 00ff subleq (zeroneg1), (zerostart+3), start-1 ; (adding 1) to their target addresses
0f 0f 00 subleq (zero), (zero), start ; if 0-0 <= 0 (i.e. always) goto start
 
; useful constants
zero:
1,480

edits