m68k2_as.1 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. .\" $Header$
  2. .TH M68K2_AS 1
  3. .ad
  4. .SH NAME
  5. m68k2_as \- assembler for Motorola 68000
  6. .SH SYNOPSIS
  7. /usr/em/lib/m68k2_as [options] argument ...
  8. .br
  9. /usr/em/lib/m68k4_as [options] argument ...
  10. .SH DESCRIPTION
  11. This assembler is made with the general framework
  12. described in \fIuni_ass\fP(6).
  13. .SH SYNTAX
  14. .IP registers
  15. The 68000 has the following registers:
  16. seven data-registers (d1 - d7), seven address-registers (a1 - a6, sp)
  17. of which sp is the system stack pointer, a program counter (pc),
  18. a status register (sr), and a condition codes register (ccr) which is actually
  19. just the low order byte of the status register.
  20. .IP "addressing modes"
  21. .nf
  22. .ta 8n 16n 24n 32n 40n 48n
  23. syntax meaning (name)
  24. reg contents of \fIreg\fP is operand, where \fIreg\fP is
  25. one of the registers mentioned above (register direct)
  26. (areg) contents of \fIareg\fP is address of operand, where
  27. \fIareg\fP is an address-register
  28. (address register indirect)
  29. (areg)+ same as (areg), but after the address is used,
  30. \fIareg\fP is incremented by the operand length
  31. (postincrement)
  32. -(areg) same as (areg), but before the address is used,
  33. \fIareg\fP is decremented by the operand length
  34. (predecrement)
  35. expr(areg)
  36. expr(pc) \fIexpr\fP + the contents of the register yields the
  37. address of the operand (displacement)
  38. expr(areg, ireg)
  39. expr(pc, ireg) \fIexpr\fP + the contents of the register + the contents
  40. of \fIireg\fP yields the address of the operand. \fIireg\fP is
  41. an address- or a data-register.
  42. \fIireg\fP may be followed by .w or .l indicating whether
  43. the size of the index is a word or a long
  44. (displacement with index)
  45. expr \fIexpr\fP is the address of the operand
  46. (absolute address)
  47. #expr \fIexpr\fP is the operand (immediate)
  48. .fi
  49. Some instructions have as operand a register list. This list consists of
  50. one or more ranges of registers separated by '/'s. A register range consists
  51. of either one register (e.g. d3) or two registers separated by a '-'
  52. (e.g. a2-a4, or d4-d5). The two registers must be in the same set (address-
  53. or data-registers) and the first must have a lower number than the second.
  54. .IP instructions
  55. Some instructions can have a byte, word, or longword operand.
  56. This may be indicated by prepending the mnemonic with .b, .w, or .l
  57. respectively. Default is .w.
  58. .SH "SEE ALSO"
  59. uni_ass(6),
  60. ack(1),
  61. .br
  62. MC68000 16-bit microprocessor User's manual, Motorola Inc, 1979
  63. .SH EXAMPLE
  64. .sp 2
  65. .nf
  66. .ta 8n 16n 24n 32n 40n 48n 56n 64n
  67. .define .cii
  68. .text
  69. .cii:
  70. movem.l a0/d0/d1,.savreg
  71. move.l (sp)+,a0 ! return address
  72. move (sp)+,d0 ! destination size
  73. sub (sp)+,d0 ! destination - source size
  74. bgt 1f
  75. sub d0,sp ! pop extra bytes
  76. bra 3f
  77. 1:
  78. move (sp),d1
  79. ext.l d1
  80. swap d1
  81. asr #1,d0
  82. 2:
  83. move.w d1,-(sp)
  84. sub #1,d0
  85. bgt 2b
  86. 3:
  87. move.l a0,-(sp)
  88. movem.l .savreg,a0/d0/d1
  89. rts
  90. .fi