fix a couple bugs

This commit is contained in:
~d6 2023-02-02 22:12:58 -05:00
parent c7ce127aa4
commit 95e9b30810
1 changed files with 22 additions and 20 deletions

View File

@ -561,22 +561,25 @@
@exec-move-row ( c^ -> ) @exec-move-row ( c^ -> )
POP POP
#0001 read-arg-1 #0001 SUB2 ( row ) #0001 read-arg-1 dec-floor ( row )
.cur-x LDZ2 ( col ) .cur-x LDZ2 ( col )
goto BRK goto BRK
@exec-move-col ( c^ -> ) @exec-move-col ( c^ -> )
POP POP
.cur-y LDZ2 ( row ) .cur-y LDZ2 ( row )
#0001 read-arg-2 #0001 SUB2 ( col ) #0001 read-arg-2 dec-floor ( col )
goto BRK goto BRK
@exec-move ( c^ -> ) @exec-move ( c^ -> )
POP POP
#0001 read-arg-1 #0001 SUB2 ( row ) #0001 read-arg-1 dec-floor ( row )
#0001 read-arg-2 #0001 SUB2 ( col ) #0001 read-arg-2 dec-floor ( col )
goto BRK goto BRK
@dec-floor ( x* -> x==0 ? 0* : x-1* )
ORAk ?&sub JMP2r &sub #0001 SUB2 JMP2r
@debug-esc ( c^ -> ) @debug-esc ( c^ -> )
.debug LDZ ?&continue POP JMP2r &continue .debug LDZ ?&continue POP JMP2r &continue
;scratch STH2 ;scratch STH2
@ -667,7 +670,7 @@
POP BRK ( ) POP BRK ( )
@read-cr ( 0d -> ) @read-cr ( 0d -> )
POP clear-cursor #0000 .cur-x STZ2 BRK POP clear-cursor #0000 .cur-x STZ2 draw-cursor BRK
@at-max-y ( -> true? ) @at-max-y ( -> true? )
.cur-y LDZ2 .max-y LDZ2 EQU2 JMP2r .cur-y LDZ2 .max-y LDZ2 EQU2 JMP2r
@ -677,7 +680,6 @@
at-max-y ?scroll down BRK at-max-y ?scroll down BRK
@read-printable ( c -> ) @read-printable ( c -> )
( DUP debug-read )
.tint LDZ SWP DUP2 cur-addr STA2 .tint LDZ SWP DUP2 cur-addr STA2
draw-cell draw-cell
forward BRK forward BRK
@ -733,7 +735,7 @@
cur-addr STA2 JMP2r ( ) cur-addr STA2 JMP2r ( )
@forward-n-tabs ( n* -> ) @forward-n-tabs ( n* -> )
#0001 SUB2 #0008 MUL2 ( i=(n-1)8* ) dec-floor #0008 MUL2 ( i=(n-1)8* )
#0008 .cur-x LDZ2 #0007 AND2 SUB2 ( i* 8-cur%8* ) #0008 .cur-x LDZ2 #0007 AND2 SUB2 ( i* 8-cur%8* )
ADD2 !forward-n ( ) ADD2 !forward-n ( )