home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / apple2 / 27593 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.2 KB  |  56 lines

  1. Newsgroups: comp.sys.apple2
  2. Path: sparky!uunet!comp.vuw.ac.nz!actrix!David.Empson
  3. From: David.Empson@bbs.actrix.gen.nz
  4. Subject: Re: 65802 problem
  5. Organization: Actrix Information Exchange
  6. Date: Tue, 26 Jan 1993 22:07:43 GMT
  7. Message-ID: <1993Jan26.220743.8313@actrix.gen.nz>
  8. Keywords: 65802
  9. References: <22JAN199310075283@rigel.tamu.edu> <1993Jan26.090243.29670@actrix.gen.nz>
  10. Sender: David.Empson@actrix.gen.nz (David Empson)
  11. Lines: 43
  12.  
  13. Further to my previous posting on this topic: one possible
  14. compatibility problem with a 65802 is interrupts.
  15.  
  16. The 6502 and 65C02 have three interrupt vectors: NMI ($FFFA), RESET
  17. ($FFFC) and BRK/IRQ ($FFFE).
  18.  
  19. The 65802 supports the same interrupt vectors when running in
  20. 'emulation' mode, but has one extra vector for the COP instruction,
  21. which is at $FFF4.  If an $02 byte is fetched as an instruction, the
  22. computer will fetch an interrupt vector from $FFF4, resulting in a
  23. jump to a strange location, and probably a crash.
  24.  
  25. Even worse, if the 65802 is running in 'native' mode, there are
  26. completely separate vectors: COP ($FFE4), BRK ($FFE6), NMI ($FFEA) and
  27. IRQ ($FFEE).  These vectors will also point to invalid code (they are
  28. part of the monitor's command lookup table).
  29.  
  30. This means that if you're writing code that runs in 65802 native mode
  31. on a IIe (or IIc), you must have interrupts disabled, and make sure
  32. you don't execute any BRK or COP instructions.  Interrupts should not
  33. be enabled again until you return to emulation mode.
  34.  
  35. The only exception to this is if you're using the language card
  36. yourself (maybe under DOS 3.3, but not ProDOS) - you can then set up
  37. the vectors yourself.
  38.  
  39.  
  40. The IIgs has legal values in all vectors, so it supports emulation mode
  41. and native mode interrupts.  The IIgs always fetches interrupt vectors
  42. from the ROM, so there is no problem with native mode interrupts under
  43. ProDOS or Pascal.
  44.  
  45.  
  46.  
  47. Another possibile cause of the problem is if the RANA drive's
  48. interface card is executing an illegal 6502 opcode.  Most of these
  49. result in a 'no operation' on the 65C02, have peculiar effects on the
  50. 6502, but are valid instructions on the 65802.
  51. -- 
  52. David Empson
  53.  
  54. Internet: David.Empson@bbs.actrix.gen.nz    EMPSON_D@kosmos.wcc.govt.nz
  55. Snail mail: P.O. Box 27-103, Wellington, New Zealand
  56.