Question: An assembly language program contains the following two instructions. The assembler puts the translated version of the LDI instruction that follows into location 0 x
An assembly language program contains the following two instructions. The
assembler puts the translated version of the LDI instruction that follows into location
x After assembly is complete, what is the value of the hexadecimal number in
location x
PLACE FILL xA
LDI R PLACE
Create the symbol table entries generated by the assembler when translating the
following routine into machine code.
ORIG xC
ST R SAVE
ST R SAVE
AND R R #
TEST IN
BRz TEST
ADD R R #
BRn FINISH
ADD R R #
NOT R R
BRn FINISH
HALT
FINISH ADD R R #
HALT
SAVEFILL x
SAVEFILL x
END
Write an LC assembly language program that counts the number of s in the
value stored in R and stores the result into R For example, if R contains
which has six s then after the program executes the result
stored in R would be in other words,
Assemble and run the following LC assembly language program. What does this
program do This is asking for a highlevel summary, not a breakdown of individual
instructions!
ORIG x
LD R ZERO
LD R M
LD R M
LOOP BRz DONE
ADD R R R
ADD R R #
BR LOOP
DONE ST R RESULT
HALT
RESULT FILL x
ZERO FILL x
MFILL x
MFILL x
END
What value will be contained in RESULT after the program runs to completion?
Assemble and run the following LC assembly language program. What does this
program do This is asking for a highlevel summary, not a breakdown of individual
instructions!
ORIG x
AND R R #
AND R R #
ADD R R #
LDI R A
ADD R R #
AG ADD R R R
ADD R R #
BRnp AG
LD R B
AND R R R
NOT R R
ADD R R #
ADD R R R
BRnp NO
ADD R R #
NO HALT
B FILL xFF
A FILL x
END
The following is an LC program that performs a function. Assume a sequence of
integers is stored in consecutive memory locations, one integer per memory location,
starting at the location x The sequence terminates with the value x
What does the following program do This is asking for a highlevel summary, not a
breakdown of individual instructions!
ORIG x
LD R NUMBERS
LD R MASK
LOOP LDR R R #
BRz DONE
AND R R R
BRz L
BRnzp NEXT
L ADD R R R
STR R R #
NEXT ADD R R #
BRnzp LOOP
DONE HALT
NUMBERS FILL x
MASK FILL x
END
Assume a sequence of nonnegative integers is stored in consecutive memory
locations, one integer per memory location, starting at location x Each integer
has a value between and decimal The sequence terminates with the value
iexFFFF Assemble and run the following LC assembly language program.
What does the program do This is asking for a highlevel summary, not a breakdown
of individual instructions!
ORIG x
AND R R #
AND R R #
LD R NUMBERS
LOOP LDR R R #
NOT R R
BRz DONE
AND R R #
BRz L
ADD R R #
BRnzp NEXT
L ADD R R #
NEXT ADD R R #
BRnzp LOOP
DONE TRAP x
NUMBERS FILL x
END
Assemble and run the following LC assembly language program. What does the
program do in no more than words This is asking for a highlevel summary, not
a breakdown of individual instructions!
ORIG x
AND R R #
ADD R R #
LD R MASK
LD R PTR
LOOP LDR R R #
AND R R R
BRz NEXT
ADD R R #
NEXT ADD R R #
ADD R R #
BRp LOOP
STI R PTR
HALT
MASK FILL x
PTRFILL x
PTRFILL x
END
What is the purpose of the END pseudoop How does it differ from the HALT
instruction?
Write the machine language version of the following LC Assembly language
program:
ORIG x
LEA R DATA
LDR R R #
LOOP ADD R R #
BRzp LOOP
TRAP x
DATA FILL xB
END
The following program fragment generates an error when you try to assemble it
Identify the error and rewrite this fragment so that it doesnt have the bug but still
does the same thing.
ADD R R #
ST R A
HALT
A FILL #
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
