IDEAL MODEL small STACK 100h DATASEG ; -------------------------- ; Your variables here ; -------------------------- array1 db 30,23,50,7,3 CODESEG start: mov ax, @data mov ds, ax mov bx, offset array1 ; read the first number mov ah, 1h int 21h sub al, '0' ;use si and di to hold the indexes of numbers to be switched xor ah,ah mov si,ax mov dl,[bx+si] ;dl is the value corresponding to the first index ; read the second number mov ah, 1h int 21h sub al, '0' xor ah,ah mov di,ax mov dh,[bx+di] ;dl is the value corresponding to the first index mov [bx+si],dh mov [bx+di],dl ; -------------------------- ; Your code here ; -------------------------- exit: mov ax, 4c00h int 21h END start