home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!rutgers!cbmvax!mks
- From: mks@cbmvax.commodore.com (Michael Sinz)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Testing a custom trap handler
- Message-ID: <34813@cbmvax.commodore.com>
- Date: 2 Sep 92 12:02:53 GMT
- References: <s442013.715318366@yorku.ca>
- Reply-To: mks@cbmvax.commodore.com (Michael Sinz)
- Organization: Commodore, West Chester, PA
- Lines: 40
-
- s442013@nexus.yorku.ca (Ray Frederick) writes:
- >I have a custom trap handler that I would like to test in Supervisor Mode
- >on my A3000. I am using Powervisor to step through the code but as soon as
- >I move the address of the handler to tc_TrapData, the computer executes
- >the code and stops at the RTE. In order to step through the trap handler
- >I would like to put my User program in Supervisor mode so I have access to
- >the usp and other privileged instructions. I'm also hoping this will allow
- >me to step through the code.
- >
- >Basically, I would like to set bit 13 of the SR from a user program so
- >it will have Supervisor access to the instructions.
-
- Well, a use program really can't be in supervisor mode very easily
- since just changing the SR would end up with the wrong stack.
-
- There are EXEC calls to do such things. There is the Supervisor()
- call which will run some code in supervisor state. When that code
- returns you should be back where you where. (It is a function
- call that takes a function pointer...)
-
- There is also SuperState() and UserState() that bounce you in/out of
- supervisor state.
-
- See the EXEC autodocs for more information on these calls.
-
- ***NOTE*** Being is supervisor state means that there are a number of
- things that you can not do. You can *not* call anything other than
- the EXEC calls that are available in interrupt state. Also, when in
- supervisor mode, you can *not* cause the system to Wait() in any
- way since being in supervisor state is a special form of Forbid()
- that can not be broken safely. (IE : It may seem to work for a few
- tries but then will suddenly not and for good reason too...)
-
- /----------------------------------------------------------------------\
- | /// Michael Sinz - Senior Amiga Systems Engineer |
- | /// Operating System Development Group |
- | /// BIX: msinz UUNET: mks@cbmvax.commodore.com |
- |\\\/// |
- | \XX/ Quantum Physics: The Dreams that Stuff is made of. |
- \----------------------------------------------------------------------/
-