1
0
mirror of https://github.com/g012/l65.git synced 2024-06-10 18:29:44 +00:00
l65/macro/6502.lua

25 lines
533 B
Lua

--[[
6502 assembler macros.
]]
local M = require 'macro'
local val = function(s)
end
local op_imm = {}
local op = {
lda = function(get,put)
get:expecting 'space'
local t,v = get:next()
if t ~= '#' then return nil,true end
t,v = get:block(nil, {['\n']=true,['--']=true})
return put 'lda.imm(' :tokenlist t ')' :token v
--v = get:upto '\n' --'[;\n(--)]'
--return ('lda.imm(%s)\n'):format(v)
end,
}
for k,v in pairs(op) do M.define(k,v) end