diff options
author | Jacques Comeaux <jacquesrcomeaux@gmail.com> | 2022-10-09 12:33:49 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@gmail.com> | 2022-10-09 12:33:49 -0500 |
commit | 7e6ba6c3833573ccf23cf4e0de30710a7f942bcf (patch) | |
tree | 17bccd43cc5fff596b151df2f9fa9f5823ef345b /print.s | |
parent | a2e9ba0bdd8eda017a8f3eec2a4d05f0391db048 (diff) |
Avoid symbol table register
Diffstat (limited to 'print.s')
-rw-r--r-- | print.s | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,21 +1,21 @@ print: -004000 012705 MOV #7000, R5 ; store print buffer address in R5 +004000 012704 MOV #7000, R4 ; store print buffer address in R4 004002 007000 004004 032710 BIT #1, (R0) ; test if sexp is cons or atom 004006 000001 004010 001005 BNE 10 -004012 112725 MOVB #"(", (R5)+ ; if cons output open paren +004012 112724 MOVB #"(", (R4)+ ; if cons output open paren 004014 000050 004016 004737 JSR PC, #handle_cons 004020 004100 004022 000402 BR 4 004024 004737 JSR PC, #handle_atom 004026 004200 -004030 112725 MOVB #"\r", (R5)+ ; move carriage return into print buffer +004030 112724 MOVB #"\r", (R4)+ ; move carriage return into print buffer 004032 000015 -004034 112725 MOVB #"\n", (R5)+ ; move line feed into print buffer +004034 112724 MOVB #"\n", (R4)+ ; move line feed into print buffer 004036 000012 -004040 112725 MOVB #"\0", (R5)+ ; move null byte into print buffer +004040 112724 MOVB #"\0", (R4)+ ; move null byte into print buffer 004042 000000 004044 000137 JMP #print_buffer 004046 004300 @@ -27,7 +27,7 @@ handle_cons: 004106 032710 BIT #1, (R0) ; test if car is cons or atom 004110 000001 004112 001005 BNE 12 -004114 112725 MOVB #"(", (R5)+ ; if cons output open paren +004114 112724 MOVB #"(", (R4)+ ; if cons output open paren 004116 000050 004120 004737 JSR PC, #handle_cons ; recurse 004122 004100 @@ -38,12 +38,12 @@ handle_cons: 004134 032710 BIT #1, (R0) ; test if cdr is cons or atom 004136 000001 004140 001005 BNE 12 -004142 112725 MOVB #" ", (R5)+ ; if cons output space +004142 112724 MOVB #" ", (R4)+ ; if cons output space 004144 000040 004146 004737 JSR PC, #handle_cons ; recurse 004150 004100 004152 000402 BR 4 -004154 112725 MOVB #")", (R5)+ ; if atom output close paren +004154 112724 MOVB #")", (R4)+ ; if atom output close paren 004156 000051 004160 000207 RTS PC @@ -51,13 +51,13 @@ handle_atom: 004200 011000 MOV @R0, R0 ; 004202 005300 DEC R0 ; get string address 004204 000401 BR 2 ; -004206 110125 MOVB R1, (R5)+ ; move char to print buffer +004206 110124 MOVB R1, (R4)+ ; move char to print buffer 004210 112001 MOVB (R0)+, R1 ; get next byte 004212 001375 BNE -6 ; if not null continue 004214 000207 RTS PC ; print_buffer: -004300 012705 MOV #7000, R5 ; restore print buffer pointer +004300 012704 MOV #7000, R4 ; restore print buffer pointer 004302 007000 004304 000405 BR 12 004306 105737 TSTB @#177564 ; test if console ready @@ -65,6 +65,6 @@ print_buffer: 004312 001775 BEQ -6 ; loop while not ready 004314 110137 MOVB R1, @#177566 ; send char to console 004316 177566 -004320 112501 MOVB (R5)+, R1 ; get next byte +004320 112401 MOVB (R4)+, R1 ; get next byte 004322 001371 BNE -14 ; if not null continue 004324 000207 RTS PC |