global _start section .text str1: db "hasjsdahsjdasdaasdjasdjas", 0 section .data _start: mov eax, str1 mov esi, eax mov edx, 0 sortloop1: mov ah, [esi] cmp ah, 0 je sortloop1end mov eax, esi mov edi, eax sortloop2: inc edi mov ah, [edi] cmp ah, 0 je sortloop2end mov ah, [esi] mov al, [edi] cmp ah, al jle sortnoexchg mov ah, [esi] mov al, [edi] mov [edi], ah mov [esi], al sortnoexchg: jmp sortloop2 sortloop2end: inc esi inc edx jmp sortloop1 sortloop1end: ;;mov edx, length mov ecx, str1 mov ebx, 1 mov eax, 4 int 0x80 mov ebx, 0 mov eax, 1 int 80h
david@work:~$ nasm -f elf32 sort20240916.asm david@work:~$ ld -m elf_i386 sort20240916.o -o sort20240916 david@work:~$ ./sort20240916 Speicherzugriffsfehler (Speicherabzug geschrieben) david@work:~$