Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 977 Bytes

200904170000.txt.md

File metadata and controls

37 lines (26 loc) · 977 Bytes

24.15 MIPS/Debian上嵌入式汇编中使用$a0这样的寄存器名

http://scz.617.cn/unix/200904170000.txt

Q:

$ as -v GNU assembler version 2.17 (mips-linux-gnu) using BFD version 2.17 Debian GNU/Linux $ gcc-2.95 -v gcc version 2.95.4 20011002 (Debian prerelease)


int main ( int argc, char * argv[] ) { asm volatile ("

text_begin:

/*
 * 这里$4写成$a0,编译时就说illegal operands,有办法让编译器认$a0吗?
 */
li  $a0, 0x51211314

");

return( 0 );

} /* end of main */

$ gcc-2.95 -Wall -pipe -o mips_inline_asm mips_inline_asm.c {standard input}: Assembler messages: {standard input}:32: Error: illegal operands `li $a0,0x51211314'

A: Nineveh@SMTH 2009-04-17

升级as到2.18.x,开始支持$a0这样的寄存器名。