DATA SEGMENT
A DB 04
B DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV AX,00
MOV AL,A
MOV CL,02
DIV CL
MOV B,AL
MOV AH,00
MOV CL,00
L1:INC CL
MOV AX,0000
MOV AL,A
DIV CL
CMP AH,00
JNZ L2
INC CH
L2:CMP CL,B
JNE L1
CMP CH,01
JNE L3
MOV DH,A
MOV DL,00
JMP L4
L3:MOV DL,A
MOV DH,00
L4:MOV AH,4CH
INT 21H
CODE ENDS
END START
;OUTPUT:->
;-G CS: 0041
;
;AX=0002 BX=0000 CX=0202 DX=0004 SP=0000 BP=0000 SI=0000 DI=0000
;DS=0BA8 ES=0B98 SS=0BA8 CS=0BA9 IP=0041 NV UP EI PL NZ NA PO NC
;0BA9:0041 B44C MOV AH,4C