bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/27878] [z80-unknown-elf]: ld (hl), <16 bit immediate> should fa


From: petemoore at gmx dot net
Subject: [Bug gas/27878] [z80-unknown-elf]: ld (hl), <16 bit immediate> should fail assembly
Date: Tue, 18 May 2021 13:45:26 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27878

--- Comment #1 from Pete Moore <petemoore at gmx dot net> ---
Interestingly, the assembler will fail if the out-of-range value comes from a
label rather than an explicitly specified constant in the assembly source code:

```
$ cat test.asm

.org 0x1232       ; value chosen intentionally so that label == 0x1234
ld (hl), label
label:

$ z80-unknown-elf-as -o test.o test.asm && z80-unknown-elf-objdump -d test.o
test.asm: Assembler messages:
test.asm:2: Error: value of 4660 too large for field of 1 byte at 4659
```

This is the output I was also expecting for `ld (hl), 0x1234`.

Note, if the `.org 0x1232` is removed, label fits in 8 bits, and assembly
succeeds, as expected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]