z80_as.6 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .\" $Id$
  2. .TH Z80_AS 6 "$Revision$"
  3. .ad
  4. .SH NAME
  5. z80_as \- assembler for Zilog z80
  6. .SH SYNOPSIS
  7. ~em/lib.bin/z80/as [options] argument ...
  8. .SH DESCRIPTION
  9. This assembler is made with the general framework
  10. described in \fIuni_ass\fP(6). It is an assembler generating relocatable
  11. object code in \fIack.out\fP(5) format.
  12. .SH SYNTAX
  13. .IP registers
  14. The z80 has six general-purpose 8-bit registers: b, c, d, e, h, l;
  15. an 8-bit accumulator: a; an 8-bit flag register: f; an 8-bit interrupt
  16. vector: i; an 8-bit memory refresh register: r; two 16-bit index registers:
  17. ix, iy; a 16-bit stack pointer: sp; and a 16-bit program counter: pc.
  18. The general-purpose registers can be paired to form three registers pairs of
  19. 16 bits each: bc, de, hl.
  20. An alternate set of registers is provided that duplicates the accumulator,
  21. the flag register, and the general-purpose registers. The "exx"-instruction
  22. exchanges the contents of the two sets of general-purpose registers; the
  23. contents of the accumulator and flag register can be exchanged with the contents
  24. of their alternates by the "ex af, af2"-instruction.
  25. .IP "addressing modes"
  26. .nf
  27. .ta 8n 16n 24n 32n 40n 48n
  28. syntax meaning
  29. expr dependent on the instruction, the
  30. value of \fIexpr\fP can be immediate
  31. data or the address of the operand.
  32. There is no special notation for
  33. immediate data.
  34. (ireg + expr)
  35. (ireg - expr) the contents of ireg (which must be
  36. one of the index-registers) + or -
  37. the - one byte - value of \fIexpr\fP
  38. yield the address of the operand.
  39. (expr) the value of \fIexpr\fP is the address of
  40. the operand.
  41. reg the contents of \fIreg\fP - one of the above-
  42. mentioned registers - is the operand.
  43. (reg) the contents of \fIreg\fP - one of the 16-bit
  44. registers except pc - is the address of
  45. the operand.
  46. nz, z, nc, c,
  47. po, pe, p, m the letters indicate a condition-code:
  48. nonzero, zero, carry, no carry,
  49. parity odd, parity even, sign positive,
  50. sign negative respectively. Used by conditional
  51. jump, call, and return instructions.
  52. .fi
  53. .IP instructions
  54. The jr-instruction will automatically be replaced by a jp-instruction if the
  55. target is too remote.
  56. .SH "SEE ALSO"
  57. uni_ass(6),
  58. ack(1),
  59. ack.out(5),
  60. .br
  61. Z80 Users Manual, Joseph J. Carr, Reston Publishing Company, 1980