mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-12 03:30:09 +00:00
Emit LD (m),BC and similar instructions
This commit is contained in:
parent
704ae17d30
commit
39dfe13a3f
@ -101,6 +101,16 @@ class Z80Assembler(program: Program,
|
||||
writeByte(bank, index, 0x22)
|
||||
writeWord(bank, index + 1, param)
|
||||
index + 3
|
||||
case ZLine(LD_16, TwoRegisters(reg@(ZRegister.BC | ZRegister.DE | ZRegister.SP), ZRegister.MEM_ABS_16), param, _) =>
|
||||
writeByte(bank, index, 0xed)
|
||||
writeByte(bank, index+1, 0x4b + 0x10 * internalRegisterIndex(reg))
|
||||
writeWord(bank, index + 2, param)
|
||||
index + 4
|
||||
case ZLine(LD_16, TwoRegisters(ZRegister.MEM_ABS_16, reg@(ZRegister.BC | ZRegister.DE | ZRegister.SP)), param, _) =>
|
||||
writeByte(bank, index, 0xed)
|
||||
writeByte(bank, index+1, 0x43 + 0x10 * internalRegisterIndex(reg))
|
||||
writeWord(bank, index + 2, param)
|
||||
index + 4
|
||||
case ZLine(LD_16, TwoRegisters(ZRegister.SP, ZRegister.HL), _, _) =>
|
||||
writeByte(bank, index, 0xF9)
|
||||
index + 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user