2021-06-29

assembly language program to enter and sort numbers [closed]

i'm writing assembly language program that allows a user to enter 6 numbers in any order then display the largest and smallest entered number, and the order from small to large and then large to small. I've included the initial code I wrote

START: 
mov ax,data
mov ds,ax
mov BX,LEN-1
MOV CX,BX
UP1: MOV BX,CX
LEA SI,X
UP: MOV AX,[SI]
MOV DX,[SI+2]
CMP AX,DX
JB DOWN/JA DOWN
MOV [SI],DX
MOV [SI+2],AX
DOWN: INC SI
INC SI
DEC BX
JNZ UP
DEC CX
JNZ UP1
MOV AH,4CH
INT 21H
CODE ENDS
END START


from Recent Questions - Stack Overflow https://ift.tt/3hd4P6I
https://ift.tt/eA8V8J

No comments:

Post a Comment