home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!darwin.sura.net!Sirius.dfn.de!chx400!forty2!amiga!cschneid
- From: cschneid@amiga.physik.unizh.ch (Christian Schneider)
- Newsgroups: alt.sys.amiga.demos
- Subject: Re: Interrupt vectors.. still.
- Message-ID: <2331@forty2.physik.unizh.ch>
- Date: 18 Aug 92 10:58:37 GMT
- References: <umage.713636144@mcl>
- Sender: news@forty2.physik.unizh.ch
- Organization: ICU - University of Zurich, Dept. of Comp. Sci.
- Lines: 35
-
- In article <umage.713636144@mcl> umage@mcl.ucsb.edu (Vorpal Greed) writes:
- >OK.
- >I've been messing with this stuff for a long time, and still have questions.
- >How come, if i replace an interrupt vector (take an easy one like the keybd)
- >with a routine that first executes itself, then calls the system's routine,
- >which is then tricked via stack into returning to another part of my routine,
- >stuff goes wrong?
-
- Hmm.. this sounds rather 'hacky' and I see no use of it anyway...
- But I don't know what's really causing the problem.
-
- >Also i found a cool trick for when you write a routine that returns success
- >or failure.. I used to stick the return code in d0 or someplace, but it's
- >just a easy to stick em in the ccr ! That way, you can do:
-
- Nope! Don't do this! You'd have to to a move d0,sr on mc68000 and a
- move d0,ccr on mc68010+ ! (move d0,sr is priviledged on 68010+)
-
- > bsr myroutine
- > beq ok
- > bpl err1
- > bmi err2
-
- This can be done more easily by doing a tst.l d0 at the end of myroutine..
- No need to mess with the sr or ccr..
-
- BTW: As system routines don't set the flags and you need a tst.l d0 afterwards
- anyway, personally, I design my routines the same way to keep my programs
- consistent.
-
- - Chris
- --
- Chris Schneider - cschneid@amiga.physik.unizh.ch BIX: hschneider IRC: cschneid
- The goal of science is to build better mousetraps. The goal of nature is to
- build better mice. - Human beings were created by water to transport it uphill.
-