Assembly inline C - example
Posted: Tue Jun 04, 2019 5:54 pm
Hello guys,
I have some code here in asm that I made in bex, and I'm trying to port them to sgdk, but I can not compile at all, if you can help me reu thanks, because I saw code I know the assembly is with the correct syntax, I already I looked for assemlby inline, but even so do not compile, who can help me, I put the most simple examples I have, I just need to understand how to write them for the compiler to run
code bex:
Some ways you tried, unsuccessfully:
I have some code here in asm that I made in bex, and I'm trying to port them to sgdk, but I can not compile at all, if you can help me reu thanks, because I saw code I know the assembly is with the correct syntax, I already I looked for assemlby inline, but even so do not compile, who can help me, I put the most simple examples I have, I just need to understand how to write them for the compiler to run
code bex:
Code: Select all
print "test asm68k"
'write ram and register a3
asm
move.l #$FF0010,a0
move.l #$CAFE,(a0)
move.l #$cafecafe,a3
end asm
'cls asm
Asm
move.w #0x8F02,(a4)
move.l #0x40000000,(a4)
move.w #0x7FFF,d1
End Asm
Code: Select all
#include <genesis.h>
void chamar1();
int main()
{
asm("move.l #$cafecafe,%a3");
while(1)
{
VDP_waitVSync();
VDP_drawText("asm 68k",1,1);
}
return (0);
}
//asm
void chamar1()
{
__asm__(
"move.l #$cafecafe,%a3\n"
"move.l #$cafecafe,%a4\n"
);
//END
}