home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
C64
/
GFX
/
64HDPRO.ARC
/
WTBOOT.SRC
< prev
Wrap
Text File
|
2000-06-30
|
2KB
|
104 lines
;BPUT"WRITEBOOT.SRC"
;RPUT"WRITEBOOT.SRC"
;
.LIB HARDJUMP.EQ
.LIB HARDISKZ.EQ
;
* = $0840
START JSR HDINIT ;INIT CTL BLOCKS
JSR RESET ;ISSUE THE RESET
LDA #$37
STA $01
BCC NOERROR
JMP RESETERROR
NOERROR = *
LDA #$36
STA $01
LDA #$80
LDY #$28 ;GET NUMBER OF SECTORS TO READ
LDX #$40 ;GET SECTOR NUMBER
JSR WRITEIT ;GO CONVERT AND READ
BCC NOERROR1
JMP WRITEERROR ;GO IF BAD
NOERROR1 = *
LDY #0 ;MOVE RAM FROM UNDER KERNAL
SEI
LDA #$35
STA $01
MOVEROM LDA $E000,Y
STA $2000,Y
LDA $E100,Y
STA $2100,Y
LDA $E200,Y
STA $2200,Y
LDA $E300,Y
STA $2300,Y
LDA $E400,Y
STA $2400,Y
LDA $E500,Y
STA $2500,Y
LDA $E600,Y
STA $2600,Y
LDA $E700,Y
STA $2700,Y
LDA $E800,Y
STA $2800,Y
LDA $E900,Y
STA $2900,Y
LDA $EA00,Y
STA $2A00,Y
LDA $EB00,Y
STA $2B00,Y
LDA $EC00,Y
STA $2C00,Y
INY
BNE MOVEROM
LDA #$37
STA $01
CLI
LDA #$20 ;ADDRESS INPUT AREA
LDY #$10
LDX #$69
JSR WRITEIT
BCS WRITEERROR
RTS
;
WRITEIT STA BUFADR+1 ;ADDRESS INPUT
STY BLKCNT ;# 512 BYTE BLOCKS
STX SECNUM+2
LDA #0
STA HDNUM ;CLEAR THE DRIVE NUMBER
STA SECNUM
STA SECNUM+1
JSR SEC2CYLDCB ;CONVERT TO DISK ADDR
LDA HEAD ;FILL THE DCB
STA HDNUM
LDA CYLLSB ;GET LOW CYL ADDR
STA CYLNUM
LDA CYLMSB ;GET HI CYL AND SECTOR
STA SECADR ;PUT IN DCB
LDA #<IGNORE
LDY #>IGNORE
STA $FFFE
STY $FFFF
STA $FFFA
STY $FFFB
JSR WRITE ;READ AND RETURN TO CALLER
RTS
;
IGNORE RTI
;
RESETERROR LDX #0
.BYT $2C ;
WRITEERROR LDX #14
WRITEERRORL LDA RESETMSG,X
BEQ DONE
JSR $FFD2
INX
BNE WRITEERRORL
DONE RTS
BRK
;
RESETMSG .BYT 'RESET FAILED',13,0
WRITEERRMSG .BYT 'WRITE FAILED',13,0
.END