TO FIND THE GCD/HCF OF TWO NUMBERS

.model small
.stack 64
.data
.code
start:     MOV AX,@DATA
MOV DS,AX
MOV AX,90
MOV BX,120
next:     CMP AX,BX
JE last
CMP AX,BX
JG next1
XCHG AX,BX
next1:   MOV DX,0
DIV BX
CMP DX,0
JE last
MOV AX,DX
JMP next
last:       MOV AX,BX
END start
.end