home *** CD-ROM | disk | FTP | other *** search
/ Dream 55 / Amiga_Dream_55.iso / RISCOS / MAGAZINE / NEWS / PCE021.ZIP / Pce021 / Src / s / irq < prev    next >
Text File  |  1998-07-24  |  809b  |  43 lines

  1. ;    irq.s
  2. ;    -----
  3. ;    PC Engine IRQ emulation
  4. ;    by Paul Clifford
  5. ;
  6. ;    Started 16 August 1997
  7.  
  8.  
  9.     GET    hdr.defines
  10.  
  11.  
  12. ;    ------------------------------------------------------------------------
  13.  
  14.     AREA    |irq$$code|, CODE, READONLY
  15.  
  16.  
  17. ;    void IRQ_Write(uhalf address, ubyte value)
  18. ;    IRQ write port
  19. IRQ_Write
  20.     EXPORT    IRQ_Write
  21.     cmp    r0, #2
  22.     andeq    r1, r1, #2_111
  23.     orreq    r_p, r_p, #2_111 << 25
  24.     eoreq    r_p, r_p, r1, lsl #24 + 1    ; set IRQ mask (inverted)
  25.     cmp    r0, #3
  26.     biceq    r_p, r_p, #TIQ << 16        ; reset TIQD
  27.     movs    pc, r14
  28. ;    ubyte IRQ_Read(uhalf address)
  29. ;    IRQ read port
  30. IRQ_Read
  31.     EXPORT    IRQ_Read
  32.     mov    r1, #0
  33.     cmp    r0, #2
  34.     moveq    r1, r_p, lsr #24 + 1        ; read IRQ mask
  35.     eoreq    r1, r1, #2_111            ; correct for earlier inversion (see above)
  36.     cmp    r0, #3
  37.     moveq    r1, r_p, lsr #16        ; read IRQ status
  38.     and    r0, r1, #2_111
  39.     movs    pc, r14
  40.  
  41.  
  42.     END
  43.