Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an assembly program to read three 32-bit signed integers from the user.? A BCD number is meant to conveniently represent decimal numbers in a

Write an assembly program to read three 32-bit signed integers from the user.?

A BCD number is meant to conveniently represent decimal numbers in a way that is easier for humans to interpret. Each 4-bit number represents a unique decimal digit. For example:

8 7 6 2 in BCD would be represented at 1000 0111 0110 0010

However, the underlying binary bit pattern (1000011101100010) is actually 34,658 in decimal.

Write an assembly program to read a four character BCD number from the user. This will be read in as a standard integer. However, you are to convert this number to its BCD equivalent, and print out this decimal number. You can assume that the input is always 4 characters and is legal (i.e. only the digits from 0-9 will appear).

Heres an example:

User types in 8762. This is stored in the computer as 100010001110102

We need to convert it to the representation 1000 0111 0110 0010, which is BCD for 8762 (Notice the first 4 bits has an 8, the next 4 bits has a 7, and so on)

Print out that BCD value (10000111011000102) as a decimal: 34658 (Your syscall print_int does this anyway).

**OUTPUT SHOULD READ**

BCD: 8762 Binary: 34658 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions