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

  1. Path: sparky!uunet!nntp1.radiomail.net!portal!cup.portal.com!Aurelius
  2. From: Aurelius@cup.portal.com (Mark Christian Barnes)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Assembler programming.
  5. Message-ID: <64503@cup.portal.com>
  6. Date: Sun, 23 Aug 92 12:37:14 PDT
  7. Organization: The Portal System (TM)
  8. Distribution: world
  9. References: <14448@mindlink.bc.ca> <64374@cup.portal.com>
  10.   <1992Aug21.220718.24365@jato.jpl.nasa.gov>
  11. Lines: 39
  12.  
  13. <stuff deleted>
  14.  
  15. |>Paragraph 2.11.2.5: Address Register Indirect with Index
  16. |>
  17. |> ... The address of the operand is the sum of the address in the
  18. |>address register, the sign-extended displacement integer in the
  19. |>low order eight bits of the extension word, and the contents of
  20. |>the index register...
  21. |>
  22. |> SYNTAX:  d8(An, Xn.W), or (d8, An, Xn.W)
  23. |>          d8(An, Xn.L), or (d8, An, Xn.L)
  24. |>
  25. |>                       Regards, Aurelius@cup.portal.com
  26. |  
  27. |I stand corrected. Quite unnerving to think that in situations where address
  28. |register indirect with index type addressing is used (i.e. null terminating
  29. |a string: move.b #0,(a0,d0.w) ) requires an additional memory read _just_
  30. |to find out that the displacement value wasn't given (zero). The assembler I
  31. |use obviously assumes a zero displacement value in the event I don't specify
  32. |one, because it doesn't complain.
  33. |jeff
  34.  
  35.  Not exactly Jeff, Indirect with Index addressing takes *one* extension
  36. word. This is in addition to the opcode word. The high byte of the
  37. extension word specifies the index register and its size. The low byte
  38. is the displacement integer, which will be signed extended.
  39.  
  40.  Although, :-), on the 68020+ processors, the displacement can be 8,
  41. 16, or 32 bits. The 8 bit form is what I have described. The 16 and
  42. 32 bit forms *do* have to read *two* extension words, as you feared.
  43.  
  44.             Regards, Aurelius@cup.portal.com
  45.  
  46. PS: Always use legal syntax. Assemblers may allow you to save
  47.     a little typing (and thinking) by permitting degenerate
  48.     forms (like your example) or aliases (like MOVE x,An
  49.     instead of MOVEA x,An), but it can just lead to confusion
  50.     in the long run.
  51.