pcat: implement cell execution and shaping things up

This commit is contained in:
Virgil Dupras 2020-06-20 13:50:01 -04:00
parent c571567660
commit 1536434666
5 changed files with 15 additions and 12 deletions

View File

@ -4,7 +4,7 @@
1 0xd0 OPr0 RORr1, 1 0xd1 OPr0 RORx1, 4 0xf7 OPr0 MULx,
4 0xd0 OPr0 SHLr1, 4 0xd1 OPr0 SHLx1, 6 0xf6 OPr0 DIVr,
5 0xd0 OPr0 SHRr1, 5 0xd1 OPr0 SHRx1, 6 0xf7 OPr0 DIVx,
0 0xd2 OPr0 ROLrCL, 0 0xd3 OPr0 ROLxCL,
1 0xd2 OPr0 RORrCL, 1 0xd3 OPr0 RORxCL,
0 0xd2 OPr0 ROLrCL, 0 0xd3 OPr0 ROLxCL, 1 0xfe OPr0 DECr,
1 0xd2 OPr0 RORrCL, 1 0xd3 OPr0 RORxCL, 0 0xfe OPr0 INCr,
4 0xd2 OPr0 SHLrCL, 4 0xd3 OPr0 SHLxCL,
5 0xd2 OPr0 SHRrCL, 5 0xd3 OPr0 SHRxCL,

View File

@ -5,9 +5,10 @@ lblnext BSET PC 0x1d - ORG @ 0x1b + ! ( next )
lblexec BSET PC 0x36 - ORG @ 0x34 + ! ( DI -> wordref )
AL [DI] MOVr[], DI INCx, ( PFA )
AL AL ORrr, IFZ, DI JMPr, THEN, ( native )
( continue to compiled )
PC 0x11 - ORG @ 0x0f + ! ( compiled -- DI -> PFA )
AL DECr, IFNZ, ( cell or does )
DI PUSHx, ( push PFA ) JMPs, lblnext @ RPCs,
( TODO: implement does )
THEN, ( compiled )
BP INCx, BP INCx, [BP] 0 DX MOV[]+x, ( pushRS )
DX DI MOVxx, DX INCx, DX INCx, ( --> IP )
DI [DI] MOVx[],

View File

@ -1,6 +1,6 @@
( native words )
CODE EXECUTE
DI POPx, JMPs, lblexec @ RPCs,
DI POPx, JMPn, lblexec @ RPCn,
CODE >R
BP INCx, BP INCx, [BP] 0 POP[w]+,
;CODE NOP, NOP, NOP,

View File

@ -1,5 +0,0 @@
CODE EMIT
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
;CODE
: FOO '0' 1 3 LSHIFT + EMIT ;
: BOOT 0x08 @ LIT< FOO _find DROP EXECUTE BYE ;

View File

@ -4,7 +4,14 @@ RS_ADDR 0x80 - CONSTANT RAMSTART
750 LOAD ( 8086 asm )
262 LOAD ( xcomp )
270 LOAD ( xcomp overrides )
812 828 LOADR
812 827 LOADR
353 LOAD ( xcomp core low )
CODE (emit)
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
;CODE
CODE (key) AH AH XORrr, 0x16 INT, AX PUSHx, ;CODE
: FOO (key) (emit) ;
: BOOT 0x08 @ LIT< FOO _find DROP EXECUTE BYE ;
(entry) _
( Update LATEST )
PC ORG @ 8 + !