instead of hardcoded drive 0.pull/128/head
@@ -1,7 +1,10 @@ | |||||
: 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, ; | |||||
: MOVxm, 0x8b A, SWAP 3 LSHIFT 0x6 OR A, A,, ; | |||||
: MOVsx, 0x8e A, SWAP <<3 OR 0xc0 OR A, ; | |||||
: MOVrm, 0x8a A, SWAP <<3 0x6 OR A, A,, ; | |||||
: MOVxm, 0x8b A, SWAP <<3 0x6 OR A, A,, ; | |||||
: MOVmr, 0x88 A, <<3 0x6 OR A, A,, ; | |||||
: MOVmx, 0x89 A, <<3 0x6 OR A, A,, ; | |||||
: SUBxi, 0x83 A, SWAP 0xe8 OR A, A, ; | : SUBxi, 0x83 A, SWAP 0xe8 OR A, A, ; | ||||
: ADDxi, 0x83 A, SWAP 0xc0 OR A, A, ; | : ADDxi, 0x83 A, SWAP 0xc0 OR A, A, ; | ||||
: JMPr, 0xff A, 7 AND 0xe0 OR A, ; | : JMPr, 0xff A, 7 AND 0xe0 OR A, ; | ||||
@@ -3,8 +3,8 @@ 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, STI, | |||||
AH 2 MOVri, DX 0 MOVxI, CH 0 MOVri, CL 2 MOVri, AL 15 MOVri, | |||||
SS AX MOVsx, DX PUSHx, ( will be popped by OS ) STI, | |||||
AH 2 MOVri, DH 0 MOVri, CH 0 MOVri, CL 2 MOVri, AL 15 MOVri, | |||||
BX 0 MOVxI, 0x13 INT, ( read sectors 2-15 of boot floppy ) | BX 0 MOVxI, 0x13 INT, ( read sectors 2-15 of boot floppy ) | ||||
( TODO: reading 12 sectors like this probably doesn't work | ( TODO: reading 12 sectors like this probably doesn't work | ||||
on real vintage PC/AT with floppy. Make this more robust. ) | on real vintage PC/AT with floppy. Make this more robust. ) | ||||
@@ -1,11 +1,11 @@ | |||||
VARIABLE lblexec VARIABLE lblnext | VARIABLE lblexec VARIABLE lblnext | ||||
H@ ORG ! | H@ ORG ! | ||||
JMPn, 0 A,, ( 00, main ) 0 A, ( unused ) 0 A,, ( 04, BOOT ) | |||||
JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno ) | |||||
0 A,, ( 04, BOOT ) | |||||
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) | 0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) | ||||
0 A, 0 A, 0 A,, ( unused ) | |||||
0 A, 0 A, 0 A,, ( unused ) | |||||
0 A, 0 A,, ( unused ) JMPn, 0 A,, ( 11, pushRS ) | 0 A, 0 A,, ( unused ) JMPn, 0 A,, ( 11, pushRS ) | ||||
JMPn, 0 A,, ( 14, popRS ) | |||||
0 A, 0 A,, ( unused ) | |||||
JMPn, 0 A,, ( 14, popRS ) 0 A, 0 A,, ( unused ) | |||||
JMPn, 0 A,, ( 1a, next ) 0 A, 0 A,, ( unused ) | JMPn, 0 A,, ( 1a, next ) 0 A, 0 A,, ( unused ) | ||||
0 A, 0 A, 0 A, 0 A, ( unused ) | 0 A, 0 A, 0 A, 0 A, ( unused ) | ||||
0 A, 0 A, 0 A, 0 A, ( unused ) | 0 A, 0 A, 0 A, 0 A, ( unused ) | ||||
@@ -1,9 +1,9 @@ | |||||
PC 3 - ORG @ 1+ ! ( main ) | PC 3 - ORG @ 1+ ! ( main ) | ||||
DX POPx, ( boot drive no ) 0x03 DL MOVmr, | |||||
SP PS_ADDR MOVxI, BP RS_ADDR MOVxI, | SP PS_ADDR MOVxI, BP RS_ADDR MOVxI, | ||||
DI 0x08 MOVxm, ( LATEST ) | DI 0x08 MOVxm, ( LATEST ) | ||||
( HERE begins at CURRENT ) | ( HERE begins at CURRENT ) | ||||
BX RAMSTART MOVxI, | |||||
[BX] 0x04 ( HERE ) DI MOV[]+x, | |||||
[BX] 0x02 ( CURRENT ) DI MOV[]+x, | |||||
RAMSTART 0x4 ( HERE ) + DI MOVmx, | |||||
RAMSTART 0x2 ( CURRENT ) + DI MOVmx, | |||||
DI 0x04 ( BOOT ) MOVxm, | DI 0x04 ( BOOT ) MOVxm, | ||||
JMPn, lblexec @ RPCn, ( execute ) | JMPn, lblexec @ RPCn, ( execute ) |
@@ -27,12 +27,12 @@ CODE 13H ( ax bx cx dx -- ax bx cx dx ) | |||||
: FDSPT 0x70 RAM+ ; | : FDSPT 0x70 RAM+ ; | ||||
: _ ( dest secno ) | : _ ( dest secno ) | ||||
( AH=read sectors, AL=1 sector, BX=dest, | ( AH=read sectors, AL=1 sector, BX=dest, | ||||
CH=trackno CL=secno DH=head. ) | |||||
CH=trackno CL=secno DH=head DL=drive ) | |||||
0x0201 ROT ROT ( AX BX sec ) | 0x0201 ROT ROT ( AX BX sec ) | ||||
FDSPT @ /MOD ( AX BX sec trk ) | FDSPT @ /MOD ( AX BX sec trk ) | ||||
2 /MOD ( AX BX sec head trk ) | 2 /MOD ( AX BX sec head trk ) | ||||
8 LSHIFT ROT OR 1+ ( AX BX head CX ) | 8 LSHIFT ROT OR 1+ ( AX BX head CX ) | ||||
SWAP 8 LSHIFT ( AX BX CX DX ) | |||||
SWAP 8 LSHIFT 0x03 C@ ( boot drive ) OR ( AX BX CX DX ) | |||||
13H 2DROP 2DROP | 13H 2DROP 2DROP | ||||
; | ; | ||||
: FD@ | : FD@ | ||||
@@ -41,7 +41,7 @@ CODE 13H ( ax bx cx dx -- ax bx cx dx ) | |||||
: FD! DROP ; | : FD! DROP ; | ||||
: FD$ | : FD$ | ||||
( get number of sectors per track with command 08H. ) | ( get number of sectors per track with command 08H. ) | ||||
0 13H08H 0x3f AND FDSPT ! | |||||
0x03 ( boot drive ) C@ 13H08H 0x3f AND FDSPT ! | |||||
; | ; | ||||
380 LOAD ( xcomp core high ) | 380 LOAD ( xcomp core high ) | ||||
(entry) _ | (entry) _ | ||||