include \masm32\MasmBasic\MasmBasic.inc
.code
PrintSleep proc arg
invoke Sleep, arg
Print Str$("%i\n", arg)
ret
PrintSleep endp
unsorted dw 999, 333, 666, 444, 111, 555, 888, 222, 777, 0
Init
Cls 5
mov esi, offset unsorted
.While 1
lodsw
.Break .if !ax
movzx eax, ax
push eax
invoke CreateThread, 0, 0, offset PrintSleep, eax, 0, esp
pop ecx
.Endw
MsgBox 0, "SleepSort is fun", "Hi", MB_OK
EndOfCode