Question: The small program described here is known as a program loader, or , under certain circumstances as a bootstrap. This program takes advantage that instructions
The small program described here is known as a program loader, or under certain circumstances as a bootstrap. This
program takes advantage that instructions and data are indistinguishable. Thus, instructions could be treated as if they
were data, if necessary.
Mailbox Mnemonic Opcode Comment
LDA initialize the STORE instruction at loc.
STO storing the contents of mailbox that is
INP input a value
SUB subtract
BRZ done loadingjump to for execution
ADD restore input value
DAT store value. This will contain XX with XX indexed
LDA load the STORE instruction in
ADD increment it
STO and resave it
BRA continue with the next input
DAT value for testing
DAT initial STORE instruction as a data value
DAT value for indexing
II What you need to do
Load the above program loader in the LMC to understand what the program is doing. The instructions
should be loaded in your LMC at the mailboxes indicated above to work properly. Ensure that in mailbox
you have the instruction to branch to mailbox first instruction of the program loader
Run the program loader and input the instructions of the following user program:
Input three numbers, output the sum of the first two, and output the third minus the first
INP
STA
INP
ADD
OUT
INP
SUB
OUT
HLT
DAT
Hint: Replace the mnemonics with the opcodes to input the instructions of this user program as numbers.
Move the program loader so that it starts at mailbox in the LMC Modify as required so it works
properly.
a You need to take in consideration the relative positioning of the mailboxes and branches and modify
as required so it works properly
b The original program loader loads the user program starting at mailbox you need to change this
to load the user program starting at mailbox
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
