From 723d3c424987035be280a13f65f2d2222c7d643f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 19 Jun 2020 08:10:51 -0400 Subject: [PATCH] pcat: all native words implemented! (well, not PC@ and PC!, but I'm not even sure what would be the role of these in a PC/AT. they're only used in drivers on the z80 front, so they will not be immediately needed. todo... ) Now comes the fitting part. --- blk/754 | 12 ++++-------- blk/755 | 15 ++++++--------- blk/756 | 10 ++++++++++ blk/827 | 11 +++++++++++ blk/828 | 6 +----- 5 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 blk/756 create mode 100644 blk/827 diff --git a/blk/754 b/blk/754 index 7e704e3..351bb7b 100644 --- a/blk/754 +++ b/blk/754 @@ -4,11 +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, - -: OPrr CREATE C, DOES> C@ A, <<3 OR 0xc0 OR A, ; -0x31 OPrr XORxx, 0x30 OPrr XORrr, -0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr, -0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx, -0x3a OPrr CMPrr, 0x3b OPrr CMPxx, 0x00 OPrr ADDrr, -0x01 OPrr ADDxx, 0x20 OPrr ANDrr, 0x21 OPrr ANDxx, - +0 0xd2 OPr0 ROLrCL, 0 0xd3 OPr0 ROLxCL, +1 0xd2 OPr0 RORrCL, 1 0xd3 OPr0 RORxCL, +4 0xd2 OPr0 SHLrCL, 4 0xd3 OPr0 SHLxCL, +5 0xd2 OPr0 SHRrCL, 5 0xd3 OPr0 SHRxCL, diff --git a/blk/755 b/blk/755 index 472d027..5576045 100644 --- a/blk/755 +++ b/blk/755 @@ -1,10 +1,7 @@ -: OPm ( modrm op ) CREATE C, C, DOES> C@+ A, C@ OR A, ; -0 0xff OPm INC[w], 0 0xfe OPm INC[b], -0x8 0xff OPm DEC[w], 0x8 0xfe OPm DEC[b], -0x30 0xff OPm PUSH[w], 0 0x8f OPm POP[w], +: OPrr CREATE C, DOES> C@ A, <<3 OR 0xc0 OR A, ; +0x31 OPrr XORxx, 0x30 OPrr XORrr, +0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr, +0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx, +0x3a OPrr CMPrr, 0x3b OPrr CMPxx, 0x00 OPrr ADDrr, +0x01 OPrr ADDxx, 0x20 OPrr ANDrr, 0x21 OPrr ANDxx, -: OPm+ ( modrm op ) CREATE C, C, DOES> - ( m off ) C@+ A, C@ ROT OR A, A, ; -0x40 0xff OPm+ INC[w]+, 0x40 0xfe OPm+ INC[b]+, -0x48 0xff OPm+ DEC[w]+, 0x48 0xfe OPm+ DEC[b]+, -0x70 0xff OPm+ PUSH[w]+, 0x40 0x8f OPm+ POP[w]+, diff --git a/blk/756 b/blk/756 new file mode 100644 index 0000000..472d027 --- /dev/null +++ b/blk/756 @@ -0,0 +1,10 @@ +: OPm ( modrm op ) CREATE C, C, DOES> C@+ A, C@ OR A, ; +0 0xff OPm INC[w], 0 0xfe OPm INC[b], +0x8 0xff OPm DEC[w], 0x8 0xfe OPm DEC[b], +0x30 0xff OPm PUSH[w], 0 0x8f OPm POP[w], + +: OPm+ ( modrm op ) CREATE C, C, DOES> + ( m off ) C@+ A, C@ ROT OR A, A, ; +0x40 0xff OPm+ INC[w]+, 0x40 0xfe OPm+ INC[b]+, +0x48 0xff OPm+ DEC[w]+, 0x48 0xfe OPm+ DEC[b]+, +0x70 0xff OPm+ PUSH[w]+, 0x40 0x8f OPm+ POP[w]+, diff --git a/blk/827 b/blk/827 new file mode 100644 index 0000000..e8863e2 --- /dev/null +++ b/blk/827 @@ -0,0 +1,11 @@ +CODE 0 AX AX XORxx, AX PUSHx, ;CODE +CODE 1 AX 1 MOVxI, AX PUSHx, ;CODE +CODE -1 AX -1 MOVxI, AX PUSHx, ;CODE +CODE 1+ DI SP MOVxx, [DI] INC[w], ;CODE +CODE 1- DI SP MOVxx, [DI] DEC[w], ;CODE +CODE 2+ DI SP MOVxx, [DI] INC[w], [DI] INC[w], ;CODE +CODE 2- DI SP MOVxx, [DI] DEC[w], [DI] DEC[w], ;CODE +CODE RSHIFT ( n u -- n ) + CX POPx, AX POPx, AX SHRxCL, AX PUSHx, ;CODE +CODE LSHIFT ( n u -- n ) + CX POPx, AX POPx, AX SHLxCL, AX PUSHx, ;CODE diff --git a/blk/828 b/blk/828 index ea1d84a..bff76c1 100644 --- a/blk/828 +++ b/blk/828 @@ -1,10 +1,6 @@ -CODE 0 AX AX XORxx, AX PUSHx, ;CODE -CODE 1 AX 1 MOVxI, AX PUSHx, ;CODE -CODE 1+ DI SP MOVxx, [DI] INC[w], ;CODE -CODE 1- DI SP MOVxx, [DI] DEC[w], ;CODE CODE EMIT AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT, ;CODE -: FOO 'X' EMIT ; +: FOO '0' 1 3 LSHIFT + EMIT ; L1 BSET 3 A, 'F' A, 'O' A, 'O' A, : BOOT 0x08 @ [ L1 @ LITN ] _find DROP EXECUTE BYE ;