Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Execute-Computer-Zero/Lua/execute-computer-zero-2.lua
Normal file
15
Task/Execute-Computer-Zero/Lua/execute-computer-zero-2.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
vmz.dism = function(self)
|
||||
local mnem, imax = { [0]="NOP", "LDA", "STA", "ADD", "SUB", "BRZ", "JMP", "STP" }
|
||||
for pc = 31,0,-1 do imax=pc if self.mem[pc]~=0 then break end end
|
||||
local result, pretty = "", " %3s %2d\n"
|
||||
for i = 0, imax do
|
||||
local oper, addr = self.b2oa(self.mem[i])
|
||||
result = result .. pretty:format(mnem[oper], addr)
|
||||
end
|
||||
return result
|
||||
end
|
||||
vmz:boot():load({[0]=44,106,76,43,141,75,168,192,44,224,8,7,0,1})
|
||||
print("Disassembly of 7 x 8 (PRE-RUN):")
|
||||
print(vmz:dism())
|
||||
print("Disassembly of 7 x 8 (POST-RUN):")
|
||||
print(vmz:exec():dism())
|
||||
Loading…
Add table
Add a link
Reference in a new issue