thanks for the reply
I have MDK9.2 and gcc 3.3.1.
Does anyone know how I can compile the assembly in a c file?

void main() {
__asm__("
       mov   $0x0, %ebx
       mov   $0x1, %eax
       int    $0x80
");
}

any help is appreciated, please. :)

best regards
Chungwei


Björn Lundin wrote:


Chungwei Hsiung wrote:



Thanks for the reply. I really appreciate it.
My story is a little bit different..
I just copy the codes you modified to a file and I compile it.
I have the following error message that I had before. Any other thoughts??


$cat asmExit.c void main() { __asm__(" mov $0x0, %ebx mov $0x1, %eax int $0x80 "); }

$ gcc -c asmExit.c
asmExit.c:2:9: missing terminating " character
asmExit.c: In function `main':
asmExit.c:3: error: syntax error before "mov"
asmExit.c:6:1: missing terminating " character
asmExit.c:1: warning: return type of `main' is not `int'

best regards,
Chungwei




It might have something to do with the compiler version. I run mdk 9.1. Have a look at the first warning my compiler gives. In your compiler version it migth be more than deprecated, it might have been removd. Try having it all on one line? Perhaps not practical in a real world situation, but there is perhaps som new switch to gcc? /Björn

[EMAIL PROTECTED] tmp]$ gcc --version
gcc (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[EMAIL PROTECTED] tmp]$ gcc asm_test.c
asm_test.c:2:9: warning: multi-line string literals are deprecated
asm_test.c: In function `main':
asm_test.c:1: warning: return type of `main' is not `int'
[EMAIL PROTECTED] tmp]$ cat as
asm_test.c  asm_test.o
[EMAIL PROTECTED] tmp]$ cat asm_test.c
void main() {
__asm__("
       mov   $0x0, %ebx
       mov   $0x1, %eax
       int    $0x80
");
}
[EMAIL PROTECTED] tmp]$




------------------------------------------------------------------------

Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
____________________________________________________
Join the Club : http://www.mandrakeclub.com

Reply via email to