;; jetzt ein assembler programm f"ur nasm
;; hat nicht sortiert, ist noch ein fehler drin, ich lerne jetzt auswendig
global _start
section .data
toSortStr: db "ghfkhfkhggkfghbcbncmvcmbcvb", 0
section .text
_start:
mov esi, toSortStr
mov ecx, 0x00
loop1:
mov ah, [esi]
cmp ah, 0
je loop1end
inc ecx
inc esi
jmp loop1
loop1end:
mov esi, toSortStr
mov ebx, 0
loop2:
cmp ebx, ecx
je loop2end
mov edx, ebx
mov edi, esi
loop3:
inc esi
inc edx
cmp edx, ecx
je loop3end
mov ah, [esi]
mov al, [edi]
cmp ah, al
jge goon
mov ah, [esi]
mov al, [edi]
mov [esi], al
mov [edi], ah
goon:
jmp loop3
loop3end:
inc ebx
inc esi
jmp loop2
loop2end:
mov edx, ecx
mov ecx, toSortStr
mov ebx, 1
mov eax, 4
int 0x80
mov ebx, 0
mov eax, 1
int 80h
|