Which one of the following LC-3 instruction sequences will be generated when converting statement "*e b" to LC-3 assembly language instructions? ADD RO, rL, #B LDR R1, RO, rL, #E STR R1, #0 O LDR RO, rL, #B LDR R1, RO, # 0 STR R1, rL, #E LDR RO, rL, #B LDR R1, rL, #E STR RO, R1, # 0

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Which one of the following LC-3 instruction sequences will be generated when converting statement "*e = b" to LC-3 assembly language
instructions?
ADD
RO,
rL,
#B
LDR
R1,
rL.
#E
STR
RO,
R1,
#0
LDR
RO,
rL,
#B
LDR
R1,
RO,
# 0
STR
R1,
rL,
#E
O LDR
RO,
rL,
#B
LDR
R1,
rL,
#E
STR
RO,
R1.
# 0
LDR
RO,
rL,
#B
STR
RO,
rL,
#E
O LDR
RO,
rL,
#B
LDR
R1,
RO,
# 0
LDR
R2,
rL,
#E
STR
R1,
R2,
# 0
Which one of the following LC-3 instruction sequences will be generated when converting condition " (a < c)" of the "while" statement to LC-3
assembly language instructions? Label "PRINT" should be regarded as the label of the printf statement.
Oa.
LDR
RO,
rL,
#C
NOT
RO,
RO
ADD
RO,
RO,
# 1
LDR
R1,
rL,
#A
ADD
RO,
RO,
R1
BRnz
PRINT
O b. LDR
RO,
rG,
#A
NOT
RO.
RO
LDR
R1,
rG,
#C
ADD
RO,
RO,
R1
BRnz
PRINT
O c. LDR
R1,
rL,
#A
NOT
R1.
R1
ADD
R1,
R1,
# 1
LDR
R2,
rL,
#C
ADD
R1,
R1,
R2
BRzp
PRINT
o d. LDR
RO,
rL,
#A
NOT
RO,
RO
ADD
RO,
RO,
#1
LDR
R1,
rL,
#C
ADD
RO,
RO,
R1
BRnz
PRINT
Oe.
LDR
R1,
rL,
#A
NOT
R1.
R1
LDR
R2,
rL,
R1,
#C
ADD
R1,
R2
BRnz
PRINT
Transcribed Image Text:Which one of the following LC-3 instruction sequences will be generated when converting statement "*e = b" to LC-3 assembly language instructions? ADD RO, rL, #B LDR R1, rL. #E STR RO, R1, #0 LDR RO, rL, #B LDR R1, RO, # 0 STR R1, rL, #E O LDR RO, rL, #B LDR R1, rL, #E STR RO, R1. # 0 LDR RO, rL, #B STR RO, rL, #E O LDR RO, rL, #B LDR R1, RO, # 0 LDR R2, rL, #E STR R1, R2, # 0 Which one of the following LC-3 instruction sequences will be generated when converting condition " (a < c)" of the "while" statement to LC-3 assembly language instructions? Label "PRINT" should be regarded as the label of the printf statement. Oa. LDR RO, rL, #C NOT RO, RO ADD RO, RO, # 1 LDR R1, rL, #A ADD RO, RO, R1 BRnz PRINT O b. LDR RO, rG, #A NOT RO. RO LDR R1, rG, #C ADD RO, RO, R1 BRnz PRINT O c. LDR R1, rL, #A NOT R1. R1 ADD R1, R1, # 1 LDR R2, rL, #C ADD R1, R1, R2 BRzp PRINT o d. LDR RO, rL, #A NOT RO, RO ADD RO, RO, #1 LDR R1, rL, #C ADD RO, RO, R1 BRnz PRINT Oe. LDR R1, rL, #A NOT R1. R1 LDR R2, rL, R1, #C ADD R1, R2 BRnz PRINT
Read the program and the descriptions below before answering the next SEVEN questions.
#include <stdio.h>
int w = 1, x = 1;
int main()
{
int a = 0, b = 0, c = 5;
int* d = &W;
int* e = &X;
while (a < c)
{
b = *d + *e;
*d = *e;
*e = b;
a++;
}
printf("w = %d, x = %d\n", w, x);
Assume that (i) rG represents the register pointing to the beginning of the locations where the global variables are stored, (ii) rL denotes the register
that records the start of the locations where the local variables are stored, and (iii) the offsets of the variables in the program above are given in the
table below. In the table, each capital letter represents an integer.
Variable
Offset
A
b
B
d.
e
E
W
X
Transcribed Image Text:Read the program and the descriptions below before answering the next SEVEN questions. #include <stdio.h> int w = 1, x = 1; int main() { int a = 0, b = 0, c = 5; int* d = &W; int* e = &X; while (a < c) { b = *d + *e; *d = *e; *e = b; a++; } printf("w = %d, x = %d\n", w, x); Assume that (i) rG represents the register pointing to the beginning of the locations where the global variables are stored, (ii) rL denotes the register that records the start of the locations where the local variables are stored, and (iii) the offsets of the variables in the program above are given in the table below. In the table, each capital letter represents an integer. Variable Offset A b B d. e E W X
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY