Something went wrong. Try again.
An assembler for the 6502 and 65SC02 written in Zig, in the dialect of Frank Kingswood's as65.
Something went wrong. Try again.
2.1 kB · 36 lines
at main
12345678910111213141516171819202122232425262728293031323334353637; SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>; SPDX-License-Identifier: MIT;; One line for each diagnostic the assembler can produce, so that the wording; and the placement of both stay put.
Defined equ 1 org $0b00
adc a ; invalid addressing mode lda #1000 ; immediate out of range lda 100000 ; absolute out of range lda ($1234),y ; no absolute form of (zp),y bra * ; no 6502 bra, so this becomes a jmp psscht ; not an instruction at all1 ; a label may not begin with a digit equ 123 ; and equ needs oneDefined equ 2 ; already defined db 1 2 ; syntax dd 37#1 ; no such number base dd 8/0 ; division by zeroTriple equ "abc" ; three characters is not a size beq $8000 ; out of reach include "nowhere.i" ; not there dd NeverDefinedLabelled align 2 ; align will not take a label endif ; and there was no if org $0b00 ; that byte is already spoken for endm ; only a macro ends with endm exitm ; and only a macro exits early local name ; and only a macro has local names fcc 1 ; fcc takes a string, not a number fcb "xy" ; and fcb a number, which will not fitx equ 1 ; x names a register, not a label memsize 100 ; neither a power of two nor a size if 1 ; left open, so the file ends badly