In SDCC function params are always passed on stack, but return value in HL. So pop hl/push hl moves function parameter to return value register HL. (pop/push bc is of course just used to get past return address value in stack.)
Seems odd compiler doesn't pass parameters in registers in a relatively register rich z80 arch.
In SDCC function params are always passed on stack, but return value in HL. So pop hl/push hl moves function parameter to return value register HL. (pop/push bc is of course just used to get past return address value in stack.)
Seems odd compiler doesn't pass parameters in registers in a relatively register rich z80 arch.