Keep err on stack

This commit is contained in:
Devine Lu Linvega 2024-06-04 17:37:51 -08:00
parent 0ae7b1232d
commit ab45e0618b
1 changed files with 9 additions and 10 deletions

View File

@ -254,21 +254,20 @@
#0000 ,&y2 LDR2 ,&y1 LDR2 SUB2 abs2 SUB2 ,&dy STR2 #0000 ,&y2 LDR2 ,&y1 LDR2 SUB2 abs2 SUB2 ,&dy STR2
#ffff [ LIT2 00 _&x1 ] LDR2 ,&x2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sx STR2 #ffff [ LIT2 00 _&x1 ] LDR2 ,&x2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sx STR2
#ffff [ LIT2 00 _&y1 ] LDR2 ,&y2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sy STR2 #ffff [ LIT2 00 _&y1 ] LDR2 ,&y2 LDR2 lts2 DUP2 ADD2 ADD2 ,&sy STR2
[ LIT2 &dx $2 ] [ LIT2 &dy $2 ] ADD2 STH2 [ LIT2 &dx $2 ] [ LIT2 &dy $2 ] ADD2
&>while ( -- ) &>while ( -- )
( draw ) ,&x1 LDR2 ,&y1 LDR2 [ LIT &color $1 ] <set-pixel> ( draw ) ,&x1 LDR2 ,&y1 LDR2 [ LIT &color $1 ] <set-pixel>
( x ) [ LIT2 &x1 $2 ] [ LIT2 &x2 $2 ] EQU2 ( x ) [ LIT2 &x1 $2 ] [ LIT2 &x2 $2 ] EQU2
( y ) [ LIT2 &y1 $2 ] [ LIT2 &y2 $2 ] EQU2 AND ?&end ( y ) [ LIT2 &y1 $2 ] [ LIT2 &y2 $2 ] EQU2 AND ?&end
STH2kr DUP2 ADD2 DUP2 DUP2k ADD2 DUP2
( | hey ) ( y ) ,&dy LDR2 lts2 ?{
,&dy LDR2 lts2 ?{ ( e+dy ) SWP2 ,&dy LDR2 ADD2 SWP2
STH2r ,&dy LDR2 ADD2 STH2 ( x1+sx ) ,&x1 LDR2 [ LIT2 &sx $2 ] ADD2 ,&x1 STR2 }
,&x1 LDR2 [ LIT2 &sx $2 ] ADD2 ,&x1 STR2 } ( x ) ,&dx LDR2 gts2 ?{
,&dx LDR2 gts2 ?{ ( e+dx ) ,&dx LDR2 ADD2
STH2r ,&dx LDR2 ADD2 STH2 ( y1+sy ) ,&y1 LDR2 [ LIT2 &sy $2 ] ADD2 ,&y1 STR2 }
,&y1 LDR2 [ LIT2 &sy $2 ] ADD2 ,&y1 STR2 }
!&>while !&>while
&end POP2r JMP2r &end POP2 JMP2r
@snap ( x1* x2* -- x* ) @snap ( x1* x2* -- x* )
SUB2k abs2 #0008 LTH2 ?{ NIP2 JMP2r } SUB2k abs2 #0008 LTH2 ?{ NIP2 JMP2r }