25 lines
634 B
Lua
25 lines
634 B
Lua
-- fmt.lua -- six formatted strings, read back from the app's output cells.
|
|
-- fmt.sh checks each FMT:n line byte-for-byte.
|
|
local dir = (debug.getinfo(1, "S").source:gsub("^@", ""):match("^(.*)/") or ".")
|
|
local H = dofile(dir .. "/harness.lua")
|
|
|
|
local FMT_MARK = tonumber(os.getenv("FMT_MARK") or "0x01A00000")
|
|
|
|
local function rstr(a, n)
|
|
local t = {}
|
|
for i = 0, n - 1 do
|
|
local c = H.prog:read_u8(a + i * 8)
|
|
if c == 0 then break end
|
|
t[#t + 1] = string.char(c)
|
|
end
|
|
return table.concat(t)
|
|
end
|
|
|
|
H.result_dump(function()
|
|
for i = 0, 5 do
|
|
print(string.format("FMT:%d [%s]", i, rstr(FMT_MARK + i * 0x80, 16)))
|
|
end
|
|
end)
|
|
|
|
H.run()
|