From b0b3573d7db300ed40e4c332e030c81764eacf5b Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 14 Apr 2023 18:41:28 -0700 Subject: [PATCH] (opctest) Check for return stack items order --- cli/opctest/opctest.tal | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cli/opctest/opctest.tal b/cli/opctest/opctest.tal index 4d64ed8..ddad5c5 100644 --- a/cli/opctest/opctest.tal +++ b/cli/opctest/opctest.tal @@ -155,7 +155,7 @@ JMP2r =op-jmi [ =op-jmi/a ] =op-jsi [ - =op-jsi/a ] + =op-jsi/a =op-jsi/b ] &end @op-equ ;Dict/equ !set @@ -342,10 +342,20 @@ JMP2r &a !&skip-a #00 JMP2r &skip-a #01 JMP2r @op-jsi ;Dict/jsi !set &a #02 #04 routine #06 EQU JMP2r + &b ;&return special &return JMP2r + +@special ( routine* -- f ) + + ( test the stack order ) + DUP2 STH2kr EQU2 + ROT ROT DUP2r STHr STHr SWP EQU2 AND + +JMP2r @routine ( a b -- c ) ADD JMP2r @subroutine ( -- ) LIT2 "kO #18 DEO #18 DEO #0a18 DEO JMP2r @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 [ &ok "Ok $1