Test on Computer Architecture

Please answer all the following questions by typing the answers in the slots below. You have 45 minutes to complete the test, after which the computer will mark your answers automatically. The maximum score that you can achieve on this test is 25 marks.

  1. Please type the 6502 instructions that match the following descriptions (1 mark each)

    • Load the X register with the number 80
    • Clear the carry flag
    • Store the contents of the A register in address 5600
    • Branch if the zero flag is clear to the label 'loop'
    • Decrease the value in the Y register by 1

  2. For each of the following code snippets, decide whether each one leaves the carry flag and the zero flag set to 1, cleared to 0 or in an unpredictable state. (1 mark each)

    Zero flag Carry flag
    SEC
    LDA #20    SBC #17
    LDX #2    DEX     DEX

  3. Please type a single word in each of the following spaces (1 mark each):

    "The CPU (Central ) communicates with the memory via two buses. These are simply sets of wires that can hold 1s or 0s. The bus allows the CPU to specify which location in memory it wants to select, and the bus allows it to specify the number to be written to or read from that location. There is also a small set of wires called the bus that specifies whether a memory operation is a read or a write."

  4. True or false? (1 mark each)
    True False
    When an operation gives a result of 0, the Zero flag is cleared to 0.
    There are some flags apart from the Zero and Carry flags.
    There are some instructions that do not affect the flags.
    The insrtuction BCS performs the jump if the carry holds 0.

  5. The correct name for the A register is the
    Arithmetiser
    Adder unit
    Arithmetic register
    Addition register
    Accumulator

  6. The carry flag is generally used to detect

    1. whether a carry has occurred in an addition sum
    2. whether a borrow has occurred in a subtraction sum
    3. whether the result of a calculation is zero or not.


    I only
    I and II only
    II and III only.
    II only.
    I, II and III.

  7. Which of the following sets of instructions is guaranteed to leave all three registers (A, X and Y) all holding the value 70?
    LDA #70    TAX    TXY
    LDA #70    TAX    TYA
    LDX #70    TXA    TAY
    LDX #70    TAX    TAY
    LDY #70    TAX    TAY

  8. The instructions

    CLC
    LDA #240
    ADC #20

    would leave
    A holding 260 and C unchanged.
    A holding 3 and C set to 1
    A holding 3 and C cleared to 0.
    A holding 4 and C set to 1.
    A holding 4 and C cleared to 0.

  9. Which of the following statements is NOT true?
    The computer translates all programs written in high-level languages such as JavaScript into Assembly language before running them.
    Assembly language is a code that represents the signals stored in computer memory.
    All instructions in an Assembly language program are translated into numbers.
    The computer has no way of distinguishing between the numbers in memory that represent the program and the numbers that represent data.
    An Assembler is a program that translates Assembly language into numbers.