mirror of
https://github.com/g012/l65.git
synced 2024-12-22 16:30:45 +00:00
Added 0x4Cxx MOV instructions.
This commit is contained in:
parent
c09a04964a
commit
0d66e70a69
12
l7801.lua
12
l7801.lua
@ -52,7 +52,8 @@ local Keywords_7801 = {
|
||||
}
|
||||
local Registers_7801 = {
|
||||
a=8,b=8,c=8,d=8,e=8,h=8,l=8,v=8,
|
||||
bc=16,de=16,hl=16,sp=16,va=16
|
||||
bc=16,de=16,hl=16,sp=16,va=16,
|
||||
pa=8,pb=8,pc=8,mk=8,mb=8,mc=8,tm0=8,tm1=8,s=8,
|
||||
}
|
||||
local Interrupts_7801 = lookupify{
|
||||
'f0','ft','f1','f2','fs'
|
||||
@ -140,6 +141,15 @@ local opcode_reg_reg_list = {
|
||||
e = lookupify{'mov'},
|
||||
h = lookupify{'mov'},
|
||||
l = lookupify{'mov'},
|
||||
pa = lookupify{'mov'},
|
||||
pb = lookupify{'mov'},
|
||||
pc = lookupify{'mov'},
|
||||
mk = lookupify{'mov'},
|
||||
mb = lookupify{'mov'},
|
||||
mc = lookupify{'mov'},
|
||||
tm0 = lookupify{'mov'},
|
||||
tm1 = lookupify{'mov'},
|
||||
s = lookupify{'mov'},
|
||||
},
|
||||
b = {
|
||||
a = lookupify{'mov'},
|
||||
|
@ -6,29 +6,29 @@ section{"rom", org=0x8000}
|
||||
di
|
||||
lxi sp,0xFFD2
|
||||
ei
|
||||
calt 0x8C
|
||||
calt 0x8C
|
||||
|
||||
lxi hl,vdc_data
|
||||
lxi de,0x3400
|
||||
mvi c,0x03
|
||||
block
|
||||
lxi hl,vdc_data
|
||||
lxi de,0x3400
|
||||
mvi c,0x03
|
||||
block
|
||||
|
||||
lxi hl,message
|
||||
lxi de,0x3044
|
||||
lxi bc,0x01ff
|
||||
lxi bc,0x01ff
|
||||
|
||||
@loop_0
|
||||
block
|
||||
dcr b
|
||||
jr loop_0
|
||||
jr loop_0
|
||||
|
||||
-- beep
|
||||
-- beep
|
||||
lxi hl,0x3600
|
||||
calf 0xfb0
|
||||
|
||||
@loop_1
|
||||
nop
|
||||
jr loop_1
|
||||
jr loop_1
|
||||
|
||||
section{"vdc_data", org=0x8030}
|
||||
dc.b 0xC0,0x00,0x00,0xF2
|
||||
@ -37,4 +37,4 @@ section{"message", org=0x8040}
|
||||
dc.b "\t\t\t\t Hello world! \t\t\t\t"
|
||||
dc.b 0x00
|
||||
|
||||
writebin(filename .. '.bin')
|
||||
writebin(filename .. '.bin')
|
||||
|
@ -168,5 +168,14 @@ section{"rom", org=0x8000}
|
||||
out 0x00
|
||||
out 0x5a
|
||||
out 0xbf
|
||||
mov a,pa
|
||||
mov a,pb
|
||||
mov a,pc
|
||||
mov a,mk
|
||||
mov a,mb
|
||||
mov a,mc
|
||||
mov a,tm0
|
||||
mov a,tm1
|
||||
mov a,s
|
||||
|
||||
writebin(filename .. '.bin')
|
20
uPD7801.lua
20
uPD7801.lua
@ -412,12 +412,32 @@ for k,v in pairs(opinout) do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local op4car8={
|
||||
movapa=M.op(0xc0,10),
|
||||
movapb=M.op(0xc1,10),
|
||||
movapc=M.op(0xc2,10),
|
||||
movamk=M.op(0xc3,10),
|
||||
movamb=M.op(0xc4,10),
|
||||
movamc=M.op(0xc5,10),
|
||||
movatm0=M.op(0xc6,10),
|
||||
movatm1=M.op(0xc7,10),
|
||||
movas=M.op(0xc8,10),
|
||||
} M.op4car8 = op4car8
|
||||
for k,v in pairs(op4car8) do
|
||||
M[k] = function()
|
||||
table.insert(M.section_current.instructions, { size=2, cycles=v.cycles, bin={ 0x4c, v.opc } })
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
--[[ [todo]
|
||||
|
||||
16 bits instructions:
|
||||
0x4cxx
|
||||
|
||||
|
||||
0x4dxx
|
||||
0x60xx
|
||||
0x64xx
|
||||
|
Loading…
Reference in New Issue
Block a user