MacIIROMDiskDriver/entry.s

61 lines
940 B
ArmAsm
Raw Normal View History

2020-06-26 07:12:08 +00:00
.EQU killCode, 1
.EQU noQueueBit, 9
.EQU kioTrap, 6
.EQU kioResult, 16
.EQU kcsCode, 26
.EQU JIODone, 0x08FC
2020-06-30 01:08:50 +00:00
dc.l 0x00000000, 0x00000000, 0x00000000, 0x00000000
dc.l 0x00000000, 0x00000000, 0x00000000, 0x00000000
2020-07-02 07:06:35 +00:00
.ascii "\5RDisk\0"
2020-06-30 01:08:50 +00:00
.align 4
2020-06-26 07:12:08 +00:00
DOpen:
2020-06-30 01:08:50 +00:00
movem.l %A0-%A1, -(%SP)
2020-06-26 07:12:08 +00:00
bsr RDiskOpen
2020-06-30 01:08:50 +00:00
movem.l (%SP)+, %A0-%A1
2020-06-26 07:12:08 +00:00
rts
DClose:
2020-06-30 01:08:50 +00:00
movem.l %A0-%A1, -(%SP)
2020-06-26 07:12:08 +00:00
bsr RDiskClose
2020-06-30 01:08:50 +00:00
movem.l (%SP)+, %A0-%A1
2020-06-26 07:12:08 +00:00
rts
DPrime:
2020-06-30 01:08:50 +00:00
movem.l %A0-%A1, -(%SP)
2020-06-26 07:12:08 +00:00
bsr RDiskPrime
2020-06-30 01:08:50 +00:00
movem.l (%SP)+, %A0-%A1
2020-06-26 07:12:08 +00:00
bra.b IOReturn
DControl:
2020-06-30 01:08:50 +00:00
movem.l %A0-%A1, -(%SP)
2020-06-26 07:12:08 +00:00
bsr RDiskControl
2020-06-30 01:08:50 +00:00
movem.l (%SP)+, %A0-%A1
2020-06-26 07:12:08 +00:00
cmpi.w #killCode, kcsCode(%A0)
bne.b IOReturn
rts
DStatus:
2020-06-30 01:08:50 +00:00
movem.l %A0-%A1, -(%SP)
2020-06-26 07:12:08 +00:00
bsr RDiskStatus
2020-06-30 01:08:50 +00:00
movem.l (%SP)+, %A0-%A1
2020-06-26 07:12:08 +00:00
IOReturn:
2020-06-30 01:08:50 +00:00
move.w kioTrap(%A0), %D1
btst #noQueueBit, %D1
2020-06-26 07:12:08 +00:00
beq.b Queued
NotQueued:
tst.w %D0
ble.b ImmedRTS
clr.w %D0
ImmedRTS:
2020-06-30 01:08:50 +00:00
move.w %D0, kioResult(%A0)
2020-06-26 07:12:08 +00:00
rts
Queued:
2020-06-30 01:08:50 +00:00
move.l JIODone, -(%SP)
2020-06-26 07:12:08 +00:00
rts