Example: Suppose the file example .mal contains the following MAL program. EA sa
ID: 3776779 • Letter: E
Question
Example: Suppose the file example .mal contains the following MAL program. EA sample MAL program. data Data segment begins here. Will store the average. il 20 First integer. 12 13 t Second integer. 13 word Third integer. .asci iz "Val is: prompt: Text segment begins here. $15, il $15 contains 20. $16,12 16 tains 13 $15, $15, $16 #Operand field has no identifiers. $16,13 $16 contains B2. $15, $15, $16 $15 contains the sum (115). $16,3 a$16 contains 3. $15, $15, $16 $15 contains the average (38). $15, avg 4Store the average. prompt avg $15 avg $16,il $15,0 ($16) 13, 13, 1 asimilar to halt After we execute your program using the command line prog4 -b example nal output. lat the contents of the output file output.lst should be as shown on page 4 of this handout. In studying the output file, you should keep the following in mind. 1. The line numbers start at 1. 2. Blank lines in the input file are echoed to the output file; however, they are not numbered. 3. For each identifier, the line numbers where it is used are in increasing order. 4. When an identifier is used several times in a source line (e.g. the identifier i 3 appears twice in line 24), the line number appears only once in the list.Explanation / Answer
#include <stdio.h>
int theArray[40];
int main() {
int t0, t1, t2, t3, t4, t5, t6, t7; /* Our "registers" */
t6 = 1;
t7 = 1;
theArray[0] = t6; /* Storing the first two terms of the */
theArray[t7] = t6; /* sequence into our array */
t0 = 2;
LLoop:
t3 = t0 - 2;
t4 = t0 - 1;
t1 = theArray[t3];
t2 = theArray[t4];
t5 = t1 + t2;
theArray[t0] = t5;
t0 = t0 + 1;
if (t0 < 40) goto LLoop;
return 0;
}
you forgot to attach example
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.