(uxnasm) Prevent tail call optimisation when required, fixes asma

Literals do not get squashed across absolute or relative pads and
labels, now the tail call optimisations do not occur under the same
conditions. etc/asma-test.tal was identifying serious errors with
asma.rom, which uses "JSR2 &skip JMP2r" in @asma-macro-body.
This commit is contained in:
Andrew Alderwick 2022-06-07 20:03:12 +01:00
parent 0ff2a3586d
commit 978713474a
1 changed files with 4 additions and 4 deletions

View File

@ -299,24 +299,24 @@ parse(char *w, FILE *f)
if(!sihx(w + 1))
return error("Invalid padding", w);
p.ptr = shex(w + 1);
litlast = 0;
litlast = jsrlast = 0;
break;
case '$': /* pad-relative */
if(!sihx(w + 1))
return error("Invalid padding", w);
p.ptr += shex(w + 1);
litlast = 0;
litlast = jsrlast = 0;
break;
case '@': /* label */
if(!makelabel(w + 1))
return error("Invalid label", w);
scpy(w + 1, p.scope, 0x40);
litlast = 0;
litlast = jsrlast = 0;
break;
case '&': /* sublabel */
if(!makelabel(sublabel(subw, p.scope, w + 1)))
return error("Invalid sublabel", w);
litlast = 0;
litlast = jsrlast = 0;
break;
case '#': /* literals hex */
if(!sihx(w + 1) || (slen(w) != 3 && slen(w) != 5))