I am trying to declare an array size of 10 double words and then sort them. I would like this to work even when the array size is changed. Below is my code:
segment .data
a dd 14, 10, 23, 45, 17, 9, 54, 22, 1, 76
size dd 10
segment .text
compare:
mov ax, 0 ;counter
mov bx, [a + ax]
cmp bx, [a + ax + 4]
jb swapnumb
;swap numbers
mov cx, [a + ax + 4]
mov [a + ax + 4], bx
mov [a + ax], cx
notswap:
add ax, 4
jmp compare
ret
I am receiveng the following errors:
SortSearch.asm:10: error: impossible combination of address sizes
SortSearch.asm:10: error: invalid effective address
SortSearch.asm:11: error: impossible combination of address sizes
SortSearch.asm:11: error: invalid effective address
SortSearch.asm:15: error: impossible combination of address sizes
SortSearch.asm:15: error: invalid effective address
SortSearch.asm:16: error: impossible combination of address sizes
SortSearch.asm:16: error: invalid effective address
SortSearch.asm:17: error: impossible combination of address sizes
SortSearch.asm:17: error: invalid effective address
Anyone have any suggestions?