home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / alt / sys / amiga / demos / 1071 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.8 KB

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