读书人

这么一个简单的程序编译报错求解答,

发布时间: 2012-03-18 13:55:39 作者: rapoo

这么一个简单的程序编译报错,求解答
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语法,寄存器前面用%

读书人网 >汇编语言

热点推荐