aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--print.s22
-rw-r--r--read.s24
2 files changed, 23 insertions, 23 deletions
diff --git a/print.s b/print.s
index e79cced..e3d29e3 100644
--- a/print.s
+++ b/print.s
@@ -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
diff --git a/read.s b/read.s
index ad07fd0..6e151be 100644
--- a/read.s
+++ b/read.s
@@ -1,7 +1,7 @@
read:
-002000 012705 MOV #7000, R5 ; move read buffer address into R5
+002000 012704 MOV #7000, R4 ; move read buffer address into R4
002002 007000
-002004 105025 CLRB (R5)+ ; move null byte into buffer
+002004 105024 CLRB (R4)+ ; move null byte into buffer
get:
002006 032737 BIT #200, @#177560
002010 000200
@@ -28,7 +28,7 @@ get:
002062 000132
002064 101010 BHI bad
good:
-002066 110125 MOVB R1, (R5)+ ; move good char into buffer
+002066 110124 MOVB R1, (R4)+ ; move good char into buffer
echo:
; echo good char
002070 032737 BIT #200, @#177654
@@ -62,7 +62,7 @@ line:
002146 002200
-; R4 = sexps
+; R3 = sexps
parse_sexp:
002200 004737 JSR PC, #get_next ; get a character
002202 002400
@@ -72,7 +72,7 @@ parse_sexp:
; otherwise (if list)
; get the list
if_list:
-002212 012704 MOV "NIL", R4 ; sexps <- empty list
+002212 012703 MOV "NIL", R3 ; sexps <- empty list
002214 005000
loop:
002216 004737 JSR PC, #get_next
@@ -81,23 +81,23 @@ loop:
002224 000050
002226 001411 BEQ done ; if "(" return the accumulated list
; if anything else:
-002230 110025 MOVB R0, (R5)+ ; put back the char
-002232 010446 MOV R4, -(SP) ; push sexps
+002230 110024 MOVB R0, (R4)+ ; put back the char
+002232 010346 MOV R3, -(SP) ; push sexps
002234 004737 JSR PC, #parse_sexp ; arg1 <- parse sexp
002236 002200
002240 012601 MOV (SP)+, R1 ; arg2 <- pop accum
002142 004737 JSR PC, #cons ; cons result onto accum
002244 004400
-002246 010004 MOV R0, R4 ; sexps <- result
+002246 010003 MOV R0, R3 ; sexps <- result
002250 000762 BR loop ; continue recognizing list
done:
-002252 010400 MOV R4, R0 ; result <- sexps
+002252 010300 MOV R3, R0 ; result <- sexps
002254 000207 RTS PC
if_atom:
002256 105046 CLRB -(SP) ; push null byte to stack
loop:
002260 110046 MOVB R0, -(SP) ; push character to stack
-002262 114500 MOVB -(R5), R0 ; get another character
+002262 114400 MOVB -(R4), R0 ; get another character
002264 120027 CMPB R0, "A" ;
002266 000101
002270 103404 BLO done ; done if lower than A
@@ -106,7 +106,7 @@ loop:
002276 101001 BHI done ; done if higher than Z
002300 000767 BR loop ; continue getting characters
done:
-002302 110025 MOVB R0, (R5)+ ; put the non-letter back
+002302 110024 MOVB R0, (R4)+ ; put the non-letter back
002304 013702 MOV @#10000, R2 ; get free pointer
002306 010000
002310 010200 MOV R2, R0 ; result <- address of new atom
@@ -127,7 +127,7 @@ loop:
get_next:
loop:
-002400 114500 MOVB -(R5), R0
+002400 114400 MOVB -(R4), R0
002402 001404 BEQ bad ; if null byte, no more input, very bad
002404 120027 CMPB R0, " " ; check if space
002406 000040