home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / amiga / programm / 15740 < prev    next >
Encoding:
Text File  |  1992-11-12  |  2.0 KB  |  64 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!agate!stanford.edu!rock!concert!sas!mozart.unx.sas.com!jamie
  3. From: jamie@cdevil.unx.sas.com (James Cooper)
  4. Subject: Re: cmpi.l #,d16(pc) with SAS6asm, A68K, etc
  5. Originator: jamie@cdevil.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BxM2Fp.42u@unx.sas.com>
  8. Date: Thu, 12 Nov 1992 16:14:12 GMT
  9. References: <1dlshuINN6f6@werple.apana.org.au> <69309@cup.portal.com> <BxKq3t.E9q@unx.sas.com>
  10. Nntp-Posting-Host: cdevil.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 50
  13.  
  14.  
  15. In article <BxKq3t.E9q@unx.sas.com>, jamie@cdevil.unx.sas.com (James Cooper) writes:
  16. >
  17. >In article <69309@cup.portal.com>, Aurelius@cup.portal.com (Mark Christian Barnes) writes:
  18. > [various arguments about whether (d16,pc) mode is legal for cmpi on
  19. >  68000 deleted]
  20. >
  21. >Now the acid test is to execute this statement on a 68000, and see if it
  22. >works or not... well, it doesn't crash my machine, but I'd have to spend
  23. >a few minutes writing to actually see if it works or not...  :-)
  24.  
  25. O.K.  I did some tests here, with an assembler which will work with this
  26. addressing mode for this instruction.
  27.  
  28. Sample program:
  29.  
  30.         section code
  31.         moveq   #0,d0
  32.         cmpi.l  #1,12(pc)
  33.         beq.b   1$
  34.         moveq   #5,d0
  35. 1$:
  36.         rts
  37.         
  38.         dc.l    1,1,1,1
  39.  
  40.         end
  41.  
  42. Results:
  43.  
  44. Above program work fine on both 68000 and 68030 (my only test processors
  45. available) for sizes of .W and .L.
  46.  
  47. However, the .B size only works on my 68030.  The instruction:
  48.  
  49.         cmpi.b  #1,12(pc)
  50.  
  51. causes a illegal instruction exception on a 68000.
  52.  
  53. So, can we forget about this now?  The answer to the original question
  54. is that yes, this should be allowed, but the .B size should be illegal
  55. unless you are assembling for an '020 or greater.
  56.  
  57. -- 
  58. ---------------
  59. Jim Cooper
  60. (jamie@unx.sas.com)                             bix: jcooper
  61.  
  62. Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
  63. and not necessarily those of my employer.
  64.