Hello assemblers :) .
I am trying to sort a word backwards, like this: abcde -> edcba
This is my code
section .bss
aloc resb 10
%macro print 2
mov eax, 4
mov ebx, 1
mov ecx, %1
mov edx, %2
int 80h
%endmacro
section .data
str: db 'abcde',10
strlen: equ $-str
section .text
global _start
_start:
mov ax, strlen/2
mov si,0
.loop:
mov dx , [str + si]
mov cx , [str + strlen - si] ; error 31
mov [aloc + si], dx
mov [aloc + strlen - si], cx; error 33
inc si
print aloc, strlen
test ax,si
jnz .loop
;***EXIT***
mov eax, 1 ; (sys_exit)
mov ebx, 0 ; Exit with return code of 0 (no error)
int 80h
Errors
lab4a.asm:31: error: invalid effective address
lab4a.asm:33: error: invalid effective address
Would someone help me, pls?