Add register parameters to AM append operation

This commit is contained in:
2025-08-10 20:50:35 +01:00
parent 76efcef953
commit eaef6f3cd3
5 changed files with 40 additions and 24 deletions

View File

@@ -26,13 +26,13 @@ void am_pop(am_t *am, am_reg_t reg)
am->regs[reg] = *++am->sp;
}
void am_append_arg(am_t *am)
void am_append(am_t *am, am_reg_t list_reg, am_reg_t item_reg)
{
expr_t *list = AM_ARGL(am);
expr_t *list = am->regs[list_reg];
while (!list->is_atom)
list = list->pair.cdr;
list->is_atom = false;
list->pair.car = AM_VAL(am);
list->pair.car = am->regs[item_reg];
list->pair.cdr = expr_empty_list(am);
}