that code is all wrong. I have solved the problem already :
section .bss
swap resb 3
%macro print 2
mov eax, 4
mov ebx, 1
mov ecx, %1
mov edx, %2
int 80h
%endmacro
%macro toswap 1
mov eax, [%1]
mov [swap],eax
mov eax, [%1+1]
mov [swap+1],eax
mov eax, [%1+2]
mov [swap+2],eax
%endmacro
section .data
alfa db 'abc'
alfalen equ $-alfa
section .text
global _start
_start:
mov si,3
mov bp,1
print alfa, alfalen
.loop:
toswap alfa
mov ah, [swap]
mov bx, [swap+1]
mov al, [swap+2]
mov [alfa],al
mov [alfa+1],ah
mov [alfa+2],bx
inc bp
print alfa, alfalen
test bp,si
jnz .loop
;***EXIT***
mov eax,1 ; (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
int 80h
Links that helped me
Linux Assembly - http://www.linuxassembly.org
NASM Manual ( available in doc/html directory of source )
Assembly Programming Journal - http://asmjournal.freeservers.com/
Mammon_'s textbase - http://www.eccentrica.org/Mammon/sprawl/textbase.html
Art Of Assembly - http://webster.cs.ucr.edu/Page_asm/ArtOfAsm.html
Sandpile - http://www.sandpile.org
comp.lang.asm.x86
NASM - http://www.cryogen.com/Nasm
Asmutils-HOWTO - doc/ directory of asmutils
http://maven.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html
http://www.ibm.com/developerworks/library/l-gas-nasm.html ///very helpful
http://maven.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html
http://www.laynetworks.com/assembly%20tutorials3.htm
http://www.nasm.us/
Be blessed