0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-27 16:23:02 +00:00

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
_with_0:write(('\t\t\t__asm__("evaluxn_%02x_%s:");\n'):format(allops[i].n[1], allops[i].name))
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,7 +245,8 @@ 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
\write '\t\t\t__asm__("evaluxn_%02x_%s:");\n'\format allops[i].n[1], allops[i].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 [[
#pragma GCC diagnostic pop

File diff suppressed because it is too large Load diff