Hi im trying to compile this code in order to display the max of 2 given values in assembly but apparently can't seem to make it.
The error is
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o:
in function `_start': (.text+0x20):
undefined reference to `main'
collect2: error: ld returned 1 exit status
(Line breaks added for readability.)
And the code is
bits 64
global my_average
section .text
start:
push rbp
mov rbp, rsp
xor rax, rax
add rax, rdi
add rbx, rsi
cmp rax , rbx
jge .end
.end:
mov rax, rbx
mov rsp, rbp
pop rbp
ret