Limitations of a two-pass assembler
boston.conman.org·9h
Flag this post

Monday, November 03, 2025

Limitations of a two-pass assembler

I’ve come to realize that supporting foward references in a two-pass assembler isn’t always easy. The simple case of forward references I support:

lda	#alpha
alpha	equ	5

On pass 1, alpha isn’t defined, but by pass two, we have its value—5.

With this code, however:

lda	#alpha
alpha	equ	bravo
bravo	equ	5

alpha is undefined on line 1, and it remains undefined even on line 2 because we haven’t defined bravo yet. Thus when we end pass 1, alpha is still undefined. That it took me two years to even stumble across this issue is a bit surprising to me. I just haven’t written 6809 assemb…

Similar Posts

Loading similar posts...