SECTION 6-5 Program Loops TABLE 6-13 Symbolic Program to Add 100 Numbers Line OR
ID: 3587519 • Letter: S
Question
SECTION 6-5 Program Loops TABLE 6-13 Symbolic Program to Add 100 Numbers Line ORG 100 Origin of program is HEX 100 LDA ADS Load first address of operands STA PTR Store in pointer LDA NBR /Load minus 100 STA CTR Store in counter /Clear accumulator 7 LOP, ADD PTRI Add an operand to AC 10 12 14 PTR, HEX ISZ PTR ISZ CTR BUN LOP STA SUM HLT Increment pointer Increment counter /Repeat loop again Store sum Halt /This location reserved for a pointer This location reserved for a counter 13 ADS, HEX 150 First address of operands 15 NBR DEC -100 Constant to initialized counter 16 CTR, HEX 17 SUM, HEX 0 18 19 Sum is stored here ORG 150 Origin of operands is HEX 150 DEC 75 First operand 118 119 DEC 23 END Last operand End of symbolic program 2 through 5 and the constants in lines 13 through 16. The address operand (150) is stored in location ADS in line 13. The number of Fortran statement number 3 must be executed is 100. So-100 is sto ion NBR. The compiler then generates the instructions in lines 2 th nitialize the program loop. The address of the first operand is tranExplanation / Answer
Here there is a single function main.
ORG 100 indicates that the execution of the program will start from the location 100.
There are various variables specified here:
Now coming to the execution of the program:
In short, this program performs the addition of 100 numbers that are stored starting from location 150. Here, it is shown from line 19 to 118.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.