home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4513 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.3 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!mips!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!levels!8918927y
  2. From: 8918927y@levels.unisa.edu.au
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Help with prog. Execption handlers on ST
  5. Message-ID: <18373.2a951810@levels.unisa.edu.au>
  6. Date: 21 Aug 92 06:51:36 GMT
  7. Organization: University of South Australia
  8. Lines: 45
  9.  
  10. Gday,
  11.     I'm working on a project that involves making an expansion card
  12. for a MEGA st, and I'm trying to write a small assembler program to
  13. detect whether the card is installed in one of two possible addresses. I
  14. know that the card works correctly, so the hardware is not a problem. I
  15. would like to write a program that attempts to write to the io address
  16. of the card, and if it finds the hardware the read cycle will terminate
  17. correctly, otherwise a bus error will occur & a handler will notify the
  18. program that the hardware is not present.
  19.  
  20.     My problem is that I get  an address error when I execute a RTE
  21. from the exeception processing routine, ala here is portions of my code
  22.  
  23. BusErrFlag    dc.b    1    * flag variable for exception routine
  24.  
  25. MAIN    pea.l    BusErrHandler    * Bus error handler routine
  26.     move.w    #2,-(sp)    * bus error exception number
  27.     move.w    #setexc,-(sp)   * set exception routine
  28.     trap    #1
  29.  
  30.     {... miscellaneous code here...}
  31.  
  32.     move.b  #$00,$CF0001    * try to write to my hardware
  33.        ( this should cause a bus error exception if no hardware )
  34.  
  35.     { .... rest of program }
  36.  
  37. * this is the exception processing routine
  38. BusErrHandler   move.b    #$FF,BusErrFlag    * set flag for Bus error
  39.         rte
  40.     *** this is where i get "address errors" when I try to execute a
  41.         RTE from the exeception handler.
  42.  
  43. My question is, do I need to do anything special in the execption
  44. handler before i execute an RTE ??
  45.  
  46. Thanks 
  47. Kym
  48. ------------------------------------------------------------------------------
  49.    "`Get back' I screamed, `I'm an Australian!'.I new this was a pretty
  50.    lame excuse and prepared myself for the truth. `Australia is merely an
  51.    Island of Antarctica' came the voice,`and of no further significance.'
  52.                Suddenly I understood the secret of Atlantis."
  53. --`What's Rangoon to you is Grafton to me' by Russell Guy. JJJ-FM circa 1978--
  54.  Kym B Newbery : 8918927y@lux.levels.UniSA.edu.au : 4th Year electronic eng.
  55.