0% found this document useful (0 votes)
14 views3 pages

Adobe Scan 03-Jun-2022

Bbnmmvggnnmm njjhg

Uploaded by

R. Kiruba Sri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Adobe Scan 03-Jun-2022

Bbnmmvggnnmm njjhg

Uploaded by

R. Kiruba Sri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DATE c 8

PROGRAMS ON CODE CONVERSION

AIM: To write an oU80


assembly language program for conversion of BCD to Hexa Decimal
and Hexa decimal to BCD
APPARATUS: -
Personal Computer
MASM

cONVERSION OF BCD TO HEXA DECIMAL


PROGRAM:
PROGRAM COMMENTS
code segment
assumecs:code,ds:.code
org 1000h

MOV DL,98H
MOV ALDL
|D moved a3H
AND AL0FOH DL movea AL
MOV CL,01
ROL ALCL PND OFOH)4L
ROL ALCL moe a d CL
ROL ALCL
ROL ALCL CL mOved ALROL
MOV CL,0AH Pototiornct, AL
MUL CL
MOV BL,DL RotationLeFl cL, F
AND BL,0FH
ADD AL,BL mived oAH,
MOV SI,1200H mutlt licatlon q tounl rlue
MOV [SI),AL

ed B
D
DL mov

mov ah,4ch N BAL


int 21h
maved l200H arndSI
code ends
A movaMuo ind
end
EC6513 MICROPROCESSOR AND MICROCONTROLLER LABORATORY

input: Output:-

b BE
262>
31>0
2
2 15> 611 o 3E
2
3

cONVERSION OF ASCII TO BCD

PROGRAM:

PROGRAM COMMENTS

code segment
assume cs:code,ds:code
org 1000h
in u o s g i t
XOR BX,BX
xo2 qet Ba
totuntvaluo
2
xOR CX,CX xo2 Cx i h
nmoved HL
MOV AL,62H 62 H
HU: CMP AL,64H HL
JC TE co pUTo OAH
ON
SUB AL,64H umaN
INC BX
JMP HU
Su OAH A
TE: CMP AL 0AH I n C e m m e n t CH
JC UN
SUB AL,0AH SumP frAsiky CE
INC CH
JMP TE AL moNed BL
UN: MOV BL,AL
MOV AL,CH
MOV CL,1 CH mn ed AL
ROLAL,CL CL
ROL AL,CL oL mON E
ROL AL,CL

ODD 2018
MICROPROCES5OR AND MICROCONROLLERLABORATORY
AND Mle

ROCONTROLLERLABORATORY
ECS13
ROL ALCl.
ADD AL,BL Polal OF C AL
MOV SI,1200H
MOV (SI].AL
MOV SI,1201H 12cOH mnd Sj
MOV (SIJ.BX
moved SJ
mov ah,4ch
int 21h 2olmoNed. S
code ends
end
B mov SI

OBSERVATION

Input: Output:-

2 38

O2
2

623-o
Ox24-0

2 32
Ox 2

38

Hercdocamad
Result to
Bc D
a
Cde Connesusion

u i h mASM 86
Thu maSM86
petormud
and
na HesciCra to Bc?

You might also like