2) Write and run an Assembly language program that converts a packed 4 digit BCD number
that has been stored in two consecutive byte locations in the memory, into an equivalent
binary number. The output should be stored in DX register. For example, if two consecutive
byte locations have BCD values (12)h and (34)n then output will be binary equivalent of
(1234)10 which is (0000 0100 1101 0010)2. This binary value will be stored in DX register.
Answers
Answered by
0
Answer:
Let’s identify variables needed for this program.
First variables will be the one which will hold the value present in the variable BCD to be converted and TEMP will hold the converted Hexadecimal equivalent and then to print its Binary form on Console (Screen) and Other variable RES will be holding the Resultant Binary equivalent printable form to be printed for the User on Screen, So in all Three variables.
The identified variables are BCD, TEMP and RES.
First Line – DATA SEGMENT
DATA SEGMENT is the starting point of the Data Segment in a Program and DATA is the name given to this segment and SEGMENT is the keyword for defining Segments, Where we can declare our variables.
Similar questions