Computers and Technology

Sum = 0;

for X = 1 to 10 do

Sum = Sum + X;

The following code is meant to perform the above function in assembly. Please fix so that it it executable.

ORG 100

Load One /Load constant

Store X /Initialize loop control variable X

Loop, Load X /Load X

Subt Ten /Compare X to 10

SkipCond 000 /If AC<0 (X is less than 10), continue loop

Jump Endloop /If X is not less than 10, terminate loop

Load Sum

Add X /Add X to Sum

Store Sum /Store result in Sum

Load X

Add One /Increment X

Store X

Jump Loop

Endloop, Load Sum

Output /Print Sum

Halt /terminate program

Sum, Dec 0

X, Dec 0 /Storage for X

One, Dec 1 /The constant value 1

Ten, Dec 10 /The loop constant

END

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, crimhill
When is it appropriate to use an absolute reference
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, ksanchez2100
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
image
Computers and Technology, 23.06.2019 06:00, sebcbal
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
image
Computers and Technology, 23.06.2019 20:30, cristalcastro901
If an appliance consumes 500 w of power and is left on for 5 hours, how much energy is used over this time period? a. 2.5 kwh b. 25 kwh c. 250 kwh d. 2500 kwh
Answers: 1
Do you know the correct answer?
Sum = 0;

for X = 1 to 10 do

Sum = Sum + X;

The following code...

Questions in other subjects:

Konu
Spanish, 04.12.2021 22:40
Konu
Mathematics, 04.12.2021 22:40