Hey, i just started a class in assembly language and im receiving a strange error. When ever I attempt to compile the program, I get an error that says "Error: junk at end of line, first recognized character is valued: 0xffffffc2" (lines 5 and 7). I am using the gcc compiler as provided by the latest version of ubuntu.
the problem appears to only occur after attempting to declare a string.
Here is the code:
.section .data
values:
.int 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60
output:
.asciz "The value is %d\n"
sum:
.asciz "The sum is %d\n"
.section .text
.globl _start
_start:
nop
movl $0, %edi
loop:
movl values(, %edi, 4), %eax
addl %eax, %ecx
pushl %eax
pushl $output
call printf
addl $8, %esp
inc %edi
cmpl $11, %edi
jne loop
pushl %ecx
call printf
addl $4, %esp
movl $0, %ebx
movl $1, %eax
int 0x80
Bookmarks