1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 16:48:06 +11:00

pcat: more native words

almost there!
This commit is contained in:
Virgil Dupras 2020-06-19 07:26:33 -04:00
parent 89bc7df120
commit 5ebdf84e78
8 changed files with 39 additions and 13 deletions

View File

@ -8,7 +8,8 @@
0xaf OP1 SCASW, 0xaa OP1 STOSB, 0xab OP1 STOSW,
( no argument, jumps with relative addrs are special )
0xeb OP1 JMPs, 0xe9 OP1 JMPn, 0x74 OP1 JZ,
0x75 OP1 JNZ, 0xe8 OP1 CALLn,
0x75 OP1 JNZ, 0x72 OP1 JC, 0x73 OP1 JNC,
0xe8 OP1 CALLn,
: OP1r CREATE C, DOES> C@ + A, ;
0x40 OP1r INCx, 0x48 OP1r DECx,

View File

@ -1,5 +1,6 @@
: OPrm CREATE C, DOES> C@ A, SWAP 3 LSHIFT OR A, ;
0x8a OPrm MOVr[], 0x8b OPrm MOVx[],
0x3a OPrm CMPr[], 0x3b OPrm CMPx[],
: OPmr CREATE C, DOES> C@ A, 3 LSHIFT OR A, ;
0x88 OPmr MOV[]r, 0x89 OPmr MOV[]x,

View File

@ -6,8 +6,8 @@
: FJR, PC 0 A, ;
: IFZ, JNZ, FJR, ;
: IFNZ, JZ, FJR, ;
( : IFC, JRNC, FJR, ;
: IFNC, JRC, FJR, ; )
: IFC, JNC, FJR, ;
: IFNC, JC, FJR, ;
: THEN,
DUP PC ( l l pc )
-^ 1- ( l off )

View File

@ -1,3 +1,4 @@
: PUSHZ, CX 0 MOVxI, IFZ, CX INCx, THEN, CX PUSHx, ;
: CODE ( same as CREATE, but with native word )
(entry) 0 ( native ) C, ;
: ;CODE JMPn, 0x1a ( next ) RPCn, ;

18
blk/824
View File

@ -1,11 +1,11 @@
CODE 0 AX AX XORxx, AX PUSHx, ;CODE
CODE 1 AX 1 MOVxI, AX PUSHx, ;CODE
CODE ! DI POPx, AX POPx, [DI] AX MOV[]x, ;CODE
CODE @ DI POPx, AX [DI] MOVx[], AX PUSHx, ;CODE
CODE C! DI POPx, AX POPx, [DI] AX MOV[]r, ;CODE
CODE C@
DI POPx, AH AH XORrr, AL [DI] MOVr[], AX PUSHx, ;CODE
CODE I [BP] 0 PUSH[w]+, ;CODE
CODE 1+ DI SP MOVxx, [DI] INC[w], ;CODE
CODE 1- DI SP MOVxx, [DI] DEC[w], ;CODE
CODE I' [BP] -2 PUSH[w]+, ;CODE
CODE J [BP] -4 PUSH[w]+, ;CODE
CODE (resSP) SP PS_ADDR MOVxI, ;CODE
CODE (resRS) BP RS_ADDR MOVxI, ;CODE
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
CODE EMIT
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
;CODE
: FOO 42 10 /MOD '0' + EMIT '0' + EMIT ;
: BOOT ['] FOO EXECUTE BYE ;

15
blk/825 Normal file
View File

@ -0,0 +1,15 @@
CODE S=
SI POPx, DI POPx, CH CH XORrr, CL [SI] MOVr[],
CL [DI] CMPr[],
IFZ, ( same size? )
SI INCx, DI INCx, CLD, REPZ, CMPSB,
THEN,
PUSHZ,
;CODE
CODE CMP
BX POPx, AX POPx, CX CX XORxx, AX BX CMPxx,
IFNZ, ( < or > )
CX INCx, IFNC, ( < ) CX DECx, CX DECx, THEN,
THEN,
CX PUSHx,
;CODE

8
blk/826 Normal file
View File

@ -0,0 +1,8 @@
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
: BOOT 4 5 CMP '=' + EMIT ;

View File

@ -3,7 +3,7 @@
750 LOAD ( 8086 asm )
262 LOAD ( xcomp )
270 LOAD ( xcomp overrides )
812 824 LOADR
812 826 LOADR
(entry) _
( Update LATEST )
PC ORG @ 8 + !