[OSy] dotaz na ASM
Nodir Yuldashev
y_nodir at yahoo.com
Fri Jan 12 12:21:01 CET 2007
Ty registry v kodu asm musis jeste jednou obalit
symbolem '"', tj. napr:
__asm__ ( " sw $""v0"", %0 ; .set pop" : "=m"
(retval) ); }
--- Vaclav Klecanda <vencax at centrum.cz> wrote:
> 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)
> }
>
> _______________________________________________
> OSy mailing list
> OSy at dsrg.mff.cuni.cz
> http://dsrg.mff.cuni.cz/mailman/listinfo/osy
>
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.
More information about the NSWI004
mailing list