Menu

#3700 ld l, iyl is not reported as invalid

closed-fixed
None
sdas
5
2024-01-31
2024-01-22
Under4Mhz
No

The inline assembler instruction 'ld l, iyh' doesn't exist in z80. When used, it gets compiled (correctly) to 'ld iyl,iyh' which is not what I intended.

I'd prefer this to show an invalid instruction rather than compile successfully to something else.

The below code compiles:

/// GPL 2.0 or later
void main() {

    __asm

        ld l, iyh

    __endasm;
}

looking at the assembler output:

sdcc --no-std-crt0 -mz80 --allow-undocumented-instructions --fverbose-asm ./ldliyh.c  -o ldliyh.ihx
objcopy --input-target=ihex --output-target=binary ldliyh.ihx  ldliyh.rom

$ z80dasm ./ldliyh.rom 
; z80dasm 1.1.6
; command line: z80dasm ./ldliyh.rom

    org 00100h

    defb 0fdh,06ch  ;ld iyl,iyh
    ret 
sdcc -v
SDCC : z80/sm83/z80n/mos6502/mos65c02 TD- 4.4.0 #14620 (Linux)

Discussion

  • Philipp Klaus Krause

    • assigned_to: Philipp Klaus Krause
    • Category: other --> sdas
     
  • Philipp Klaus Krause

    • status: open --> pending-fixed
     
  • Philipp Klaus Krause

    Fixed in the next branch in [r14644].

     

    Related

    Commit: [r14644]

  • Philipp Klaus Krause

    • status: pending-fixed --> closed-fixed
     
  • Philipp Klaus Krause

    Fixed by merging next branch to trunk.

     

Log in to post a comment.

MongoDB Logo MongoDB