Question: 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.

Modify the program below to input a single one digit integer and

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!