From 06d0a02c12604240014fbe9da4a3295b890ac515 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 12 Apr 2020 09:36:10 -0400 Subject: [PATCH] link: fix LITA processing --- forth/link.fs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/forth/link.fs b/forth/link.fs index ff6a42a..7528946 100644 --- a/forth/link.fs +++ b/forth/link.fs @@ -57,17 +57,19 @@ ( a o ol -- a+n ) : RLATOM ROT ( o ol a ) - DUP @ 0x24 = IF - ( addrWord? we need to offset it ) - 2 + ( o ol a+2 ) - ROT OVER ( ol a o a ) - @ -^ ( ol a n-o ) - OVER ! ( ol a ) - SWAP DROP ( a ) - 2 + ( a+2 ) - EXIT ( no need for ASKIP ) - THEN DUP @ ( o ol a n ) + DUP 0x24 = IF + ( 0x24 is an addrWord, which should be offsetted in + the same way that a regular word would. To achieve + this, we skip ASKIP and instead of skipping 4 bytes + like a numberWord, we skip only 2, which means that + our number will be treated like a regular wordref. + ) + DROP + 2 + ( o ol a+2 ) + ROT ROT 2DROP ( a ) + EXIT + THEN ROT ( o a n ol ) < IF ( under limit, do nothing ) SWAP DROP ( a )