Date : Tue, 22 Mar 2005 22:57:00 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Re: Assembler bug
"A.Weston" <a.weston2@...> wrote:
> > This will not work:
> >
> > FOR P=0 TO 1
> > P%=&900
> > [OPT P*3
> > LDA loc:ADC #1:RTS :\ How the hell do I know the size of loc?
> > ]
> > loc=&80
> > NEXT
> >
> This would return a BASIC error though wouldn't it - not a bug in the
> machine code?
On the first pass, OPT is set to zero, so suppressing any errors
such as "Variable not found", so the assembler fills in the
address field of any undefined label with dummy bytes (it uses the
value of P%). On the second pass, OPT is set to 3, so any
"Variable not found" errors would be generated. However, on the
second pass, 'loc' has been defined, so no error would be
triggered anyway. Unfortunately, 'loc' is a zero-page location,
and the assembler assembles a zero-page LDA, whereas the first
pass has assembled a 16-bit LDA.
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam