OBJECTIVE To convert a given binary to BCD. Take a screenshot of your code and output.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter2: Problem Solving Using C++using
Section2.3: Data Types
Problem 4E: (Practice) Show how the name KINGSLEY is stored in a computer that uses the ASCII code by drawing a...
icon
Related questions
Question

BINARY TO BCD

 

OBJECTIVE
To convert a given binary to BCD.

Take a screenshot of your code and output.

Create the code for the algorithm below;
ALGORITHM:
 Step 1: Initialize the data to the data segment. 
 Step 2:  Move the input to AX register.
 Step 3: Move 64 to CL register
 Step 4: Divide AL, CL value
 Step 5: Increment memory by 1 and move AL value
 Step 6: Move AH value to AL
 Step 7: Move 0A to CL register
 Step 8: Divide the AL, CL
 Step 9:  Rotate CL register 4 times
 Step 10: Add AH, AL
 Step 11: Store the resultant in memory location.  
 

Sample OUTPUT
INPUT  :  01A9H        

OUTPUT  :  0425 

 

NOTE: SCREENSHOT THE OUTPUT

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr