PCS_AppleII/source_disc2/BOOT2.S
2013-02-24 13:49:08 -08:00

141 lines
1.4 KiB
ArmAsm

*
* SECOND STAGE BOOT
*
ORG $B700
OBJ $8000
*
TEMP EQU 7
SWAPEDIT EQU $1E00
*
STX SLOT
STX SLOTFOUND
STX BOOTSLOT
LDA #1
STA DRIVE
STA DRIVEFOUND
TXA
LSR
LSR
LSR
LSR
TAX
LDA #0
STA $1FD8,X
STA $1FD0,X
LDA #13
STA SECTORCOUNT
LDA #1
LDX #12
LDY #$B5
JSR READSECTORS
*
LDA #1
STA SECTORCOUNT
LDA #3
LDX #8
LDY #$40
JSR READSECTORS
*
LDA #23
STA SECTORCOUNT
LDA #3
LDX #6
LDY #$1E
JSR READSECTORS
*
LDA #32
STA SECTORCOUNT
LDA #5
LDX #15
LDY #$3F
JSR READSECTORS
*
STA $C050
STA $C052
STA $C054
STA $C057
STA $C010
TIME LDA #20
STA TEMP
TIM2 LDA $C000
ORA $C061
ORA $C062
BMI TIM3
LDA #0
JSR $FCA8
DEC TEMP
BPL TIM2
TIM3 EQU *
*
LDX #$FF
TXS
JMP SWAPEDIT
*
READSECTORS STA TRACK
STX SECTOR
STY READBUFHI
LDA #1
STA CMDCODE
READS2 LDA #>RWTSPARMS
LDY #<RWTSPARMS
JSR RWTSCALL
BCS READS2
LDY SECTOR
DEY
BPL READS3
LDY #15
DEC TRACK
READS3 STY SECTOR
DEC READBUFHI
DEC SECTORCOUNT
BNE READS2
RTS
*
DS $3
*
RWTSCALL PHP
SEI
JSR $BD00
BCS BADCALL
PLP
CLC
RTS
BADCALL PLP
SEC
RTS
*
BOOT2PARMS EQU *
SECTORCOUNT HEX 00
BOOTSLOT HEX 00
*
DS $12
*
BZERO LDA #0
TAY
BZER2 STA ($42),Y
INY
BNE BZER2
RTS
*
DS $9
*
RWTSPARMS EQU *
TABLETYPE HEX 01
SLOT HEX 00
DRIVE HEX 00
VOLUME HEX 00
TRACK HEX 00
SECTOR HEX 00
DA DEVCHARTBL
READBUFLO HEX 00
READBUFHI HEX 00
HEX 00
HEX 00
CMDCODE HEX 00
ERRCODE HEX 00
VOLFOUND HEX 00
SLOTFOUND HEX 00
DRIVEFOUND HEX 00
*
DEVCHARTBL HEX 00,01,EF,D8