6500_as.6 1.9 KB

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