8086asm: add overflow check to RPCs,

I've spent way too much time debugging bugs caused by this...

*sigh*, why can't I learn?
This commit is contained in:
Virgil Dupras 2020-06-20 13:36:21 -04:00
parent 019fd8a67d
commit acf8e03f53

View File

@ -4,7 +4,8 @@
: BREAK?, DUP 0x8000 AND IF : BREAK?, DUP 0x8000 AND IF
0x7fff AND 1 ALLOT THEN, -1 ALLOT 0x7fff AND 1 ALLOT THEN, -1 ALLOT
THEN ; ) THEN ; )
: RPCs, PC - 1- A, ; : RPCn, PC - 2- A,, ; : RPCs, PC - 1- DUP 128 + 0xff > IF ABORT" PC ovfl" THEN A, ;
: RPCn, PC - 2- A,, ;
: AGAIN, ( BREAK?, ) RPCs, ; : AGAIN, ( BREAK?, ) RPCs, ;
( Use RPCx with appropriate JMP/CALL op. Example: ( Use RPCx with appropriate JMP/CALL op. Example:
JMPs, 0x42 RPCs, or CALLn, 0x1234 RPCn, ) JMPs, 0x42 RPCs, or CALLn, 0x1234 RPCn, )