[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Found a minor bug in Merlin-8 v2.58
- Subject: Re: Found a minor bug in Merlin-8 v2.58
- From: Benoit0123 <bgilon@free.fr>
- Date: Sun, 3 Mar 2013 21:53:05 +0000 (UTC)
- Bytes: 1933
- Newsgroups: comp.sys.apple2
- Organization: Mac GUI
- References: <2013030219093742255-wssimms@gmailcom>
- User-agent: Mac GUI Usenet
Hi all,
I understand that the assembler is a two pass assembler and that the size of
instructions must be known on the first pass (every label value is computed
during this first pass too). However, as MSG and ENDMSG are forward
references from where the LDY instruction is, Merlin has no way to guess
whether to use direct or absolute addressing mode at that time. It selected
the most conservative option (that is the absolute mode option): that's why
the symbol table illustrates this decision.
However, as the 2nd pass began, the code generation found out that the
operand has a value of less than 256 and thus, erroneously, choses to
generate the direct page addressing instruction.
A simple work around in this case would be to add a ':' to the mnemonic of
the LDY instruction.
LDY: ENDMSG-MSG
RTS
MSG ASC "HI!"
ENDMSG
HTHATS,
Benoît