Monday, May 28, 2018

8086 :Packed BCD to Binary

 

DATA SEGMENT
PACKEDBCD DB 52H
BINARY DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV AH,0
MOV AL,PACKEDBCD
CALL TOBINARY
MOV BINARY,AL
MOV AH,4CH
INT 21H
CODE ENDS
TOBINARY PROC NEAR
MOV BL,AL
AND AL,0F0H
AND BL,0FH
MOV CL,04H
ROL AL,CL
MOV CL,10
MUL CL
ADD AL,BL
RET
TOBINARY ENDP
END START
 

No comments:

Post a Comment

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows