GP32 asm keyword not recognized


Sdw

Member
Joined
May 8, 2003
Messages
146
Location
Sweden
Website
www.ag1976.com
I'm trying to compile Mr.Spivs MMUChange function, but can't get it to compile:

Code:
 void C_MMUChange( void *StartBlock, void *EndBlock, int Flag ) {
	asm volatile(""
  "mov r0,%0 \n"
  "mov r1,%1 \n"
  "mov r2,%2 \n"
  "swi #0x02 \n"
  :
  : "r" (StartBlock), "r" (EndBlock), "r" (Flag)
  : "r0", "r1", "r2"
	);
}

The compiler complains that it doesn't recognize the "asm" keyword. I'm using devkitadv.
 
What about __asm__ or _asm_ ?

Hey this code's pretty neat, now i understand asma little bit more.
 
Check the asm output to see what it actually made out of your code..
-S to gcc.

---
mithris
 
Good idea bout the -S directive. But what are all these swi commnads are they in the samsung doc or on the arm cd?

And is there a doc about the lcd somewhere so i can compare with mr spivs info.
 
I don't know much about asm, but swi means software interrupt. Normally used for calling bios functions etc. Not sure what its used here for.
 
mithris posted on Jul 2 2003 said:
Check the asm output to see what it actually made out of your code..
-S to gcc.

---
mithris
But since it doesn't recognize the asm keyword, i presume it doesn't produce anything at all, since the compile halts at an early stage?
 
Last edited by a moderator:
The compiler just forward whatever is in your asm-statement to the .s file it generates, and then it's up to gas.

---
mithris
 
I wonder if anyone has made an asm only project. (i would like to make one like that)
 
Back
Top