home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 55
/
Amiga_Dream_55.iso
/
RISCOS
/
MAGAZINE
/
NEWS
/
PCE021.ZIP
/
Pce021
/
Src
/
s
/
irq
< prev
next >
Wrap
Text File
|
1998-07-24
|
809b
|
43 lines
; irq.s
; -----
; PC Engine IRQ emulation
; by Paul Clifford
;
; Started 16 August 1997
GET hdr.defines
; ------------------------------------------------------------------------
AREA |irq$$code|, CODE, READONLY
; void IRQ_Write(uhalf address, ubyte value)
; IRQ write port
IRQ_Write
EXPORT IRQ_Write
cmp r0, #2
andeq r1, r1, #2_111
orreq r_p, r_p, #2_111 << 25
eoreq r_p, r_p, r1, lsl #24 + 1 ; set IRQ mask (inverted)
cmp r0, #3
biceq r_p, r_p, #TIQ << 16 ; reset TIQD
movs pc, r14
; ubyte IRQ_Read(uhalf address)
; IRQ read port
IRQ_Read
EXPORT IRQ_Read
mov r1, #0
cmp r0, #2
moveq r1, r_p, lsr #24 + 1 ; read IRQ mask
eoreq r1, r1, #2_111 ; correct for earlier inversion (see above)
cmp r0, #3
moveq r1, r_p, lsr #16 ; read IRQ status
and r0, r1, #2_111
movs pc, r14
END