Can't compile Assembler code on Ubuntu 14.04
I keep getting messages in terminal like: "Error: operand type mismatch for `sub' " when i compile program with " gcc -g -o prog1 prog1.S " and i doubble checked every code i tried to compile. Need some help asap
Here's one of the codes i wrote using Text Editor:
#sum of the first N numbers
.section .text
.global main
main:
movl $0, %eax
movl $10, %ecx
compare:
cmpl $0, %ecx
je end
addl %ecx, %eax
subl $1, $ecx
jmp compare
end:
movl $1, %eax
int $0x80
|