Это то, что у меня до сих пор, когда он работает, он только переключает первый номер
INCLUDE irvine32.inc
max = 20
.data
arraySize BYTE "Please enter the size of the array:",0
arrayContent BYTE "Please enter the elements of the array: ",0
permutation BYTE "Please enter the permutation: ",0
permutatedArray BYTE "The array after permutation is:",0
array word max dup(?)
pArray word max dup(?)
theArraySize dword ?
temp word ?
.code
main PROC
call Readint
mov theArraySize, eax
mov eax, theArraySize
mov ecx,theArraySize
mov esi,0
L1:
call readInt
mov array[esi*2],ax
inc esi
loop L1
mov ecx,theArraySize
mov esi,0
L2:
call readInt
mov pArray[esi*2],ax
inc esi
loop L2
mov ecx, theArraySize
mov esi,0
L4:
push esi
mov ax, pArray[esi*2]
mov esi, eax
mov ax,array[esi*2]
pop esi
mov array[esi*2],ax
inc esi
loop L4
mov ecx, theArraySize
mov esi,0
L5:
mov ax,array[esi*2]
call WriteDec
call Crlf
inc esi
loop L5
exit
main ENDP
END main