Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer should be like this Address 100 101 102 Contents Value of a Value of b Value ofc Algorithmic notation Machine Language Instruction Sequences Address

image text in transcribedanswer should be like this image text in transcribed

Address 100 101 102 Contents Value of a Value of b Value ofc Algorithmic notation Machine Language Instruction Sequences Address Contents (Commentary) Put the value of b into register R. Add c to register R. 1. Set a to the value b+c 50 51 52 LOAD 101 ADD 102 STORE 100 It now holds bc. Store the contents of register R into a. Compare a and b 2. If a>b then 50 COMPARE 100, 101and set condition codes. Go to location 54 If a > b Get here if as b, set c to the valuea JUMPGT 54 MOVE 101, 102 JUMP 55 MOVE 100, 102 51 Else so move b into c and skip the next instruction. set c to the valueb 53 54 Move a into c. Next statement begins here 3, 56%) Assume that (i) the variables a, b, and c are stored in memory locations 100, 101, and 102, respectively, (ii) the five integer values +4, 1, 0, +12, and +1 are stored in memory locations 300, 301, 302, 303, and 304, respectively. and (iii) the code sequence you are writing begins in memory location 40. Using any of the machine language instructions shown in Section 5.2.4 of the Textbook, translate the following algo- rithmic operations into machine language code. Do not give binary but rather use the style of instruction presentation shown in Figure 5 page 255 of the Textbook Set c to the value of-1 for 4 to 12 do if a > 0 then Set c to the value of c-a else Set a to the value of b Set c to the value of c +1 Address 100 101 102 Contents Value of a Value of b Value ofc Algorithmic notation Machine Language Instruction Sequences Address Contents (Commentary) Put the value of b into register R. Add c to register R. 1. Set a to the value b+c 50 51 52 LOAD 101 ADD 102 STORE 100 It now holds bc. Store the contents of register R into a. Compare a and b 2. If a>b then 50 COMPARE 100, 101and set condition codes. Go to location 54 If a > b Get here if as b, set c to the valuea JUMPGT 54 MOVE 101, 102 JUMP 55 MOVE 100, 102 51 Else so move b into c and skip the next instruction. set c to the valueb 53 54 Move a into c. Next statement begins here 3, 56%) Assume that (i) the variables a, b, and c are stored in memory locations 100, 101, and 102, respectively, (ii) the five integer values +4, 1, 0, +12, and +1 are stored in memory locations 300, 301, 302, 303, and 304, respectively. and (iii) the code sequence you are writing begins in memory location 40. Using any of the machine language instructions shown in Section 5.2.4 of the Textbook, translate the following algo- rithmic operations into machine language code. Do not give binary but rather use the style of instruction presentation shown in Figure 5 page 255 of the Textbook Set c to the value of-1 for 4 to 12 do if a > 0 then Set c to the value of c-a else Set a to the value of b Set c to the value of c +1

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

Students also viewed these Databases questions

Question

1. EF CECEUF.

Answered: 1 week ago