8086 ASSEMBLY PROGRAM TO FIND LCM AND GCD


CODE SEGMENT
ASSUME CS:CODE
START:
MOV SI,000
MOV AX,[SI]
MOV BX,[SI+2]
PUSH AX
PUSH BX
UP:
CMP AX,BX
JE EXIT
JB DOWN
SUB AX,BX
JMP DOWN2
DOWN:SUB BX,AX
DOWN2 :
JMP UP
EXIT:
MOV CX,AX
POP BX
POP AX
MUL BX
DIV CX
INT 3
CODE ENDS
END START
END

Comments

Post a Comment