home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12861 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  3.3 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!nsd20463
  2. From: nsd20463@uxa.cso.uiuc.edu (Nicolas S. Dade)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: problem with movea.l
  5. Message-ID: <BtrqJF.D7B@news.cso.uiuc.edu>
  6. Date: 29 Aug 92 23:28:26 GMT
  7. Article-I.D.: news.BtrqJF.D7B
  8. References: <1992Aug28.024446.2322@panix.com>
  9. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  10. Organization: University of Illinois at Urbana
  11. Lines: 73
  12.  
  13. jwp@panix writes:
  14.  
  15. >> [more move v. movea confusion]
  16.  
  17. >Actually, a move <something>,An _is_ a movea <something>,An.
  18.  
  19. >Here's the coding for a move.l <something>,<somethingelse>
  20.  
  21. >%0010 xxx xxx xxx xxx
  22. > ^    ^   ^   ^   ^
  23. > |    |   |   |   |
  24. > |    |   |   |   source register
  25. > |    |   |   source mode
  26. > |    |   destination mode
  27. > |    destination register
  28. > opcode
  29.  
  30. >Here are the modes and register values--
  31. >Addressing mode                      mode    register    syntax
  32. >Data reg. direct                      000    (number)      Dn
  33. >Address reg. direct                   001    (number)      An
  34. >Address reg. indirect                 010    (number)     (An)
  35. >Address reg. indirect w/ postincre.   011    (number)     (An)+
  36. >Address reg. indirect w/ predecrem.   100    (number)    -(An)
  37. >Address reg. indirect w/ displacem.   101    (number)    d(An)
  38. >Address reg. indirect w/ index        110    (number)    d(An,Xi)
  39. >Absolute short address                111      000        xxx.W
  40. >Absolute long address                 111      001        xxx.L
  41. >Program conter w/ displacement        111      010       d(PC)
  42. >Program conter w/ index               111      011       d(PC,Xi)
  43. >Immediate data                        111      100       #xxx
  44. >Status register                       111      100      SR or CCR
  45.  
  46. >* Immediate data may only be used for a source operand, and the status 
  47. >register may only be used for a destination operand.
  48.  
  49. you need another "*" here: not all the address modes may be used for
  50. the source, and not all the address modes may be used for the destination,
  51. and the prescription is more complicated than what you've indicated:
  52.  
  53. On a 68000 the source can be anything except the CCR. (However using
  54. the SR as the source should not be done unless you've checked the 
  55. AttnFlags and know that you are on a plain 68000 system, or if you
  56. know you are in supervisor mode. Use GetSR() instead)
  57.  
  58. However the destination may _not_ _be_ _address_ _register_ _direct_, 
  59. any PC relative mode, or, obviously, immeadiate. 
  60.  
  61. Also the move instructions involving the SR and CCR are not part of the
  62. general move instruction, as they change the CCR in a quite different way
  63. than the general move does, or they don't change it at all, and they do
  64. not have a general addressing mode & register bit pattern. (If you place
  65. the bit pattern you list above into your instruction you don't get a
  66. move.w SR,xx or move.w xx,CCR or move.w xx,SR instruction.)
  67.  
  68.  
  69. >Using those, here is a move.l (a5)+,a0
  70.  
  71. >%0010 000 001 011 101
  72.  
  73. All this talk is fine, but what happens when you feed this to a 68000?
  74. I'll tell you: it punts, and heads straight for the Illegal Op Code
  75. exception vector. There ain't no such instruction.
  76.  
  77.  
  78. > [perfectly correct movea explanation & example]
  79.  
  80. >The only difference is that a movea must move to a address register. (and 
  81. >movea.b is illegal)
  82.  
  83. and movea does not change the condition codes.
  84.  
  85. -Nicolas Dade
  86.