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

Compare commits

..

No commits in common. "dabbd6c2530b779acfafc09453da40f7aee23ce7" and "8c452f5add50a361ec060a4ac65482e4fd66f463" have entirely different histories.

10 changed files with 30 additions and 45 deletions

View File

@ -6,7 +6,7 @@ Mnemonics are followed by argument types. For example, MOVri,
moves 8-bit immediate to 8-bit register. moves 8-bit immediate to 8-bit register.
'r' = 8-bit register 'x' = 16-bit register 'r' = 8-bit register 'x' = 16-bit register
'i' = 8-bit immediate 'I' = 16-bit immediate 'i' = immediate, size depends on other operand.
's' = SREG register 's' = SREG register
Mnemonics that only have one signature (for example INT,) don't Mnemonics that only have one signature (for example INT,) don't

View File

@ -1,16 +1,11 @@
: OPrm CREATE C, DOES> C@ A, SWAP 3 LSHIFT OR A, ; : OPrm CREATE C, DOES> C@ A, SWAP 3 LSHIFT OR A, ;
0x8a OPrm MOVr[], 0x8b OPrm MOVx[], 0x8a OPrm MOVr[], 0x8b OPrm MOVx[],
: OPrm+ ( r m off ) CREATE C, DOES>
C@ A, ROT 3 LSHIFT ROT OR 0x40 OR A, A, ;
0x8a OPrm+ MOVr[]+, 0x8b OPrm+ MOVx[]+,
: MOVri, SWAP 0xb0 OR A, A, ; : MOVri, SWAP 0xb0 OR A, A, ;
: MOVxI, SWAP 0xb8 OR A, A,, ; : MOVxi, SWAP 0xb8 OR A, A,, ;
: MOVsx, 0x8e A, SWAP 3 LSHIFT OR 0xc0 OR A, ; : MOVsx, 0x8e A, SWAP 3 LSHIFT OR 0xc0 OR A, ;
: MOVxm, 0x8b A, SWAP 3 LSHIFT 0x6 OR A, A,, ; : MOVxm, 0x8b A, SWAP 3 LSHIFT 0x6 OR A, A,, ;
: INT, 0xcd A, A, ; : INT, 0xcd A, A, ;
: ADDAXI, 0x05 A, A,, ; : ADDALi, 0x04 A, A, ; : ADDAXi, 0x05 A, A,, ; : ADDALi, 0x04 A, A, ;
: SUBxi, 0x83 A, SWAP 0xe8 OR A, A, ;
: JMPr, 0xff A, 7 AND 0xe0 OR A, ; : JMPr, 0xff A, 7 AND 0xe0 OR A, ;
: JMPf, ( seg off ) 0xea A, SPLITB A, A, A,, ; : JMPf, ( seg off ) 0xea A, SPLITB A, A, A,, ;

View File

@ -2,9 +2,9 @@ H@ ORG ! 0x7c00 BIN( ! ( BIOS loads boot bin at 0x7c00 )
JMPs, L1 FWRs ( start ) JMPs, L1 FWRs ( start )
ORG @ 0x25 + HERE ! ( bypass BPB ) ORG @ 0x25 + HERE ! ( bypass BPB )
L1 FSET ( start ) L1 FSET ( start )
CLI, CLD, AX 0x800 MOVxI, DS AX MOVsx, ES AX MOVsx, CLI, CLD, AX 0x800 MOVxi, DS AX MOVsx, ES AX MOVsx,
SS AX MOVsx, SP 0xffff MOVxI, STI, SS AX MOVsx, SP 0xffff MOVxi, STI,
AH 2 MOVri, DX 0 MOVxI, CH 0 MOVri, CL 2 MOVri, AL 1 MOVri, AH 2 MOVri, DX 0 MOVxi, CH 0 MOVri, CL 2 MOVri, AL 1 MOVri,
BX 0 MOVxI, 0x13 INT, ( read 2nd sector of boot floppy ) BX 0 MOVxi, 0x13 INT, ( read 2nd sector of boot floppy )
0x800 0 JMPf, 0x800 0 JMPf,
ORG @ 0x1fe + HERE ! 0x55 A, 0xaa A, ORG @ 0x1fe + HERE ! 0x55 A, 0xaa A,

View File

@ -5,7 +5,7 @@ JMPn, 0 A,, ( 00, main ) JMPn, 0 A,, ( 03, find )
0 A, ( 0a, unused ) JMPn, 0 A,, ( 0b, cellWord ) 0 A, ( 0a, unused ) JMPn, 0 A,, ( 0b, cellWord )
JMPn, 0 A,, ( 0e compiledWord ) JMPn, 0 A,, ( 11, pushRS ) JMPn, 0 A,, ( 0e compiledWord ) JMPn, 0 A,, ( 11, pushRS )
JMPn, 0 A,, ( 14, popRS ) JMPn, 0 A,, ( 14, popRS )
DI JMPr, ( 17, nativeWord ) 0 A, BX JMPr, ( 17, nativeWord ) 0 A,
JMPn, 0 A,, ( 1a, next ) JMPn, 0 A,, ( 1d, unused ) JMPn, 0 A,, ( 1a, next ) JMPn, 0 A,, ( 1d, unused )
0 A, 0 A, ( 20, numberWord ) 0 A, 0 A, ( 22, litWord ) 0 A, 0 A, ( 20, numberWord ) 0 A, 0 A, ( 22, litWord )
0 A, 0 A, ( 24, addrWord ) 0 A, 0 A, ( 26, unused ) 0 A, 0 A, ( 24, addrWord ) 0 A, 0 A, ( 26, unused )

View File

@ -9,5 +9,5 @@ H@ XCURRENT ! ( set current tip of dict, 0x42 )
;CODE ;CODE
CODE FOO CODE FOO
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT, AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
BEGIN, JMPs, AGAIN, L2 BSET JMPs, L2 @ RPCs,
;CODE ;CODE

View File

@ -1,5 +1,5 @@
L1 BSET PC 3 - ORG @ 0x34 + ! ( execute -- DI -> wordref ) L1 BSET PC 3 - ORG @ 0x34 + ! ( execute -- BX -> wordref )
AH AH XORrr, AH AH XORrr,
AL [DI] MOVr[], AL [BX] MOVr[],
DI INCx, ( PFA ) BX INCx, ( PFA )
AX JMPr, AX JMPr,

24
blk/815
View File

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

12
blk/816
View File

@ -1,6 +1,6 @@
( find cont. ) L3 BSET 3 A, 'F' A, 'O' A, 'O' A,
DI 3 SUBxi, AX [DI] MOVx[], ( prev ) PC 3 - ORG @ 1+ ! ( main )
AX AX ORxx, BX 0x08 MOVxm, ( LATEST )
JNZ, AGAIN, ( loop ) SI L3 @ MOVxi,
AX INCx, ( NZ ) RETn, CALLn, L4 @ RPCn, ( find )
JMPs, L1 @ RPCs, ( execute )

View File

@ -1,8 +0,0 @@
L3 BSET 3 A, 'F' A, 'O' A, 'O' A,
PC 3 - ORG @ 1+ ! ( main )
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,

View File

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