mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-16 19:15:10 +00:00
Remove opcode labels by default
This commit is contained in:
parent
969c2e3516
commit
e4416264e8
3 changed files with 8 additions and 254 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
local generate_labels = false
|
||||||
local replacements = {
|
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_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); }',
|
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]
|
local n = _list_0[_index_0]
|
||||||
_with_0:write(('\t\tcase 0x%02x: /* %s */\n'):format(n, allops[n + 1].name))
|
_with_0:write(('\t\tcase 0x%02x: /* %s */\n'):format(n, allops[n + 1].name))
|
||||||
end
|
end
|
||||||
|
if generate_labels then
|
||||||
_with_0:write(('\t\t\t__asm__("evaluxn_%02x_%s:");\n'):format(allops[i].n[1], allops[i].name))
|
_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)
|
_with_0:write(allops[i].body)
|
||||||
_continue_0 = true
|
_continue_0 = true
|
||||||
until true
|
until true
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
-- this file changes.
|
-- this file changes.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
generate_labels = false -- add labels to each opcode to inspect disassembled code
|
||||||
|
|
||||||
replacements =
|
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_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); }'
|
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
|
continue
|
||||||
for n in *allops[i].n
|
for n in *allops[i].n
|
||||||
\write '\t\tcase 0x%02x: /* %s */\n'\format n, allops[n + 1].name
|
\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 '\t\t\t__asm__("evaluxn_%02x_%s:");\n'\format allops[i].n[1], allops[i].name
|
||||||
\write allops[i].body
|
\write allops[i].body
|
||||||
\write [[
|
\write [[
|
||||||
|
|
252
src/uxn-fast.c
252
src/uxn-fast.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue