Section 9.6
Review Questions
Arrays
-
Which kinds of data structures found in high level languages make use of
indirect addressing in machine language?
answer...
arrays, structs, objects, pointers, linked lists...
-
Which CSC-1 register holds the address used during all indirect loads
and stores?
answer...
S
-
What is the name of the "indirect load" instruction in the CSC-1?
answer...
LDS
-
What is the name of the "indirect store" instruction in the CSC-1?
answer...
STS
-
What two components are added together to come up with the actual address
when accessing arrays?
answer...
base address and offset
-
Which is simpler? Byte-addressability or word-addressability?
answer...
word-addressability
-
What do we call the stuffing of several bytes into a single word?
answer...
packing
-
Why is byte-addresability used more often today?
answer...
most computers use 8-bit ASCII and store one character per byte;
hence it is more convenient to break memory into bytes
The following questions relate to the CSC-1 assembler program found in
Section 9.6. You might want to read and study that rather carefully before
answering the following questions.
-
Which of the following load instructions in the CSC-1 takes an
operand? Only one of them does.
LOD LDS
answer...
LOD
-
Suppose that the base address of the array is 1000. How would you
get that into the accumulator?
answer...
LDI 1000
-
If the A2S instruction is used with the LDS instruction, would the S2A
instruction be used with the STS instruction?
answer...
No
-
Write a complete chunk of CSC-1 code (4 instructions long) that reads
ARRAY[i] from memory and leaves it in the A register.
answer...
LDI 1000
ADD I
A2S
LDS