Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the program below to input a single one digit integer and output twice than value. The input will be one ASCII character representing a

Modify the program below to input a single one digit integer and output twice than value. The input will be one ASCII character representing a one-digit unsigned integer in base 8.

image text in transcribed

Figare 4.35 shows a program that adds two single-digit numbers and outputs their single-digit sum It illustrates the inconvenience of dealing with output at the machine level. Eigre 4.35 A machine language program to add 5 and 3 and output the single-character result. Machine Language (bin) 1100 0001 0000 0000 0001 0001 0111 0001 0000 0000 0001 0011 1010 0001 0000 0000 0001 0101 1111 0001 0000 0000 0001 0000 0101 0001 0000 0000 0001 0000 Address 0003 0006 0009 000F 0010 0011 0013 0015 0000 0000 0000 0101 0000 0000 0000 0011 0000 0000 0011 0000 Address Machine Language (hex) C10011 Afirst number 0003 0006 0009 710013 :Add the two numbers A10015 Convert sum to character F10010 :Store the character 10010:Output the character 000F 0010 0011 0013 0015 :Stop :Character to output 0005 Decimal 5 0003 Dec1mal 3 0030 Mask for ASCII char Output The two numbers to be added are 5 and 3. The program stores them at Mem[0011 and Mem[0013]. The first instruction loads the 5 into the accumiator, and then the second instruction adds the 3. At this point the sum is in the accumikator. Figare 4.35 shows a program that adds two single-digit numbers and outputs their single-digit sum It illustrates the inconvenience of dealing with output at the machine level. Eigre 4.35 A machine language program to add 5 and 3 and output the single-character result. Machine Language (bin) 1100 0001 0000 0000 0001 0001 0111 0001 0000 0000 0001 0011 1010 0001 0000 0000 0001 0101 1111 0001 0000 0000 0001 0000 0101 0001 0000 0000 0001 0000 Address 0003 0006 0009 000F 0010 0011 0013 0015 0000 0000 0000 0101 0000 0000 0000 0011 0000 0000 0011 0000 Address Machine Language (hex) C10011 Afirst number 0003 0006 0009 710013 :Add the two numbers A10015 Convert sum to character F10010 :Store the character 10010:Output the character 000F 0010 0011 0013 0015 :Stop :Character to output 0005 Decimal 5 0003 Dec1mal 3 0030 Mask for ASCII char Output The two numbers to be added are 5 and 3. The program stores them at Mem[0011 and Mem[0013]. The first instruction loads the 5 into the accumiator, and then the second instruction adds the 3. At this point the sum is in the accumikator

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

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions