Fix native code function pointer

This commit is contained in:
drmortalwombat 2021-10-21 10:24:21 +02:00
parent 7927df6d41
commit 00c59ce6a4
2 changed files with 11 additions and 0 deletions

View File

@ -173,6 +173,9 @@ bcode:
__asm bcexec __asm bcexec
{ {
#ifdef OSCAR_NATIVE_ALL
jmp (accu)
#else
lda ip lda ip
pha pha
lda ip + 1 lda ip + 1
@ -197,9 +200,16 @@ bdone: nop
pla pla
sta ip sta ip
rts rts
#endif
}
__asm jmpaddr
{
jmp (addr)
} }
#pragma runtime(bcexec, bcexec) #pragma runtime(bcexec, bcexec)
#pragma runtime(jmpaddr, jmpaddr)
__asm negaccu __asm negaccu
{ {

View File

@ -206,6 +206,7 @@ bool Compiler::GenerateCode(void)
RegisterRuntime(loc, Ident::Unique("ffromi")); RegisterRuntime(loc, Ident::Unique("ffromi"));
RegisterRuntime(loc, Ident::Unique("fcmp")); RegisterRuntime(loc, Ident::Unique("fcmp"));
RegisterRuntime(loc, Ident::Unique("bcexec")); RegisterRuntime(loc, Ident::Unique("bcexec"));
RegisterRuntime(loc, Ident::Unique("jmpaddr"));
RegisterRuntime(loc, Ident::Unique("mul32")); RegisterRuntime(loc, Ident::Unique("mul32"));
RegisterRuntime(loc, Ident::Unique("divs32")); RegisterRuntime(loc, Ident::Unique("divs32"));
RegisterRuntime(loc, Ident::Unique("mods32")); RegisterRuntime(loc, Ident::Unique("mods32"));