global _start
section .data
ToSortStr db "oopeppepepppoeernemnremrnemeppepe", 0x00
ToSortStrlen dd 0
section .text
_start:
mov esi, ToSortStr
loop2:
mov al, [esi]
cmp al, 0x00
je loop2end
mov edi, esi
loop3:
inc edi
mov al, [edi]
cmp al, 0x00
je loop3end
mov al, [esi]
mov ah, [edi]
cmp al, ah
jge noexchange
mov al, [esi]
mov ah, [edi]
mov [esi], ah
mov [edi], al
noexchange:
jmp loop3
loop3end:
inc esi
jmp loop2
loop2end:
mov ecx, 0x00
mov esi, ToSortStr
loop1:
inc ecx
lodsb
cmp al, 0x00
jne loop1
mov edx, ecx
mov ecx, ToSortStr
mov ebx, 1
mov eax, 4
int 0x80
mov ebx, 0
mov eax, 1
int 80h
|