1. Purpose 2. Supported syntax 2.1. Mnemonics 2.2. Addressing modes 2.3. Operand size control 2.4. Expression evaluation |
2.5. Comments 2.6. Command separation 2.7. Preprocessor 2.8. Object file format 3. Examples and more documentation 4. Copying 5. Downloading |
The produced object file is binary-compatible with those made with XA65.
ADC
, AND
, ASL
, BCC
,
BCS
, BEQ
, BIT
, BMI
,
BNE
, BPL
, BRA
, BRK
,
BRL
, BVC
, BVS
, CLC
,
CLD
, CLI
, CLV
, CMP
,
COP
, CPX
, CPY
, DB
,
DEC
, DEX
, DEY
, EOR
,
INC
, INX
, INY
, JML
,
JMP
, JSL
, JSR
, LDA
,
LDX
, LDY
, LSR
, MVN
,
MVP
, NOP
, ORA
, PEA
,
PEI
, PER
, PHA
, PHB
,
PHD
, PHK
, PHP
, PHX
,
PHY
, PLA
, PLB
, PLD
,
PLP
, PLX
, PLY
, REP
,
ROL
, ROR
, RTI
, RTL
,
RTS
, SBC
, SEC
, SED
,
SEI
, SEP
, STA
, STP
,
STX
, STY
, STZ
, TAX
,
TAY
, TCD
, TCS
, TDC
,
TRB
, TSB
, TSC
, TSX
,
TXA
, TXS
, TXY
, TYA
,
TYX
, WAI
, XBA
, XCE
nop
; clc
lda #value
; rep #value
etc (size may depend on an operand size setting)bra end
brl end
; per end+2
lda $12
lda $12,x
; lda $12,y
lda ($12)
; pei ($12)
lda ($12,x)
lda ($12),y
lda [$12]
lda [$12],y
lda $1234
lda $1234,x
; lda $1234,y
lda $123456
lda $123456,x
lda $12,s
lda ($12,s),y
lda ($1234)
lda [$1234]
lda ($1234,x)
mvn $7E,$7F
.as
, .al
, .xs
&
.xl
are used to decide what size accumulator and index mode
for the assembler to use. .as
and .xs
are for
8bit operands, and .al
and .xl
are for 16 bit operands.
I've found it handy to define these macroes:
#define SET_8_BIT_A() sep #$20 : .as #define SET_16_BIT_A() rep #$20 : .al #define SET_8_BIT_X() sep #$10 : .xs #define SET_16_BIT_X() rep #$10 : .xl #define SET_8_BIT_AX() sep #$30 : .xs : .as #define SET_16_BIT_AX() rep #$30 : .xl : .alIn addition to these modes, there are several operand prefixes that can be used to force a certain operand size/type.
lda !$f0
would use 16-bit address instead of direct page.lda @$1234
would use a long (24-bit) address instead of absolute 16-bit address.lda #<var
can be used to load the lower 8-bits of an external variable.lda #>var
can be used to load the upper 8-bits of an external variable.lda #^var
can be used to load the segment part (8-bits) of an external variable.lda @var,x
can be used to use absolute-indexed-long mode instead of the default, absolute.bra somewhere+1
lda #!address + $100
ldy #$1234 + ($6C * 3)
#ifdef
, #ifndef
, #define
,
#if
, #endif
and #include
like
in any C program.
If you happen to see this program useful for you, I'd appreciate if you tell me :) Perhaps it would motivate me to enhance the program.
Generated from
progdesc.php
(last updated: Sun, 28 Sep 2003 03:42:21 +0300)
with docmaker.php
(last updated: Thu, 13 Feb 2003 15:11:29 +0200)
at Sun, 28 Sep 2003 03:42:23 +0300