这么一个简单的程序编译报错,求解答,该怎么解决
这么一个简单的程序编译报错,求解答
1 .section .data
2
3 .section .text
4 .globl _start
5 _start:
6 movl $1, $eax
7 movl $4, $ebx
8
9 int $0x80
我是按照网上教程敲的(详见http://learn.akae.cn/media/ch18s01.html),结果编译报错:
[neil@localhost Assemble]$ as -o hello.o hello.s
hello.s: Assembler messages:
hello.s:6: Error: suffix or operands invalid for `mov'
hello.s:7: Error: suffix or operands invalid for `mov'
谁能告诉我这是为什么
------解决方案--------------------
movl $1, %eax
movl $4, %ebx
ATT语法,寄存器前面用%
1 .section .data
2
3 .section .text
4 .globl _start
5 _start:
6 movl $1, $eax
7 movl $4, $ebx
8
9 int $0x80
我是按照网上教程敲的(详见http://learn.akae.cn/media/ch18s01.html),结果编译报错:
[neil@localhost Assemble]$ as -o hello.o hello.s
hello.s: Assembler messages:
hello.s:6: Error: suffix or operands invalid for `mov'
hello.s:7: Error: suffix or operands invalid for `mov'
谁能告诉我这是为什么
------解决方案--------------------
movl $1, %eax
movl $4, %ebx
ATT语法,寄存器前面用%