Hi!
I'm new to assembly coding and I have an assignment in Intel/AMD where I'm supposed to code a file that consists of different subroutines and another file that produces the code to take care of. But first, as a start, I think I have to start with small pieces of code. The first file, intellab.s:
.data
UTBUFFERT: .skip 128
INBUFFERT: .skip 128
.text
puttext: pushl %ebp
movl %esp, %ebp
movl UTBUFFERT, %eax
popl %ebx
igenUtBuffert: movb (%ebx), %al
cmpb $0, %al
je puttextLoopEnd
incl %ebx
incl %eax
jmp igenUtBuffert
puttextLoopEnd: pushl UTBUFFERT
popl %ebp
ret
outimage: pushl %ebp
movl %esp, %ebp
popl %eax
call printf
popl %ebp
ret
and the second file, MprovEgen.s:
.data
Head: .asciz "Start av testprogram.Skriv in 2 tal!"
.text
.global main
main:
pushl $Head
call puttext
call outimage
call exit
But when i compile this
anders@anders-VirtualBox:~$ gcc -o intellab intellab.s MprovEgen.s
I get the error message:
/tmp/ccZ5m2tf.o: In function `main':
(.text+0x6): undefined reference to `puttext'
/tmp/ccZ5m2tf.o: In function `main':
(.text+0xb): undefined reference to `outimage'
collect2: ld returned 1 exit status
Does anyone understand this, what is wrong here?
Regards, Anders