Section 9.6
Review Questions

Arrays

  1. 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...
  1. Which CSC-1 register holds the address used during all indirect loads and stores?
answer...
S
  1. What is the name of the "indirect load" instruction in the CSC-1?
answer...
LDS
  1. What is the name of the "indirect store" instruction in the CSC-1?
answer...
STS
  1. What two components are added together to come up with the actual address when accessing arrays?
answer...
base address and offset
  1. Which is simpler? Byte-addressability or word-addressability?
answer...
word-addressability
  1. What do we call the stuffing of several bytes into a single word?
answer...
packing
  1. 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.
  1. Which of the following load instructions in the CSC-1 takes an operand? Only one of them does.
               LOD           LDS
answer...
LOD
  1. Suppose that the base address of the array is 1000. How would you get that into the accumulator?
answer...
LDI 1000
  1. If the A2S instruction is used with the LDS instruction, would the S2A instruction be used with the STS instruction?
answer...
No
  1. 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