Problem – Write a program to convert ASCII to BCD 8-bit number where starting address is 2000 and the number is stored at 2050 memory address and store result into 3050 memory address.
Example-
Input : location: 2050
Data : 37
Output : location: 3050
Data : 07
Algorithm –
- Move value at [2050] into AL
- Perform AND operation on AL with 0F
- Move content of accumulator AL into 3050
- Stop
Program –
Memory |
Mnemonics |
Operands |
Comment |
2000 |
MOV |
AL, [2050] |
[AL] <- [2050] |
2004 |
AND |
AL, 0F |
[AL] <- ([ AL] AND 0F ) |
2006 |
MOV |
[3050], AL |
[3050] <- [AL] |
200A |
HLT |
|
Stop |
Explanation – Registers AL is used for general purpose
- MOV is used to transfer the data
- AND is used for multiplication (logically)
- HLT is used to halt the program
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
10 Sep, 2018
Like Article
Save Article