From 1536434666638262327af0548ce659b07e42fdfe Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 20 Jun 2020 13:50:01 -0400 Subject: [PATCH] pcat: implement cell execution and shaping things up --- blk/754 | 4 ++-- blk/816 | 7 ++++--- blk/820 | 2 +- blk/828 | 5 ----- recipes/pcat/xcomp.fs | 9 ++++++++- 5 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 blk/828 diff --git a/blk/754 b/blk/754 index 351bb7b..328a007 100644 --- a/blk/754 +++ b/blk/754 @@ -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, diff --git a/blk/816 b/blk/816 index 88e5283..380ab47 100644 --- a/blk/816 +++ b/blk/816 @@ -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[], diff --git a/blk/820 b/blk/820 index b09d1ac..27b5252 100644 --- a/blk/820 +++ b/blk/820 @@ -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, diff --git a/blk/828 b/blk/828 deleted file mode 100644 index a73f7e9..0000000 --- a/blk/828 +++ /dev/null @@ -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 ; diff --git a/recipes/pcat/xcomp.fs b/recipes/pcat/xcomp.fs index 40d83c1..fdaf450 100644 --- a/recipes/pcat/xcomp.fs +++ b/recipes/pcat/xcomp.fs @@ -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 + !