DATAS SEGMENT
SHIF DD 12345678H
DATAS ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATAS
START:
MOV AX,DATAS
MOV DS,AX
MOV DX,WORD PTR [SHIF+2]
MOV AX,WORD PTR [SHIF]
MOV CL,4
SHL DX,CL
MOV BL,AH
SHL AX,CL
SHR BL,CL
OR DL,BL
MOV BL,DH
PUSH AX
PUSH DX
MOV DL,BL
SHR DL,CL
CMP DL,9
JL L1
ADD DL,7H
L1:ADD DL,30H
MOV AH,2
INT 21H
AND DL,0FH
JL L2
L2:ADD DL,30H
POP DX
POP AX
MOV BL,DL
JL L3
L3:ADD DL,30H
JL L4
L4:ADD DL,30H
JL L5
L5:ADD DL,30H
JL L6
L6:ADD DL,30H
MOV BL,AL
MOV DL,AL
JL L7
L7:ADD DL,30H
JL L8
L8:ADD DL,30H
MOV AH,4CH
CODE ENDS
END START
DATAS SEGMENT
SHIF DD 12345678H
DATAS ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATAS
START:
MOV AX,DATAS
MOV DS,AX
MOV DX,WORD PTR [SHIF+2]
MOV AX,WORD PTR [SHIF]
MOV CL,4
SHL DX,CL
MOV BL,AH
SHL AX,CL
SHR BL,CL
OR DL,BL
MOV BL,DH
PUSH AX
PUSH DX
MOV DL,BL
MOV CL,4
SHR DL,CL
CMP DL,9
JL L1
ADD DL,7H
L1:ADD DL,30H
MOV AH,2
INT 21H
MOV DL,BL
AND DL,0FH
CMP DL,9
JL L2
ADD DL,7H
L2:ADD DL,30H
INT 21H
POP DX
POP AX
MOV BL,DL
PUSH AX
MOV CL,4
MOV BL,DL
SHR DL,CL
CMP DL,9
JL L3
ADD DL,7H
L3:ADD DL,30H
MOV AH,2
INT 21H
MOV DL,BL
AND DL,0FH
CMP DL,9
JL L4
ADD DL,7H
L4:ADD DL,30H
INT 21H
POP AX
MOV BL,AH
PUSH AX
MOV CL,4
MOV DL,BL
SHR DL,CL
CMP DL,9
JL L5
ADD DL,7H
L5:ADD DL,30H
MOV AH,2
INT 21H
MOV DL,BL
AND DL,0FH
CMP DL,9
JL L6
ADD DL,7H
L6:ADD DL,30H
MOV AH,2
INT 21H
POP AX
MOV BL,AL
MOV DL,AL
MOV CL,4
SHR DL,CL
CMP DL,9
JL L7
ADD DL,7H
L7:ADD DL,30H
MOV AH,2
INT 21H
MOV DL,BL
AND DL,0FH
CMP DL,9
JL L8
ADD DL,7H
L8:ADD DL,30H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START