4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
COMPSCI 2208B 001 FW20
Online Tests, Quizzes & Assignments
Online Tests, Quizzes & Assignments
2nd midterm test - MAKEUP
Return to Assessment List
Part 1 of 12 -
0.5/ 0.5 Points
Question 1 of 12
Hold up to the camera your single EMPTY page scrap paper (letter size 8.5” x 11”).
Show both sides of your EMPTY scrap paper.
0.5/ 0.5 Points
Did you show the EMPTY scrap paper?
A. Yes
B. No
Answer Key: A
Part 2 of 12 -
4.0/ 4.0 Points
Question 2 of 12
Consider the following program,
AREA my_First_Example, CODE, READONLY
4.0/ 4.0 Points
ENTRY
NOP
NOP
NOP
NOP
p
B
p
ppp
SPACE 3
qqq
DCB
0xFF
rrr
DCD
0xFF
sss
SPACE 3
END
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
1/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
What will be the addresses (in hexadecimal) of ppp, qqq rrr and sss?
the address of memory location ppp = 0x 14 ,
the address of memory location qqq = 0x 17 ,
the address of memory location rrr = 0x 18 , and
the address of memory location sss = 0x 1C .
Answer Key: 14|00000014, 17|00000017, 18|00000018, 1C|0000001C
Part 3 of 12 -
1.0/ 1.0 Points
Question 3 of 12
“LDR R1, =0x12345678” is an ARM assembly pseudo instruction at location 0x00000034.
1.0/ 1.0 Points
The assembler stored the literal value “0x12345678” at the literal pool and converted the instruction to “LDR
R1,[PC,#0x0028]”.
What is the address (in hexadecimal) used to store the value “0x12345678”?
0x 64
Answer Key: 64|00000064
Part 4 of 12 -
5.0/ 5.0 Points
Question 4 of 12
5.0/ 5.0 Points
After executing the following ARM instructions
LDR r0,=0xFEDCBA98
NEGS r1,r0
What will be the values of the NZC flags, as well as the values of r0 and r1 (in hexadecimal)?
N = 0 ,
Z = 0 ,
C = 0 ,
r0 = 0x FEDCBA98 , and
r1 = 0x 1234568 .
Answer Key: 0, 0, 0, FEDCBA98, 1234568|01234568
Part 5 of 12 -
4.0/ 4.0 Points
Question 5 of 12
4.0/ 4.0 Points
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
2/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
After executing the following ARM instructions
LDR
r0,=0xCB
ADDS r1,r0,r0,ROR#14
What will be the values of the NZC flags, as well as the values of r1 (in hexadecimal)?
N =
0 ,
Z =
0 ,
C =
0 ,
and
r1 = 0x
032C00CB .
Answer Key: 0, 0, 0, 32C00CB|032C00CB
Part 6 of 12 -
3.0/ 3.0 Points
Question 6 of 12
3.0/ 3.0 Points
Consider the following ARM assembly program
AREA prog, CODE, READONLY
for
MOV
R0, #0xFFFFFFF9
MOV
R1, #0xFFFFFFF8
ADD
R0, R0, R1
SUBS R1, R1, #-2
BLE
halt B
for
halt
END
What is the value of R0 and R1 after executing the above program (until reaching the “B halt” instruction)?
R0 = 0x FFFFFFE5 , and
R1 = 0x 2 .
How many times is the "ADD R0, R0, R1" instruction executed? 5
Answer Key: FFFFFFE5, 2|00000002, 5
Part 7 of 12 -
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
2.0/ 2.0 Points
3/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
Question 7 of 12
Encode ONLY the branching ARM assembly instruction in the following program segment.
2.0/ 2.0 Points
Write your answer as eight hexadecimal digits, each digit in a box. Do NOT write "0x" in front of each
hexadecimal digit. Just write each hexadecimal digit alone.
NOP
A
NOP
B
NOP
C
NOP
BLS
D
NOP
E
NOP
F
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
4/8
4/20/2021
F
NOP
G
NOP
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
NOP
9 A 0 0 0 0 0 1
Answer Key: 9, A, 0, 0, 0, 0, 0, 1
Part 8 of 12 -
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
1.0/ 2.0 Points
5/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
Question 8 of 12
Decode the following ARM machine language code to ARM assembly instruction.
1.0/ 2.0 Points
0x1029873A
Write your answer (i.e., the instruction) in TWO parts, the Op-Code in a box and ALL operands in another
box.
The Op-Code is: EOR
The operands are: r8,r9,r10,LSR r7 .
Answer Key: EORNE, r8,r9,r10,LSR r7
Part 9 of 12 -
2.0/ 2.0 Points
Question 9 of 12
Encode ONLY the literal part in "ADC r0,r1,#0x33800" ARM assembly instruction, i.e., give
2.0/ 2.0 Points
ONLY the value of the alignment and the 8-bit immediate value. Give your answer in hexadecimal.
The 4-bit alignment value in a single hexadecimal digit is 0x
B .
The 8-bit immediate value in two hexadecimal digits is 0x
CE .
Answer Key: B, CE
Part 10 of 12 -
1.0/ 2.0 Points
Question 10 of 12
Assume that r1 is a pointer to an integer array, where each array element is 32-bits. This array
1.0/ 2.0 Points
starts from r1[0]. Also, assume that register r2 is used as an index for this array. Write one ARM
instruction that stores the value in r0 into the element number r2 of this array, and to update the value of
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
6/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
r1 to make it a point to the value that is just stored, if and only if the negative flag is 1.
Write your answer (i.e., the instruction) in TWO parts, the Op-Code in a box and ALL operands in another
box.
The Op-Code is: STRMI
The operands are: r0,[r1,r2, LSL#2]
Answer Key: STRMI, r0,[r1,r2, LSL#2]!|r0,[r1,r2, LSL#0x2]!
Part 11 of 12 -
3.0/ 3.0 Points
Question 11 of 12
What are the values of r0, r2, and r3 (in hexadecimal) after executing the following
3.0/ 3.0 Points
program?
AREA prog, CODE, READWRITE
ENTRY
LDR
r0,=AAA1
LDR
r2,[r0],#4
LDR
r3,[r0,#4]!
Loop
B
Loop
AAA0
DCW
0x1020, 0x3040
AAA1
DCW
0x5060
AAA2
DCW
0x7080, 0x90A0, 0xB0C0, 0xD0E0, 0xF0FF
END
r0 = 0x
1C , r2 = 0x
50607080 , and r3 = 0x
D0E0F0FF .
Answer Key: 1C|0000001C, 50607080, D0E0F0FF
Part 12 of 12 -
0.5/ 0.5 Points
Question 12 of 12
Hold up to the camera ALL of your FILLED scrap papers.
Show both sides of each FILLED scrap paper.
0.5/ 0.5 Points
Did you show BOTH SIDES of ALL of the FILLED scrap papers?
A. Yes
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
7/8
4/20/2021
OWL : COMPSCI 2208B 001 FW20 : Online Tests, Quizzes & Assignments
B. No
Answer Key: A
Gateway
Help & Support
Western University
OWL is the learning management system of Western University. It is a customized version of Sakai.
Copyright 2003-2021 The Apereo Foundation. All rights reserved.
OWL - OWL - Sakai 11.3-owl6 - Server azuki24
https://owl.uwo.ca/portal/site/891dc891-85cc-49bc-aa2c-2b815fb6187b/tool/e87e873e-98e0-4845-a2ab-cf7f072b1fdf/jsf/index/mainIndex
8/8