home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Emulators / BBC-6502Em / 6502de / Docs / Opcode07 < prev    next >
Encoding:
Text File  |  1996-04-01  |  2.0 KB  |  57 lines

  1. 6502Em: Opcode07
  2. ================
  3.  
  4. An interface has been added to allow 6502 paged ROM images to be developed
  5. which make access to RISC OS SWIs. The SWI is called by executing a
  6. previously undefined 6502 opcode.
  7.  
  8. NB This will not work in the main memory, only in a paged ROM
  9.  
  10. NB2 This is the same protocol that !65Host uses to issue SWIs
  11.  
  12.  6502 Opcode &07 - Issue SWI call
  13.  --------------------------------
  14.  
  15. in:     XY (X lo-byte, Y hi-byte) points to control block (cb)
  16.  
  17. cb?0..2 = SWI number (lo..hi) (bit 17 set => return errors with V set)
  18.  
  19. cb?3    = number of registers to put back into block on exit, starting at R0
  20.  
  21. cb?4    = bit set of registers to relocate on entry to SWI
  22.           (bit n set => relocate Rn from 6502 to ARM address space)
  23.  
  24. cb?5    = bit set of registers to unrelocate on exit from SWI
  25.           (bit n set => unrelocate Rn from ARM to 6502 address space)
  26.  
  27. cb?6,7  = address (lo,hi) of error buffer (in 6502 space)
  28.           only relevant if bit 17 of SWI number set
  29.  
  30. cb?8    = length of error buffer (can be zero)
  31.  
  32. cb!9    = register R0
  33.  
  34. cb!13   = register R1
  35.  
  36. ..
  37.  
  38. cb!37   = register R7
  39.  
  40. out:    A,X,Y preserved
  41.         N,Z,C,V as returned by the ARM on exit from the SWI
  42.         Some or all of the register block is updated with the
  43.         values on exit (possibly relocated), as controlled by cb?3,4,5
  44.  
  45.         If bit 17 of the SWI number was clear, and an error occurs, then
  46.         control will not returned to the 6502 code - instead the error
  47.         block is copied to &100 in 6502 format (ie zero byte, 1 byte error
  48.         number, followed by zero terminated error string) and then it jumps
  49.         to &100, which causes a BRK. If no error occurred, control will be
  50.         returned and V will be clear.
  51.  
  52.         If bit 17 of the SWI number was set, then the X form of the SWI
  53.         is issued; if this returns with V set, then the error block is
  54.         copied into the specified error buffer in 6502 format, truncated
  55.         to the length of the error buffer (if truncated the terminating
  56.         zero will be in the last byte of the error buffer).
  57.