From acf8e03f531c62676ef96b58ea5733b973fcf7d0 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 20 Jun 2020 13:36:21 -0400 Subject: [PATCH] 8086asm: add overflow check to RPCs, I've spent way too much time debugging bugs caused by this... *sigh*, why can't I learn? --- blk/760 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blk/760 b/blk/760 index ba1f378..552aa71 100644 --- a/blk/760 +++ b/blk/760 @@ -4,7 +4,8 @@ : BREAK?, DUP 0x8000 AND IF 0x7fff AND 1 ALLOT THEN, -1 ALLOT 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, ; ( Use RPCx with appropriate JMP/CALL op. Example: JMPs, 0x42 RPCs, or CALLn, 0x1234 RPCn, )