(opctests) Housekeeping

This commit is contained in:
neauoire 2023-10-30 10:12:56 -07:00
parent 66414aaff1
commit b695b55c49
1 changed files with 10 additions and 10 deletions

View File

@ -11,7 +11,7 @@
> LIT2: Puts a short on the stack > LIT2: Puts a short on the stack
> #18 DEO: Write a letter in terminal ) > #18 DEO: Write a letter in terminal )
LIT2 "kO #18 DEO #18 DEO #0a18 DEO [ LIT2 "kO ] #18 DEO #18 DEO #0a18 DEO
( part 2 ( part 2
> LITr: Put a byte on return stack > LITr: Put a byte on return stack
@ -19,14 +19,14 @@
> STH: Move a byte from working stack to return stack > STH: Move a byte from working stack to return stack
> STH2r: Move a short from return stack to working stack ) > STH2r: Move a short from return stack to working stack )
LITr "k LIT "O STH STH2r #18 DEO #18 DEO #0a18 DEO [ LITr "k ] [ LIT "O ] STH STH2r #18 DEO #18 DEO #0a18 DEO
( part 3 ( part 3
> LIT2r: Put a short on return stack > LIT2r: Put a short on return stack
> DUP: Duplicate byte > DUP: Duplicate byte
> ADDr: Add bytes on return stack ) > ADDr: Add bytes on return stack )
LIT2r "k 4d #01 DUP STH ADDr STH ADDr STH2r #18 DEO #18 DEO #0a18 DEO [ LIT2r "k 4d ] #01 DUP STH ADDr STH ADDr STH2r #18 DEO #18 DEO #0a18 DEO
( part 4 ( part 4
> JSI: Subroutine to relative absolute address > JSI: Subroutine to relative absolute address
@ -47,7 +47,7 @@
> LDA2k: Non-destructive load short from absolute address > LDA2k: Non-destructive load short from absolute address
> STA2: Store short at absolute address ) > STA2: Store short at absolute address )
LIT2r 0000 [ LIT2r 0000 ]
;tests/end ;tests ;tests/end ;tests
&l &l
run-test STH ADDr run-test STH ADDr
@ -65,7 +65,7 @@ BRK
LDA2k JSR2 DUP ?&pass LDA2k JSR2 DUP ?&pass
;Dict/failed pstr ;Dict/failed pstr
[ LIT2 &name $2 ] pstr #0a18 DEO JMP2r [ LIT2 &name $2 ] pstr/ #0a18 DEO JMP2r
&pass &pass
JMP2r JMP2r
@ -78,8 +78,9 @@ JMP2r
@pstr ( str* -- ) @pstr ( str* -- )
LDAk ?&w POP2 JMP2r &w ( -- )
&w LDAk #18 DEO INC2 LDAk ?&w LDAk #18 DEO
INC2 & LDAk ?&w
POP2 POP2
JMP2r JMP2r
@ -349,16 +350,15 @@ JMP2r
@special ( routine* -- f ) @special ( routine* -- f )
( test the stack order ) ( test that the stack order is LIFO )
DUP2 STH2kr EQU2 DUP2 STH2kr EQU2
ROT ROT DUP2r STHr STHr SWP EQU2 AND ROT ROT DUP2r STHr STHr SWP EQU2 AND
JMP2r JMP2r
@routine ( a b -- c ) ADD JMP2r @routine ( a b -- c ) ADD JMP2r
@subroutine ( -- ) LIT2 "kO #18 DEO #18 DEO #0a18 DEO JMP2r @subroutine ( -- ) [ LIT2 "kO ] #18 DEO #18 DEO #0a18 DEO JMP2r
@Absolute &byte $1 &short $2 @Absolute &byte $1 &short $2
@phex ( short* -- ) SWP phex/b &b ( byte -- ) DUP #04 SFT phex/c &c ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r
@Dict [ @Dict [
&ok "Ok $1 &ok "Ok $1