mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 17:48:05 +11:00
Compare commits
No commits in common. "723d3c424987035be280a13f65f2d2222c7d643f" and "89bc7df120f65177c9282855de61ba90b7bad269" have entirely different histories.
723d3c4249
...
89bc7df120
3
blk/753
3
blk/753
@ -8,8 +8,7 @@
|
|||||||
0xaf OP1 SCASW, 0xaa OP1 STOSB, 0xab OP1 STOSW,
|
0xaf OP1 SCASW, 0xaa OP1 STOSB, 0xab OP1 STOSW,
|
||||||
( no argument, jumps with relative addrs are special )
|
( no argument, jumps with relative addrs are special )
|
||||||
0xeb OP1 JMPs, 0xe9 OP1 JMPn, 0x74 OP1 JZ,
|
0xeb OP1 JMPs, 0xe9 OP1 JMPn, 0x74 OP1 JZ,
|
||||||
0x75 OP1 JNZ, 0x72 OP1 JC, 0x73 OP1 JNC,
|
0x75 OP1 JNZ, 0xe8 OP1 CALLn,
|
||||||
0xe8 OP1 CALLn,
|
|
||||||
|
|
||||||
: OP1r CREATE C, DOES> C@ + A, ;
|
: OP1r CREATE C, DOES> C@ + A, ;
|
||||||
0x40 OP1r INCx, 0x48 OP1r DECx,
|
0x40 OP1r INCx, 0x48 OP1r DECx,
|
||||||
|
12
blk/754
12
blk/754
@ -4,7 +4,11 @@
|
|||||||
1 0xd0 OPr0 RORr1, 1 0xd1 OPr0 RORx1, 4 0xf7 OPr0 MULx,
|
1 0xd0 OPr0 RORr1, 1 0xd1 OPr0 RORx1, 4 0xf7 OPr0 MULx,
|
||||||
4 0xd0 OPr0 SHLr1, 4 0xd1 OPr0 SHLx1, 6 0xf6 OPr0 DIVr,
|
4 0xd0 OPr0 SHLr1, 4 0xd1 OPr0 SHLx1, 6 0xf6 OPr0 DIVr,
|
||||||
5 0xd0 OPr0 SHRr1, 5 0xd1 OPr0 SHRx1, 6 0xf7 OPr0 DIVx,
|
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,
|
: OPrr CREATE C, DOES> C@ A, <<3 OR 0xc0 OR A, ;
|
||||||
4 0xd2 OPr0 SHLrCL, 4 0xd3 OPr0 SHLxCL,
|
0x31 OPrr XORxx, 0x30 OPrr XORrr,
|
||||||
5 0xd2 OPr0 SHRrCL, 5 0xd3 OPr0 SHRxCL,
|
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,
|
||||||
|
|
||||||
|
15
blk/755
15
blk/755
@ -1,7 +1,10 @@
|
|||||||
: OPrr CREATE C, DOES> C@ A, <<3 OR 0xc0 OR A, ;
|
: OPm ( modrm op ) CREATE C, C, DOES> C@+ A, C@ OR A, ;
|
||||||
0x31 OPrr XORxx, 0x30 OPrr XORrr,
|
0 0xff OPm INC[w], 0 0xfe OPm INC[b],
|
||||||
0x88 OPrr MOVrr, 0x89 OPrr MOVxx, 0x28 OPrr SUBrr,
|
0x8 0xff OPm DEC[w], 0x8 0xfe OPm DEC[b],
|
||||||
0x29 OPrr SUBxx, 0x08 OPrr ORrr, 0x09 OPrr ORxx,
|
0x30 0xff OPm PUSH[w], 0 0x8f OPm POP[w],
|
||||||
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]+,
|
||||||
|
10
blk/756
10
blk/756
@ -1,10 +0,0 @@
|
|||||||
: 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]+,
|
|
1
blk/757
1
blk/757
@ -1,6 +1,5 @@
|
|||||||
: 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[],
|
||||||
0x3a OPrm CMPr[], 0x3b OPrm CMPx[],
|
|
||||||
|
|
||||||
: OPmr CREATE C, DOES> C@ A, 3 LSHIFT OR A, ;
|
: OPmr CREATE C, DOES> C@ A, 3 LSHIFT OR A, ;
|
||||||
0x88 OPmr MOV[]r, 0x89 OPmr MOV[]x,
|
0x88 OPmr MOV[]r, 0x89 OPmr MOV[]x,
|
||||||
|
4
blk/759
4
blk/759
@ -6,8 +6,8 @@
|
|||||||
: FJR, PC 0 A, ;
|
: FJR, PC 0 A, ;
|
||||||
: IFZ, JNZ, FJR, ;
|
: IFZ, JNZ, FJR, ;
|
||||||
: IFNZ, JZ, FJR, ;
|
: IFNZ, JZ, FJR, ;
|
||||||
: IFC, JNC, FJR, ;
|
( : IFC, JRNC, FJR, ;
|
||||||
: IFNC, JC, FJR, ;
|
: IFNC, JRC, FJR, ; )
|
||||||
: THEN,
|
: THEN,
|
||||||
DUP PC ( l l pc )
|
DUP PC ( l l pc )
|
||||||
-^ 1- ( l off )
|
-^ 1- ( l off )
|
||||||
|
1
blk/761
1
blk/761
@ -1,4 +1,3 @@
|
|||||||
: PUSHZ, CX 0 MOVxI, IFZ, CX INCx, THEN, CX PUSHx, ;
|
|
||||||
: CODE ( same as CREATE, but with native word )
|
: CODE ( same as CREATE, but with native word )
|
||||||
(entry) 0 ( native ) C, ;
|
(entry) 0 ( native ) C, ;
|
||||||
: ;CODE JMPn, 0x1a ( next ) RPCn, ;
|
: ;CODE JMPn, 0x1a ( next ) RPCn, ;
|
||||||
|
4
blk/811
4
blk/811
@ -4,7 +4,7 @@ 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, STI,
|
SS AX MOVsx, STI,
|
||||||
AH 2 MOVri, DX 0 MOVxI, CH 0 MOVri, CL 2 MOVri, AL 3 MOVri,
|
AH 2 MOVri, DX 0 MOVxI, CH 0 MOVri, CL 2 MOVri, AL 2 MOVri,
|
||||||
BX 0 MOVxI, 0x13 INT, ( read sectors 2-4 of boot floppy )
|
BX 0 MOVxI, 0x13 INT, ( read sectors 2-3 of boot floppy )
|
||||||
0x800 0 JMPf,
|
0x800 0 JMPf,
|
||||||
ORG @ 0x1fe + HERE ! 0x55 A, 0xaa A,
|
ORG @ 0x1fe + HERE ! 0x55 A, 0xaa A,
|
||||||
|
2
blk/812
2
blk/812
@ -1,4 +1,4 @@
|
|||||||
VARIABLE lblexec VARIABLE lblfind VARIABLE lblnext
|
VARIABLE lblexec VARIABLE lblfind
|
||||||
H@ ORG !
|
H@ ORG !
|
||||||
JMPn, 0 A,, ( 00, main ) 0 A, 0 A,, ( unused )
|
JMPn, 0 A,, ( 00, main ) 0 A, 0 A,, ( unused )
|
||||||
0 A,, ( unused ) 0 A,, ( 08, LATEST )
|
0 A,, ( unused ) 0 A,, ( 08, LATEST )
|
||||||
|
2
blk/816
2
blk/816
@ -1,4 +1,4 @@
|
|||||||
lblnext BSET PC 0x1d - ORG @ 0x1b + ! ( next )
|
PC 0x1d - ORG @ 0x1b + ! ( next )
|
||||||
DI DX MOVxx, ( <-- IP ) DX INCx, DX INCx,
|
DI DX MOVxx, ( <-- IP ) DX INCx, DX INCx,
|
||||||
DI [DI] MOVx[], ( wordref )
|
DI [DI] MOVx[], ( wordref )
|
||||||
( continue to execute )
|
( continue to execute )
|
||||||
|
18
blk/824
18
blk/824
@ -1,11 +1,11 @@
|
|||||||
CODE ! DI POPx, AX POPx, [DI] AX MOV[]x, ;CODE
|
CODE 0 AX AX XORxx, AX PUSHx, ;CODE
|
||||||
CODE @ DI POPx, AX [DI] MOVx[], AX PUSHx, ;CODE
|
CODE 1 AX 1 MOVxI, 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 I [BP] 0 PUSH[w]+, ;CODE
|
||||||
CODE I' [BP] -2 PUSH[w]+, ;CODE
|
CODE 1+ DI SP MOVxx, [DI] INC[w], ;CODE
|
||||||
CODE J [BP] -4 PUSH[w]+, ;CODE
|
CODE 1- DI SP MOVxx, [DI] DEC[w], ;CODE
|
||||||
CODE (resSP) SP PS_ADDR MOVxI, ;CODE
|
|
||||||
CODE (resRS) BP RS_ADDR MOVxI, ;CODE
|
|
||||||
CODE BYE BEGIN, JMPs, AGAIN, ;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
15
blk/825
@ -1,15 +0,0 @@
|
|||||||
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
|
|
9
blk/826
9
blk/826
@ -1,9 +0,0 @@
|
|||||||
CODE _find ( cur w -- a f )
|
|
||||||
SI POPx, ( w ) DI POPx, ( cur )
|
|
||||||
CALLn, lblfind @ RPCn,
|
|
||||||
IFNZ, ( not found )
|
|
||||||
SI PUSHx, AX AX XORxx, AX PUSHx,
|
|
||||||
JMPn, lblnext @ RPCn,
|
|
||||||
THEN, ( found )
|
|
||||||
DI PUSHx, AX 1 MOVxI, AX PUSHx,
|
|
||||||
;CODE
|
|
11
blk/827
11
blk/827
@ -1,11 +0,0 @@
|
|||||||
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
|
|
6
blk/828
6
blk/828
@ -1,6 +0,0 @@
|
|||||||
CODE EMIT
|
|
||||||
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
|
|
||||||
;CODE
|
|
||||||
: FOO '0' 1 3 LSHIFT + EMIT ;
|
|
||||||
L1 BSET 3 A, 'F' A, 'O' A, 'O' A,
|
|
||||||
: BOOT 0x08 @ [ L1 @ LITN ] _find DROP EXECUTE BYE ;
|
|
@ -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 828 LOADR
|
812 824 LOADR
|
||||||
(entry) _
|
(entry) _
|
||||||
( Update LATEST )
|
( Update LATEST )
|
||||||
PC ORG @ 8 + !
|
PC ORG @ 8 + !
|
||||||
|
Loading…
Reference in New Issue
Block a user