|
From: haibin z. <dr...@ya...> - 2007-07-18 10:05:38
|
--- Michael DOUBEZ <mic...@fr...>写道: > haibin zhang a écrit : > > Hi All : > > I test cpu id using as in > > binutils-2.17.50-20070129-1.tar.gz, but it can't > > compile pass, I have tested this in linux, it's > ok. > > > > I have two file :cpuidfunc.s stringtest.c > > I use compile command : > > gcc -o test.exe cpuidfunc.s stringtest.c > > > > It print error : > > $ gcc -o test.exe cpuidfunc.s stringtest.c > > cpuidfunc.s: Assembler messages: > > cpuidfunc.s:5: Warning: .type pseudo-op used > outside > > of .def/.endef ignored. > > cpuidfunc.s:5: Error: junk at end of line, first > > unrecognized character is `c' > [snip] > > > ------------------------------------------------------------------------ > > > > # cpuidfunc.s - An example of returning a string > value > > .section .bss > > .comm output, 13 > > .section .text > > .type cpuidfunc, @function > > .globl cpuidfunc > > cpuidfunc: > [snip] > > From Gnu Assembler: > http://tigcc.ticalc.org/doc/gnuasm.html#SEC133 > > .type > > Syntax: .type int > > This directive, permitted only within .def/.endef > pairs, records the > integer int as the type attribute of a symbol table > entry. > > The line should be. > .globl cpuidfunc > .def .type cpuidfunc, @function; .endef > > I changed as you said, but it occur this error: $ gcc -o haha cpuidfunc.s stringtest.c cpuidfunc.s: Assembler messages: cpuidfunc.s:7: Error: junk at end of line, first unrecognized character is `c' cpuidfunc.s:7: Error: unknown pseudo-op: `.enddef' $ cat cpuidfunc.s # cpuidfunc.s - An example of returning a string value .section .bss .comm output, 13 .section .text # .type cpuidfunc, @function .globl cpuidfunc .def .type cpuidfunc, @function; .enddef cpuidfunc: pushl %ebp movl %esp, %ebp pushl %ebx movl $0, %eax cpuid movl $output, %edi movl %ebx, (%edi) movl %edx, 4(%edi) movl %ecx, 8(%edi) movl $output, %eax popl %ebx movl %ebp, %esp popl %ebp ret ___________________________________________________________ 抢注雅虎免费邮箱3.5G容量,20M附件! http://cn.mail.yahoo.com |