1
0
mirror of https://github.com/g012/l65.git synced 2024-11-10 18:05:54 +00:00

Added DCX and INX instructions.

This commit is contained in:
mooz 2018-11-10 17:15:00 +01:00
parent b04ff787d4
commit 93ffdf28dd
3 changed files with 23 additions and 9 deletions

View File

@ -104,7 +104,7 @@ local opcode_reg_list = {
v = lookupify{'mvi'}, v = lookupify{'mvi'},
bc = lookupify{'lxi'}, bc = lookupify{'lxi'},
de = lookupify{'lxi'}, de = lookupify{'lxi'},
hl = lookupify{'lxi'}, hl = lookupify{'dcx','inx','lxi'},
sp = lookupify{'dcx','inx','lxi'}, sp = lookupify{'dcx','inx','lxi'},
} }

View File

@ -107,5 +107,10 @@ section{"rom", org=0x8000}
bit5 (v,0xdc) bit5 (v,0xdc)
bit6 (v,0xba) bit6 (v,0xba)
bit7 (v,0x98) bit7 (v,0x98)
dcx bc
dcx de
dcx hl
inx bc
inx de
inx hl
writebin(filename .. '.bin') writebin(filename .. '.bin')

View File

@ -69,6 +69,21 @@ for k,v in pairs(opsp) do
end end
end end
local opr16={
dcxbc=M.op(0x13,7),
dcxde=M.op(0x23,7),
dcxhl=M.op(0x33,7),
inxbc=M.op(0x12,7),
inxde=M.op(0x22,7),
inxhl=M.op(0x32,7),
} M.opr16 = opr16
for k,v in pairs(opr16) do
M[k] = function()
table.insert(M.section_current.instructions, { size=1, cycles=v.cycles, bin=v.opc })
end
end
local opregxx ={ local opregxx ={
mvib=M.op(0x6a,7), mvib=M.op(0x6a,7),
mvic=M.op(0x6b,7), mvic=M.op(0x6b,7),
@ -296,12 +311,6 @@ return M
mvixhl=M.op(0x4b,10) mvixhl=M.op(0x4b,10)
- (r16) - (r16)
dcxbc=M.op(0x13,7),
dcxde=M.op(0x23,7),
dcxhl=M.op(0x33,7),
inxbc=M.op(0x12,7),
inxde=M.op(0x22,7),
inxhl=M.op(0x32,7),
ldaxbc=M.op(0x29,7), ldaxbc=M.op(0x29,7),
ldaxde=M.op(0x2a,7), ldaxde=M.op(0x2a,7),
ldaxhl=M.op(0x2b,7), ldaxhl=M.op(0x2b,7),