Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .MODEL SMALL
- .STACK 100H
- .DATA
- A DW 18
- B DW 14 ;USER INPUT DILE DECIMAL INPUT ER CODE USE KORBI
- .CODE
- MAIN PROC
- MOV AX,@DATA
- MOV DS,AX
- MOV CX,B ;CX E CHOTO SONKHA, THEN 1 KORE DEC KORE CHECK
- HCF:
- MOV AX,A
- XOR DX,DX
- DIV CX
- CMP DX,0
- JNE JMPHCF
- MOV AX,B
- XOR DX,DX
- DIV CX
- CMP DX,0
- JNE JMPHCF
- JMP PRINTHCF
- JMPHCF: ;GCD (GREATEST COMMON DIVISOR) / HCF (HIGHEST COMMON FACTOR) SAME
- DEC CX ;HIGHEST JEI NUMBER DIA DUITAREI VAG JAY
- CMP CX,1
- JE PRINTHCF
- JMP HCF
- PRINTHCF:
- MOV AH,2 ;DECIMAL OUTPUT DITE BOLLE DECIMAL OUTPUT ER CODE USE KORBI
- MOV DX,CX
- INT 21H
- MOV CX,A
- LCM:
- MOV BX,A
- MOV AX,CX
- XOR DX,DX
- DIV BX
- CMP DX,0
- JNE JMPLCM
- MOV BX,B
- MOV AX,CX
- XOR DX,DX
- DIV BX
- CMP DX,0
- JNE JMPLCM
- JMP PRINTLCM
- JMPLCM: ;LCM (LEAST COMMON MULTIPLE)
- INC CX ;SOBCHEYE CHOTO JEI NUMBER RE A,B DUITA NUMBER DIA E VAG JAY
- JMP LCM
- PRINTLCM:
- MOV AH,2
- MOV DX,CX
- INT 21H
- EXIT:
- MOV AH,4CH
- INT 21H
- ENDP MAIN
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement