Reference no: EM132485068
Assignment Questions -
Q1. Write an LMC program that accepts two values as input and produces the absolute value of the difference as output.
You are required to use symbolic addressing as described in Lecture 4. Do not use any direct mailbox addressing.
Note: Write the pseudocode first to perform this task and then write the LMC code.
Q2. Write an LMC program that accepts three values as input and produces the largest of the three as output.
You are required to use symbolic addressing as described in Lecture 4. Do not use any direct mailbox addressing.
Note: Write the pseudocode first to perform this task and then write the LMC code.
Q3 Write an LMC program that accepts an indefinite number of input values. The output value will be the largest of the input values. You should use the value 0 as a flag to indicate the end of the input.
You are required to use symbolic addressing as described in Lecture 4. Do not use any direct mailbox addressing.
Note: Write the pseudocode first to perform this task and then write the LMC code.
Q4. Write an LMC program that outputs the sum of n number of input values.
You are required to use symbolic addressing as described in Lecture 4. Do not use any direct mailbox addressing.
Note: Write the pseudocode first to perform this task and then write the LMC code.
Q5. For your LMC assembly language source codes written for Q1- Q4, write the final machine code for each of these source codes using the following steps of the LMC two pass assembler:
1. Draw the Symbol Table.
2. Write the partial LMC machine code after the first pass.
3. Write the final LMC machine code after the second pass.