home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
sourcecode
/
dexion
/
bootloader.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
2KB
|
117 lines
execbase=4
findtask=-294
addport=-354
remport=-360
openlib=-408
opendev=-444
closedev=-450
doio=-456
WBOOT: LEA BOOTSECTOR,A0
MOVE.L #$FFFFFFFF,D0
MOVE.L #$FF,D1
CLR.L D2
WBOOT1: SUB.L (A0)+,D0
SUBX.L D2,D0
DBRA D1,WBOOT1
MOVE.L D0,BOOTSECTOR+$4
MOVE.L EXECBASE,A6
MOVE.L #0,A1
JSR FINDTASK(A6)
MOVE.L D0,WPORT+$10
LEA WPORT,A1
JSR ADDPORT(A6)
LEA WIO,A1
MOVE.L #0,D0
CLR.L D1
LEA WTRDDEVICE,A0
JSR OPENDEV(A6)
TST.L D0
BNE WERROR
LEA WIO,A1
MOVE.L #WPORT,14(A1)
MOVE.W #3,28(A1)
MOVE.L #BOOTSECTOR,40(A1)
MOVE.L #2*512,36(A1)
MOVE.L #0*512,44(A1)
JSR DOIO(A6)
MOVE.W #4,28(A1)
JSR DOIO(A6)
MOVE.W #9,28(A1)
MOVE.L #0,36(A1)
JSR DOIO(A6)
LEA WPORT,A1
JSR REMPORT(A6)
LEA WIO,A1
JSR CLOSEDEV(A6)
WERROR: RTS
WTRDDEVICE:DC.B 'trackdisk.device',0
EVEN
WIO: BLK.L 20,0
WPORT: BLK.L 8,0
bootsector:
dc.b 'DOS',0
dc.l 0
dc.l 880
bootprog:
move.l execbase,a6
lea dosname(pc),a1
jsr -96(a6)
move.l d0,a0
move.l 22(a0),a0
moveq #0,d0
jmp bootprogramr
dosname: dc.b 'dos.library',0
bootprogramr:
move.l #0,a1
move.l $4,a6
jsr -294(a6)
move.l d0,bwport+$10
lea bwport,a1
jsr -354(a6)
lea bwio,a1
move.l #0,d0
clr.l d1
lea bwtrddevice,a0
jsr -444(a6)
tst.l d0
bne berror
lea bwio,a1
move.l #bwport,14(a1)
move.w #2,28(a1)
move.l #$7000,40(a1)
move.l #8*512,36(a1)
move.l #1024,44(a1)
jsr -456(a6)
move.w #4,28(a1)
jsr -456(a6)
move.w #9,28(a1)
move.l #0,28(a1)
jsr -456(a6)
lea bwport,a1
jsr -360(a6)
lea bwio,a1
jsr -450(a6)
jmp $7000
berror: rts
bwtrddevice: dc.b 'trackdisk.device',0
even
bwio: blk.l 20,0
bwport: blk.l 8,0