home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / alt / sys / amiga / demos / 1075 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.4 KB  |  31 lines

  1. Newsgroups: alt.sys.amiga.demos
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-cv!hp-pcd!hpmcaa!hpmcaa!bryanf
  3. From: bryanf@hpmcaa (Bryan Ford)
  4. Subject: Re: Interrupt vectors.. still.
  5. Message-ID: <1992Aug18.155949.6677@hpmcaa.mcm.hp.com>
  6. Sender: news@hpmcaa.mcm.hp.com (News Administrator)
  7. Nntp-Posting-Host: hpmcaa.mcm.hp.com
  8. Organization: HP Cardiology Business Unit - McMinnville, OR
  9. X-Newsreader: Tin 1.1 PL4
  10. References: <2331@forty2.physik.unizh.ch>
  11. Date: Tue, 18 Aug 1992 15:59:49 GMT
  12. Lines: 17
  13.  
  14. cschneid@amiga.physik.unizh.ch (Christian Schneider) writes:
  15. > In article <umage.713636144@mcl> umage@mcl.ucsb.edu (Vorpal Greed) writes:
  16. > >Also i found a cool trick for when you write a routine that returns success
  17. > >or failure..  I used to stick the return code in d0 or someplace, but it's
  18. > >just a easy to stick em in the ccr !  That way, you can do:
  19. > Nope! Don't do this! You'd have to to a move d0,sr on mc68000 and a
  20. > move d0,ccr on mc68010+ ! (move d0,sr is priviledged on 68010+)
  21.  
  22. Although it definitely wouldn't be a good idea to use the move->ccr or
  23. move->sr to return result codes, there are many other ways to set the condition
  24. codes.  When a routine returns some value in d0, say, it's often easy to
  25. arrange that the CCR reflect that value (say, the Z flag set or clear 
  26. according to the zero/nonzero status of D0); this saves the tst.l instruction.
  27. But then of course you have to remember which routines support this. :-)
  28.  
  29.                 Bryan
  30.