Open mankeli opened 1 month ago
well, found some way to do this. it still uses the intermediate storage though
procedure setstuff(funcaddr : integer);
begin
asm("
ldx #funcaddr+0
ldy #funcaddr+1
jsr $F000
");
end;
...
procedure myfunc();
begin
dostuff();
end;
setstuff(#myfunc());
..and if setstuff is set inline, the compiler fails to use the function address at all.
; LineNumber: 55
lda #<myfunc
ldy #>myfunc
; Calling storevariable on generic assign expression
sta funcaddr
sty funcaddr+1
from the callsite isn't generated at all.
I would want to write a function (procedure) like this, that takes a function pointer and then passes the value into somewhere else. Is it possible? Some built-in functions do this, but I'm not sure if it's possible with the syntax.