Remove opcode labels by default

This commit is contained in:
Andrew Alderwick 2021-08-20 07:06:28 +01:00
parent 969c2e3516
commit e4416264e8
3 changed files with 8 additions and 254 deletions

View File

@ -1,3 +1,4 @@
local generate_labels = false
local replacements = {
op_and16 = '{ Uint8 a = pop8(u->src), b = pop8(u->src), c = pop8(u->src), d = pop8(u->src); push8(u->src, d & b); push8(u->src, c & a); }',
op_ora16 = '{ Uint8 a = pop8(u->src), b = pop8(u->src), c = pop8(u->src), d = pop8(u->src); push8(u->src, d | b); push8(u->src, c | a); }',
@ -341,7 +342,9 @@ uxn_eval(Uxn *u, Uint16 vec)
local n = _list_0[_index_0]
_with_0:write(('\t\tcase 0x%02x: /* %s */\n'):format(n, allops[n + 1].name))
end
if generate_labels then
_with_0:write(('\t\t\t__asm__("evaluxn_%02x_%s:");\n'):format(allops[i].n[1], allops[i].name))
end
_with_0:write(allops[i].body)
_continue_0 = true
until true

View File

@ -17,6 +17,8 @@
-- this file changes.
--
generate_labels = false -- add labels to each opcode to inspect disassembled code
replacements =
op_and16: '{ Uint8 a = pop8(u->src), b = pop8(u->src), c = pop8(u->src), d = pop8(u->src); push8(u->src, d & b); push8(u->src, c & a); }'
op_ora16: '{ Uint8 a = pop8(u->src), b = pop8(u->src), c = pop8(u->src), d = pop8(u->src); push8(u->src, d | b); push8(u->src, c | a); }'
@ -243,6 +245,7 @@ uxn_eval(Uxn *u, Uint16 vec)
continue
for n in *allops[i].n
\write '\t\tcase 0x%02x: /* %s */\n'\format n, allops[n + 1].name
if generate_labels
\write '\t\t\t__asm__("evaluxn_%02x_%s:");\n'\format allops[i].n[1], allops[i].name
\write allops[i].body
\write [[

File diff suppressed because it is too large Load Diff