6502 Assembler - Chysn/VIC20-wAx2 GitHub Wiki

To assemble instructions, enter

.A addr mne [operand] [;comment]

where addr is a valid 16-bit hexadecimal address, mne is a 6502 mnemonic, and operand is a valid operand. A description of the 6502 instructions is beyond the scope of this document.

wAx will assemble the instruction at the specified address. If the instruction was entered in direct mode, wAx will provide a prompt for the next address after the instruction. You may enter another instruction, or press RETURN.

Note that the comma is an alias for A:

., addr mne [operand] [;comment]

Comments

wAx stops parsing text after a semicolon, so everything after a semicolon is a comment.

.A 1800 AND #$01 ; MASK BIT 0

Immediate Mode Operands

wAx supports several types of operands for immediate mode instructions (e.g., LDA #)

.A 1800 LDA #$0C        ; HEX BYTE
.A 1802 LDY #"J"        ; PETSCII CHARACTER
.A 1804 LDX #/"A"       ; SCREEN CODE
.A 1806 AND #%11110000  ; BINARY BYTE
.A 1808 CMP #250        ; BASE-10 BYTE

Accumulator Mode Operand

wAx supports both explicit and implicit syntax for accumulator mode instructions (ROR, ROL, LSR, ASL):

.A 1800 ROR A  ; TAKE YOUR
.A 1802 ROR    ; PICK!

Arithmetic

wAx allows you to apply simple arithmetic to address operands by placing + or - after the operand, followed by a hexadecimal digit. The range is -F to +F. For example:

.A 1800 STA $9000+5
.A 1803 LDA ($FF-3),Y
.A 1805 STA @V+F

Entering Data

For additional details, see Memory Editor.

In addition to 6502 code, you may also enter program data with the Assemble tool. The following formats are supported:

Text

You may enter quoted text of up to 16 characters:

.A 1800 "YOUR TEXT HERE" ; PETSCII codes
.A 1900 /"MORE TEXT!"    ; Commodore screen codes

Hex Bytes

You may enter up to eight bytes using a colon:

.A 1800 :1A 2B 3C 4D 5E 6F 70 81

Binary Bytes

You may enter one binary byte (eight bits) using a percent sign:

.A 1800 %00110001

Advanced Assembler Topics

Symbols

Symbol Table Manager

Multi-Pass Assembly

Undocumented Instruction Support