%include "rw32-2022.inc"

segment .data

    arr1 dt 1.6, -4.1, 1.1, -5.0

segment .text

;cdecl float * getSorted(const long double *pArr, unsigned int N)

getSorted:
    enter 0,0

fld tword [esi]
fstp dword [edi]

;for(unsigned int i = 0; i < N ; i++)
;  for(unsigned int j = i + 1; j < N; j++)
;    if (newArr[i] > newArr[j]) SWAP newArr[i],newArr[j]   
  
    leave
    ret
  
CMAIN:

    push 4
    push arr1
    call getSorted
    add esp,8

    mov esi,eax
    mov ecx,4
    call WriteArrayFloat
    ret