1
0
mirror of https://github.com/g012/l65.git synced 2024-12-22 16:30:45 +00:00

Added 0x74xx instructions.

This commit is contained in:
mooz 2018-11-17 18:58:07 +01:00
parent 08086d222e
commit b9fc343548
3 changed files with 46 additions and 2 deletions

View File

@ -52,6 +52,7 @@ local Keywords_7801 = {
'table','xri',
'ana','xra','ora','addnc','gta','subnb','lta','add','adc','sub','nea','sbb','eqa',
'ona','offa',
'anaw','xraw','oraw','addncw','gtaw','subnbw','ltaw','addw','onaw','adcw','offaw','subw','neaw','sbbw','eqaw',
}
local Registers_7801 = {
a=8,b=8,c=8,d=8,e=8,h=8,l=8,v=8,
@ -89,6 +90,7 @@ local opcode_immediate = lookupify{
local opcode_wa = lookupify{
'inrw','ldaw','dcrw','staw',
'bit0','bit1','bit2','bit3','bit4','bit5','bit6','bit7',
'anaw','xraw','oraw','addncw','gtaw','subnbw','ltaw','addw','onaw','adcw','offaw','subw','neaw','sbbw','eqaw',
}
local opcode_wab = lookupify{
'mviw','eqiw'
@ -129,6 +131,7 @@ local opcode_reg_list = {
v = lookupify{'ani','xri','ori','adinc','gti','suinb','lti','adi','oni','aci','offi','sui','nei','sbi','eqi',
'inrw','ldaw','dcrw','eqiw','mvi','mviw','staw',
'bit0','bit1','bit2','bit3','bit4','bit5','bit6','bit7',
'anaw','xraw','oraw','addncw','gtaw','subnbw','ltaw','addw','onaw','adcw','offaw','subw','neaw','sbbw','eqaw',
},
bc = lookupify{'ldax','lxi','mvix','pop','push','stax'},
de = lookupify{'ldax','ldaxd','ldaxi','lxi','mvix','pop','push','stax','staxd','staxi'},

View File

@ -590,5 +590,20 @@ section{"rom", org=0x8000}
eqi pb,0xb1
eqi pc,0xb2
eqi mk,0xb3
anaw (v,0xf0)
xraw (v,0xe1)
oraw (v,0xd2)
addncw (v,0xc3)
gtaw (v,0xb4)
subnbw (v,0xa5)
ltaw (v,0x96)
addw (v,0x87)
onaw (v,0x78)
adcw (v,0x69)
offaw (v,0x5a)
subw (v,0x4b)
neaw (v,0x3c)
sbbw (v,0x2d)
eqaw (v,0x1e)
writebin(filename .. '.bin')

View File

@ -531,11 +531,37 @@ for i,o in ipairs(op64names) do
k = k + 4
end
local op74wa = {
anaw=M.op(0x88,14),
xraw=M.op(0x90,14),
oraw=M.op(0x98,14),
addncw=M.op(0xa0,14),
gtaw=M.op(0xa8,14),
subnbw=M.op(0xb0,14),
ltaw=M.op(0xb8,14),
addw=M.op(0xc0,14),
onaw=M.op(0xc8,14),
adcw=M.op(0xd0,14),
offaw=M.op(0xd8,14),
subw=M.op(0xe0,14),
neaw=M.op(0xe8,14),
sbbw=M.op(0xf0,14),
eqaw=M.op(0xf8,14),
} M.op74wa = op74wa
for k,v in pairs(op74wa) do
M[k .. 'wa'] = function(late, early)
local l65dbg = { info=debug.getinfo(2, 'Sl'), trace=debug.traceback(nil, 1) }
local size = function() late,early = M.size_op(late,early) return 2 end
local bin = function() local l65dbg=l65dbg return { 0x74, v.opc, M.op_eval_byte(late,early) } end
table.insert(M.section_current.instructions, { size=size, cycles=v.cycles, bin=bin })
end
end
return M
--[[ [todo]
16 bits instructions:
0x70xx
0x74xx
]]--