XA(1) General Commands Manual XA(1) (NAME) xa - 6502/R65C02/65816 (SYNOPSIS) xa [OPTION]... FILE (DESCRIPTION) xa (multi- pass) 6502 ( 6502 65C02 6504 6507 6510 7501 8500 8501 8502) Rockwell R65C02 65816 . ASSEMBLER SYNTAX . (OPTIONS) -E . -v (verbose). -C (opcodes) CMOS ( R65C02 ). -W 65816 (). -w 65816 . -B / ( PSEUDO-OPS ). -c o65 ( ) . -o filename . a.o65 - . -P filename (listing). - . -F format plain . html . -e filename (errorlog) . -l filename (labellist) . dxa(1) . -r (cross-reference) ( -l ). -Xcompatset ( !) 6502 . MASM CA65 C XA23 xa . : -XMASM -XXA23. -XMASM MASM . . -XCA65 ca65(1) . := ( = ) <<>> @ ( ASSEMBLER SYNTAX ). -XC C 0xHEX 0OCTAL . -XXA23 xa 2.3.x . ^ (escaped characters) \ xa . 2.x 3.x . -a ca65(1) ca65(1). 65816 . -XMASM . -M -XMASM . MASM . . -k (^) $1f/31 . ^m^j (carriage return) (linefeed) . -R (relocating mode) (segments). -U . -Llabel label (linking) ( ) . -b? addr (segment base) ? addr . ? text data bss zero t d b z . -A addr text addr . -bt -b . -G (globals) . -DDEF=TEXT ( PREPROCESSOR ). -I dir dir (include path) ( XAINPUT ENVIRONMENT ). -O charset (charset) . ASCII () PETSCII ( ) PETSCREEN ( ) HIGH ( ). -p? ?. cpp(1) ( PREPROCESSOR ). (: -p'~' )..TP --help (-? ). --version . (ASSEMBLER SYNTAX) 6502 (mnemonics) . <> Richard Mansfield ( !COMPUTE) Atari Commodore Apple . xa (opcodes) NMOS 6502 Rockwell CMOS 65C02 (R65C02) . -w xa 65816 . (undocumented) NMOS 6502 .byte ( PSEUDO-OPS ). R65C02 65816 NMOS 6502 . xa 6502 MASM TurboAssembler . (literals) (expressions) : 123 (decimal) $234 (hexadecimal) (0x234 -XC ) &123 (octal) (0123 -XC ) %010110 (binary) * (program counter) ASCII (: "A" "A" ) PSEUDO-OPS . (character set) ( ) . (Labels) (multi-pass). label1 lda #0 ( LDA) label1 . label2 = $d000 label2 $d000 VIC-II Commodore 64 . * * = $c000 49152 . -XCA65 = := . . (-) : -label2 = $d020 label2 Commodore 64 . (scope) ( PSEUDO-OPS ). -L . . (padding) . (relocatable) (position- independent) (linking) . xa (linker) PSEUDO-OPS LINKING . -XCA65 -a <<>> : ( ) . ( ca65(1)): : lda (ptr1),y ; #1 cmp (ptr2),y bne :+ ; -> #2 tax beq :+++ ; -> #4 iny bne :- ; -> #1 inc ptr1+1 inc ptr2+1 bne :- ; -> #1 : bcs :+ ; #2 -> #3 ldx #$FF rts : ldx #$01 ; #3 : rts ; #4 -XCA65 <<>> (cheap) @ . . "loop" . (accumulator) ( asl lsr inc dec R65C02 ) a . a . (expressions) / . lab1+1 ( lab1 ) :.TP 8 * ( ) / ( ) + ( ) - () << () >> () >= => () > () <= =< () < () = () == <> >< () != & AND () ^ XOR () | OR () && AND () || OR () . (label) (=) += : -redeflabel += (label12/4) xa ( ) (opcode) (zero page) ( 65816) . . . (immediate) (zero page) . < (low byte) : lda # (high byte) ! (absolute) (zero page) ( ) @ 65816 ( -w -XCA65 ) ` ( NOTES'N'BUGS) (opcodes) ( PREPROCESSOR ). : lda label2+1 label2+1 ( $d021 ) $ad $21 $d0 . lda # label2 ( $20) (accumulator) ( $a9 $20 ). (;) ;this is a comment C /* */ // PREPROCESSOR ( ). (:) (statements) label4 lda #0:sta $d020 label2: lda #2 ( xa ). ; a comment:lda #0 . -XMASM . /* */ // ( )..SH " (PSEUDO-OPS)" Pseudo-ops . xa . .byt value1,value2,value3,... . . . .asc "text1" ,"text2",... . ASCII ASCII PETSCII Commodore ASCII . ASCII ATASCII Atari ASCII .byt . opcode .asc ( lda #"A" ) . . .byt .asc .byt $43, 22, "a character string" . . .aasc "text1" ,"text2",... ASCII . .asc .byt . .word value1,value2,value3... little-endian 6502 ( / ) . . . .dsb length,fillbyte length fillbyte . .dsb 5,$10 . . (null) . LINKING . .bin offset,length,"filename" filename offset ( ) length . . length filename . . LINKING . .( (scoping) . ( ). . + & ( ). . .block .( .proc ( ca65 ). .) . .bend .endproc . .as .al .xs .xl 65816 ( -w) . X/Y .as .xs .al .xl . sep rep CPU . -w .al .xl . .assert expression,"message" expression ( ) message . ROM : .assert *<$fffa, "hit vectors" 6502 . . = == < <= > >= != <>. .include filename #include ( PREPROCESSOR ) . (listing) . .listbytes number .byt . unlimited . . .o65 . http://www.6502.org/users/andre/o65 . .text .data .bss .zero .text .data .bss .zero (zero page) . .bss .zero . ..TP .code ca65 .text . .zeropage ca65 .zero . .align value (segment) ( ) value ( [relocating] ). . .fopt type, value1, value2, value3, ... .byt/.asc . type . o65 . . . .import label1, label2, label3, ... (link) -L (import) (resolve) . .importzp label1, label2, label3, ... .import zeropage ( ) . (PREPROCESSOR) xa C cpp(1) . C /* */ xa // . (\) . . cpp(1) . ( ) #define WW AA AA . (directive) . xa // cpp(1) . xa cc . xa cpp(1) cc -E test.s > test.xa xa test.xa xa cpp(1) . cpp(1) xa . cpp(1) -p # () ( -p'~'). #include #include ~include ( cpp(1) xa ). . cpp(1) xa . -XXA23 : XA_MAJOR (major) xa. XA_MINOR (minor) xa. : #include "filename" filename . -I XAINPUT ( ) . . #echo comment comment (errorlog) -e . #print expression expression . #error message . #define DEFINE text DEFINE text DEFINE text ( cpp(1) ). #define cpp(1) #define mult(a,b) ((a)*(b)) mult(a,b) . -D . #define . . #endif . . #ifdef DEFINE (True) DEFINE ..TP #ifndef DEFINE (true) DEFINE . #if expression expression . expression . #iflused label label ( ). ! #ifldef label label . ! #else . #endif . (included) . #iflused #ifldef . : #iflused label #ifldef label #echo label already defined, library function label cannot be inserted #else label /* your code */ #endif #endif (LINKING) xa . (program counter) (padding) . . . / . xa . o65 (relocatable) ldo65(1) ( ) . .bin .dsb . : .word $1000 * = $1000 ; this is your code at $1000 part1 rts ; this label marks the end of code endofpart1 ; DON'T PUT A NEW .word HERE! * = $2000 .dsb (*-endofpart1), 0 ; yes, set it again * = $2000 ; this is your code at $2000 part2 rts Commodore <<>> : $1000 (4096) part1 endofpart1 $2000 (8192) part2 . .dsb . . . rts 4096 8192 (null) . .bin . . ..SH " (ENVIRONMENT)" xa : XAINPUT include <<,>> . XAOUTPUT . (NOTES'N'BUGS) R65C02 ina ( inc a ) dea (dec a) inc dec . 65816 mvn mvp . xa . 2.4.0 . -- -- (zero page) . . ( .) ` . (indirect indexed) . (SEE ALSO) file65(1), ldo65(1), reloc65(1), uncpk(1), dxa(1) (AUTHORS) David Weinehall Andre Fachat Cameron Kaiser . xa (C)1989-1997 Andre Fachat . (C)1989-2024 Andre Fachat Jolse Maginnis David Weinehall Cameron Kaiser . Cameron Kaiser . XA (OVER 30 YEARS OF XA) (WEBSITE) http://www.floodgap.com/retrotech/xa 5 March 2024 XA(1)