[OSy] dotaz na ASM

Vaclav Klecanda vencax at centrum.cz
Fri Jan 12 12:04:10 CET 2007


Dobre poledne, muze mi prosim nekdo kdo umi assembler, poradit, proc mi pri prekladu tohoto kodu porad vyjizdi error:
 expected ':' or ')' before numeric constant ??, Diky
Kod:
#define a0      4
#define a1      5
#define a2      6
#define a3      7
#define v0      2

#define CALL_SYSCALL(index, retval, p1, p2, p3) { \
	__asm__ ( " .set push ; .set noreorder ; nop" ); \
        __asm__ ( " lw $"a0", %0 ; lw $"a1", %1 ; lw $"a2", %2 " : : "m" (p1), "m" (p2), "m" (p3) ); \
	__asm__ ( "nop ; nop ; nop");	\
	__asm__ ( "syscall %0" : : "i" (index));	\
	__asm__ ( "nop ; nop ; nop");	\
	__asm__ ( " sw $"v0", %0 ; .set pop" : "=m" (retval) ); }
	
void main(int i)
{
	int retval, p1, p2, p3;
	CALL_SYSCALL(i, retval, p1, p2, p3)
}




More information about the NSWI004 mailing list