1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 18:38:06 +11:00

Compare commits

..

No commits in common. "bc8144b4be5540a78768c95a94a8ed5dcdcd2606" and "a92864a595aaf459402f2c9452a80e0acf89b9d8" have entirely different histories.

9 changed files with 59 additions and 71 deletions

View File

@ -1,7 +1,7 @@
CODE (?br) ( 0x67 ) CODE (?br) ( 0x67 )
HL POPqq, HL POPqq,
HLZ, HLZ,
JRZ, L2 BWR ( br + 1. False, branch ) JRZ, L2 BWR ( BR + 2. False, branch )
L1 BSET ( loop will jump here ) L1 BSET ( loop will jump here )
( True, skip next 2 bytes and don't branch ) ( True, skip next 2 bytes and don't branch )
IY INCss, IY INCss, IY INCss, IY INCss,

View File

@ -2,5 +2,4 @@
0x31 OPrr XORxx, 0x30 OPrr XORrr, 0x31 OPrr XORxx, 0x30 OPrr XORrr,
0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr, 0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr,
0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx, 0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx,
0x3a OPrr CMPrr, 0x3b OPrr CMPxx, 0x00 OPrr ADDrr, 0x3a OPrr CMPrr, 0x3b OPrr CMPxx,
0x01 OPrr ADDxx,

17
blk/813
View File

@ -1,16 +1,15 @@
( BOOT DICT: There are only 3 words in the boot dict, but ( BOOT DICT: There are only 3 words in the boot dict, but
these words' offset need to be stable, so they're part of these words' offset need to be stable, so they're part of
the "stable ABI" ) the "stable ABI" )
'E' A, 'X' A, 'I' A, 'T' A, 0 A,, ( prev ) 4 A, ( len ) 'E' A, 'X' A, 'I' A, 'T' A,
0 A,, ( prev )
4 A,
H@ XCURRENT ! ( set current tip of dict, 0x42 ) H@ XCURRENT ! ( set current tip of dict, 0x42 )
0x17 A, ( nativeWord ) 0x17 A, ( nativeWord )
DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS ) DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS )
;CODE NOP,
CODE (br) ( 0x53 ) L2 BSET ( used in br? )
DI DX MOVxx, DI [DI] MOVx[], DX DI ADDxx,
;CODE NOP, NOP,
CODE (br?) ( 0x67 )
AX POPx, AX AX ORxx, JZ, L2 @ RPCs, ( False, branch )
( True, skip next 2 bytes and don't branch )
DX INCx, DX INCx,
;CODE ;CODE
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
CODE FOO
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
;CODE
: BAR FOO FOO ; : BAZ BAR FOO BYE ;

19
blk/814
View File

@ -1,5 +1,14 @@
PC ORG @ 0x20 + ! ( numberWord ) PC 0x1d - ORG @ 0x1b + ! ( next )
PC ORG @ 0x24 + ! ( addrWord ) ( see B287 for comments ) DI DX MOVxx, ( <-- IP ) DX INCx, DX INCx,
DI DX MOVxx, DI [DI] MOVx[], DI PUSHx, DI [DI] MOVx[], ( wordref )
DX INCx, DX INCx, ( continue to execute )
;CODE L1 BSET PC 0x36 - ORG @ 0x34 + ! ( execute -- DI -> wordref )
AH AH XORrr, AL [DI] MOVr[],
DI INCx, ( PFA )
AX JMPr,
PC 0x11 - ORG @ 0x0f + ! ( compiledWord -- DI -> PFA )
BP INCx, BP INCx, [BP] 0 DX MOV[]+x, ( pushRS )
DX DI MOVxx, DX INCx, DX INCx, ( --> IP )
DI [DI] MOVx[],
JMPs, L1 @ RPCs,

30
blk/815
View File

@ -1,14 +1,16 @@
PC 0x1d - ORG @ 0x1b + ! ( next ) L4 BSET PC 3 - ORG @ 4 + ! ( find )
DI DX MOVxx, ( <-- IP ) DX INCx, DX INCx, ( find word the same name as str in SI starting from tip in
DI [DI] MOVx[], ( wordref ) DI. Returns wordref in BX. Z if found, NZ if not. )
( continue to execute ) CH CH XORrr, CL [SI] MOVr[], ( CX -> strlen )
L1 BSET PC 0x36 - ORG @ 0x34 + ! ( execute -- DI -> wordref ) SI INCx, ( first char ) AX AX XORxx, ( initial prev )
AH AH XORrr, AL [DI] MOVr[], BEGIN, ( loop )
DI INCx, ( PFA ) DI AX SUBxx, ( jump to prev wordref )
AX JMPr, AL [DI] -1 MOVr[]+, ( strlen )
CL AL CMPrr, IFZ, ( same len )
PC 0x11 - ORG @ 0x0f + ! ( compiledWord -- DI -> PFA ) SI PUSHx, DI PUSHx, CX PUSHx, ( --> lvl 3 )
BP INCx, BP INCx, [BP] 0 DX MOV[]+x, ( pushRS ) 3 ADDALi, ( header ) AH AH XORrr, DI AX SUBxx,
DX DI MOVxx, DX INCx, DX INCx, ( --> IP ) REPZ, CMPSB,
DI [DI] MOVx[], CX POPx, DI POPx, SI POPx, ( <-- lvl 3 )
JMPs, L1 @ RPCs, IFZ, AL AL XORrr, ( Z ) RETn, THEN,
THEN,
( cont. )

22
blk/816
View File

@ -1,16 +1,6 @@
L4 BSET PC 3 - ORG @ 4 + ! ( find ) ( find cont. )
( find word the same name as str in SI starting from tip in DI 3 SUBxi, AX [DI] MOVx[], ( prev )
DI. Returns wordref in DI. Z if found, NZ if not. ) AX AX ORxx,
CH CH XORrr, CL [SI] MOVr[], ( CX -> strlen ) JNZ, AGAIN, ( loop )
SI INCx, ( first char ) AX AX XORxx, ( initial prev ) AX INCx, ( NZ ) RETn,
BEGIN, ( loop )
DI AX SUBxx, ( jump to prev wordref )
AL [DI] -1 MOVr[]+, ( strlen )
CL AL CMPrr, IFZ, ( same len )
SI PUSHx, DI PUSHx, CX PUSHx, ( --> lvl 3 )
3 ADDALi, ( header ) AH AH XORrr, DI AX SUBxx,
REPZ, CMPSB,
CX POPx, DI POPx, SI POPx, ( <-- lvl 3 )
IFZ, AL AL XORrr, ( Z ) RETn, THEN,
THEN,
( cont. )

16
blk/817
View File

@ -1,6 +1,10 @@
( find cont. ) L3 BSET 3 A, 'B' A, 'A' A, 'Z' A,
DI 3 SUBxi, AX [DI] MOVx[], ( prev ) PC 3 - ORG @ 1+ ! ( main )
AX AX ORxx, SP PS_ADDR MOVxI,
JNZ, AGAIN, ( loop ) BP RS_ADDR MOVxI,
AX INCx, ( NZ ) RETn, DI 0x08 MOVxm, ( LATEST )
SI L3 @ MOVxI,
CALLn, L4 @ RPCn, ( find )
IFZ, JMPs, L1 @ RPCs, ( execute ) THEN,
AH 0x0e MOVri, ( print char ) AL '!' MOVri, 0x10 INT,
BEGIN, JMPs, AGAIN,

15
blk/818
View File

@ -1,15 +0,0 @@
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
CODE EMIT
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
;CODE CODE 0 AX AX XORxx, AX PUSHx, ;CODE
: FOO 'X' EMIT ; : BAR 0 IF FOO THEN FOO BYE ;
L3 BSET 3 A, 'B' A, 'A' A, 'R' A,
PC 3 - ORG @ 1+ ! ( main )
SP PS_ADDR MOVxI,
BP RS_ADDR MOVxI,
DI 0x08 MOVxm, ( LATEST )
SI L3 @ MOVxI,
CALLn, L4 @ RPCn, ( find )
IFZ, JMPn, L1 @ RPCn, ( execute ) THEN,
AH 0x0e MOVri, ( print char ) AL '!' MOVri, 0x10 INT,
BEGIN, JMPs, AGAIN,

View File

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