6500_as.1 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .\" $Header$
  2. .TH 6500_AS 1ACK
  3. .SH NAME
  4. 6500_as \- assembler for Mostek 6500
  5. .SH SYNOPSIS
  6. ~em/lib/6500/as [options] argument ...
  7. .SH DESCRIPTION
  8. This assembler is made with the general framework
  9. described in \fIuni_ass\fP(6). It is an assembler-loader.
  10. .SH "SECTIONS and TYPES"
  11. An additional section, the \fIzeropage\fP, can be started by the
  12. \&\fI.sect .zero\fP pseudo-instruction.
  13. Some adressing-modes require an address between 0 and 255.
  14. Such an address must be defined with the means of the \fI.sect .zero\fP
  15. pseudo-instruction.
  16. A plain number between 0 and 255 is not allowed.
  17. The assembler will complain that it must be a zero page expression.
  18. .IP example
  19. \&.sect .zero
  20. .br
  21. answer: .space 1
  22. .br
  23. \&.text
  24. .br
  25. and (answer, x)
  26. .SH SYNTAX
  27. .IP expressions
  28. An two-byte expression followed by the pseudo-operator \fI.h\fP (\fI.l\fP)
  29. has the value of the higher (lower) byte of the expression.
  30. \&\fI.h\fP and \fI.l\fP bind stronger than all other operators.
  31. E.g. -1.h parses as -[1.h] which has value 0.
  32. You have to write [-1].h to get 0xFF.
  33. .IP "addressing modes"
  34. .nf
  35. .ta 16n 24n 32n 40n 48n
  36. syntax meaning (name)
  37. #expr 8-bit value (immediate)
  38. expr address (direct)
  39. expr, x expr + contents of x
  40. or or
  41. expr, y expr + contents of y
  42. yields address (indexed)
  43. (expr) address of address (only with JMP) (indirect)
  44. .fi
  45. In the next two addressing modes \fIexpr\fP has to be
  46. a zeropage expression.
  47. .nf
  48. (expr, x) expr + contents of x
  49. yields address (pre-indexed indirect)
  50. (expr), y contents of expr + contents of y
  51. yields address (post-indexed indirect)
  52. .fi
  53. .IP instructions
  54. There are two mnemonics that do not map onto one machine-instruction:
  55. \fIadd\fP and \fIsub\fP. \fIAdd mode\fP maps onto \fIclc; adc mode\fP.
  56. \fISub mode\fP maps onto \fIsec; sbc mode\fP.
  57. .SH "SEE ALSO"
  58. uni_ass(6),
  59. ack(1)