jacobly0 / fasmg-ez80

fasmg ez80 include files
23 stars 5 forks source link

assemble of ld h,iyh etc. #2

Closed stevexyz closed 7 years ago

stevexyz commented 7 years ago

I do not know how a real Z80 should interpret the generated code, but my emulator says that the assembly of "ld h,iyh" is really "ld iyh,iyh". Same should be for "ld iyh,h" "ld l,iyl" "ld iyl,l" and all the 4 corresponding instructions with ix. It make sense if the Z80 is using the prefix both for in value and out value to.

Not sure what to think for mixing the register h as "ld l,iyh" "ld iyh,l" "ld h,iyl" "ld iyl,h" and the other 4 corresponding with ix...

The instruction should be written and accepted as the real behaviour is going to go and rejected else: e.g. ok for "ld iyh,iyh" but error for the "ld h,iyh"

jacobly0 commented 7 years ago
$ cat test.asm
include 'ez80.inc'
    ld  h,iyh
$ fasmg test.asm test.bin
flat assembler  version g.hxmfv
test.asm [2]:
    ld h,iyh
macro ld [81] macro emit [5] macro byte [1]:
    db @values
Processed: db src
Error: variable term used where not expected.