.\" $Header$ .TH 6500_AS 1 .ad .SH NAME 6500_as \- assembler for Mostek 6500 .SH SYNOPSIS /usr/em/lib/6500_as [options] argument ... .SH DESCRIPTION This assembler is made with the general framework described in \fIuni_ass\fP(6). .SH "SEGMENTS and TYPES" An additional segment, the \fIzeropage\fP, can be started by the \&\fI.zero\fP pseudo-instruction. Some adressing-modes require an address between 0 and 255. Such an address must be defined with the means of the \fI.zero\fP pseudo-instruction. A plain number between 0 and 255 is not allowed. The assembler will complain that it must be a zero page expression. .IP example \&.zero .br answer: .space 1 .br \&.text .br and (answer, x) .SH SYNTAX .IP expressions An two-byte expression followed by the pseudo-operator \fI.h\fP (\fI.l\fP) has the value of the higher (lower) byte of the expression. \&\fI.h\fP and \fI.l\fP bind stronger than all other operators. E.g. -1.h parses as -[1.h] which has value 0. You have to write [-1].h to get 0xFF. .IP "addressing modes" .nf .ta 8 16 24 32 40 48 syntax meaning (name) #expr 8-bit value (immediate) expr address (direct) expr, x expr + contents of x or or expr, y expr + contents of y yields address (indexed) (expr) address of address (only with JMP) (indirect) In the next two addressing modes `expr' has to be a zeropage expression. (expr, x) expr + contents of x yields address (pre-indexed indirect) (expr), y contents of expr + contents of y yields address (post-indexed indirect) .fi .IP instructions There are two mnemonics that do not map onto one machine-instruction: `add' and `sub'. `Add mode' maps onto `clc; adc mode'. `Sub mode' maps onto `sec; sbc mode'. .SH "SEE ALSO" uni_ass(6), ack(1)