pcat: read LATEST and jump to it

This commit is contained in:
Virgil Dupras 2020-06-14 14:51:32 -04:00
parent a72322df31
commit bf0e999f8e
3 changed files with 7 additions and 4 deletions

View File

@ -5,10 +5,11 @@
0xeb OP1 JMPs, 0xe9 OP1 JMPn, 0x74 OP1 JZ,
0xe8 OP1 CALLn,
: MOVri, SWAP 0xb0 OR A, A, ;
: MOVxi, SWAP 0xb8 OR A, SPLITB A, A, ;
: MOVxi, SWAP 0xb8 OR A, A,, ;
: MOVsx, 0x8e A, SWAP 3 LSHIFT OR 0xc0 OR A, ;
: MOVxm, 0x8b A, SWAP 3 LSHIFT 0x6 OR A, A,, ;
: INT, 0xcd A, A, ;
: JMPr, 0xff A, 7 AND 0xe0 OR A, ;
: JMPf, ( seg off ) 0xea A, SPLITB A, A, SPLITB A, A, ;
: JMPf, ( seg off ) 0xea A, SPLITB A, A, A,, ;
: OPrr CREATE C, DOES> C@ A, 3 LSHIFT OR 0xc0 OR A, ;
0x31 OPrr XORxx, 0x08 OPrr ORrr,

View File

@ -8,7 +8,8 @@ H@ XCURRENT ! ( set current tip of dict, 0x42 )
0x17 A, ( nativeWord )
HLT,
CODE FOO
L1 BSET
( Update LATEST, temporarily hackish )
PC 1- ORG @ 8 + !
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
L2 BSET JMPs, L2 @ RPCs,
;CODE

View File

@ -1,2 +1,3 @@
PC 3 - ORG @ 1+ ! ( main )
JMPs, L1 @ RPCs,
AX 0x08 MOVxm, ( LATEST )
AX JMPr,