mirror of https://github.com/g012/l65.git
Added CALF instruction.
This commit is contained in:
parent
f8ad543033
commit
e56a44afa9
|
@ -38,7 +38,7 @@ local Keywords_data = {
|
|||
'dc',
|
||||
}
|
||||
local Keywords_7801 = {
|
||||
'block', 'calt', 'dcr', 'jr', 'lxi', 'mvi', 'nop'
|
||||
'block', 'calf', 'calt', 'dcr', 'jr', 'lxi', 'mvi', 'nop'
|
||||
}
|
||||
local Registers_7801 = {
|
||||
a=8,b=8,c=8,d=8,e=8,h=8,l=8,v=8,
|
||||
|
@ -65,7 +65,7 @@ local opcode_implied = lookupify{
|
|||
'block', 'dcr', 'nop'
|
||||
}
|
||||
local opcode_immediate = lookupify{
|
||||
'calt', 'lxi', 'mvi'
|
||||
'calf', 'calt', 'lxi', 'mvi'
|
||||
}
|
||||
local opcode_relative = lookupify{
|
||||
'jr',
|
||||
|
|
14
uPD7801.lua
14
uPD7801.lua
|
@ -275,6 +275,19 @@ M.calt = function(late, early)
|
|||
table.insert(M.section_current.instructions, op)
|
||||
end
|
||||
|
||||
M.calf = function(late, early)
|
||||
local l65dbg = { info=debug.getinfo(2, 'Sl'), trace=debug.traceback(nil, 1) }
|
||||
local op = { cycles=16 }
|
||||
op.size = function() late,early = M.size_op(late,early) return 2 end
|
||||
op.bin = function() local l65dbg=l65dbg
|
||||
local x = 0 + M.op_eval_word(late,early)
|
||||
if x < 0x0800 or x > 0xffff then error("subroutine address out of range [0x0800-0xffff]: " .. x) end
|
||||
x = x - 0x0800;
|
||||
return { 0x78 | ((x>>8) & 0x07), x&0xff }
|
||||
end
|
||||
table.insert(M.section_current.instructions, op)
|
||||
end
|
||||
|
||||
M.jr = function(label)
|
||||
local l65dbg = { info=debug.getinfo(2, 'Sl'), trace=debug.traceback(nil, 1) }
|
||||
local parent,offset = M.label_current
|
||||
|
@ -312,7 +325,6 @@ return M
|
|||
8 bits instructions:
|
||||
JRE+ 0x4e xx 17
|
||||
JRE- 0x4f xx 17
|
||||
CALF 0x78-0x75 xx 16
|
||||
|
||||
16 bits instructions:
|
||||
0x48xx
|
||||
|
|
Loading…
Reference in New Issue