global median
section .text
median:
xor rax,rax ; Initialize rax to zero
cmp rsi, 0;
jle finish ;
next:
mov rcx, 0;
not rcx;
outer:
inc rcx;
mov eax, rcx;
cmp rcx, rsi;
jl inner;
cmp rcx, rsi;
je mid;
inner:
inc eax;
cmp eax, rsi;
jge outer;
mov r10, [rdi+rcx*8];
mov r11, [rdi+eax*8];
cmp r10, r11;
jg swap;
swap:
mov r9,r10;
mov r10,r11;
mov r11,r9;
cmp eax, rsi;
jl inner;
mid:
mov rax, [rdx];
finish:
ret
Line 24: error: Impossible combination of address sizes. Line 24: error: Invalid effective address.
I'm trying to create the object file using the following command.
nasm -felf64 median.asm
I would appreciate it if someone could help me with this one.