http://sourceware.org/bugzilla/show_bug.cgi?id=12269
Summary: unknown-z80-coff: Incorrect assembly of indexed
register offsets from equ declarations
Product: binutils
Version: unspecified
Status: NEW
Severity: critical
Priority: P2
Component: gas
AssignedTo: unassig...@sources.redhat.com
ReportedBy: chris.smit...@googlemail.com
For the target unknown-z80-coff, Indexed register offsets are incorrectly
assembled as zero if they reference an equ declarations that has yet to be
made. Providing the equ declaration first in the file produces the correct
offset.
This produces incorrect executables from correct Z80 source.
Other uses of the equ value appear to assemble correctly (LD A, offsetAtEnd for
example below).
Example code and dump illustrating the problem:
-
begin:
offsetAtStart:equ 32
LDA, offsetAtStart
LDA, (IX + offsetAtStart)
LDA, offsetAtEnd
LDA, (IX + offsetAtEnd)
RET
offsetAtEnd: equ 64
END
This produces the following (note the 00 offset at line 10 - should be 0x40 as
in line 9)
1begin:
2
3offsetAtStart:equ 32
5
6 3E20 LDA, offsetAtStart
7 0002 DD7E 20 LDA, (IX + offsetAtStart)
8
9 0005 3E40 LDA, offsetAtEnd
10 0007 DD7E 00 LDA, (IX + offsetAtEnd)
11
12 000a C9RET
13
14offsetAtEnd: equ 64
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils