home *** CD-ROM | disk | FTP | other *** search
- 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
- From: 8918927y@levels.unisa.edu.au
- Newsgroups: comp.sys.atari.st.tech
- Subject: Help with prog. Execption handlers on ST
- Message-ID: <18373.2a951810@levels.unisa.edu.au>
- Date: 21 Aug 92 06:51:36 GMT
- Organization: University of South Australia
- Lines: 45
-
- Gday,
- I'm working on a project that involves making an expansion card
- for a MEGA st, and I'm trying to write a small assembler program to
- detect whether the card is installed in one of two possible addresses. I
- know that the card works correctly, so the hardware is not a problem. I
- would like to write a program that attempts to write to the io address
- of the card, and if it finds the hardware the read cycle will terminate
- correctly, otherwise a bus error will occur & a handler will notify the
- program that the hardware is not present.
-
- My problem is that I get an address error when I execute a RTE
- from the exeception processing routine, ala here is portions of my code
-
- BusErrFlag dc.b 1 * flag variable for exception routine
-
- MAIN pea.l BusErrHandler * Bus error handler routine
- move.w #2,-(sp) * bus error exception number
- move.w #setexc,-(sp) * set exception routine
- trap #1
-
- {... miscellaneous code here...}
-
- move.b #$00,$CF0001 * try to write to my hardware
- ( this should cause a bus error exception if no hardware )
-
- { .... rest of program }
-
- * this is the exception processing routine
- BusErrHandler move.b #$FF,BusErrFlag * set flag for Bus error
- rte
- *** this is where i get "address errors" when I try to execute a
- RTE from the exeception handler.
-
- My question is, do I need to do anything special in the execption
- handler before i execute an RTE ??
-
- Thanks
- Kym
- ------------------------------------------------------------------------------
- "`Get back' I screamed, `I'm an Australian!'.I new this was a pretty
- lame excuse and prepared myself for the truth. `Australia is merely an
- Island of Antarctica' came the voice,`and of no further significance.'
- Suddenly I understood the secret of Atlantis."
- --`What's Rangoon to you is Grafton to me' by Russell Guy. JJJ-FM circa 1978--
- Kym B Newbery : 8918927y@lux.levels.UniSA.edu.au : 4th Year electronic eng.
-