Lesson 4.7.3.5

4.7.3.5 Machine code and assembly language Quiz: AQA Computer Science, Unit 7

20 questions

In partnership with Revision Ninja

Lesson 4.7.3.5, Machine code and assembly language: 20 multiple choice questions for the AQA Computer Science (7517), Unit 7: Fundamentals of computer organisation and architecture, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. Which machine-code operation changes the flow of execution by loading a new address into the PC?

    • Load
    • Store
    • Compare
    • Branch
  2. Which operation copies a value from a register to a memory location?

    • Add
    • Store
    • Halt
    • Load
  3. What does a logical shift left by one place do to the binary value 0000 0011?

    • It gives 0000 0001, which is equivalent to dividing by 2
    • It gives 1000 0001, which is equivalent to adding 128 to the value
    • It gives 0000 0110, which is equivalent to multiplying by 2
    • It gives 0000 1100, which is equivalent to multiplying by 4
  4. What does a logical shift right by one place do to 0000 1000?

    • It gives 0001 0000, which is equivalent to multiplying by 2
    • It gives 1000 0100, which is equivalent to adding 128 to the value
    • It gives 0000 0000, because bits are always discarded by a shift
    • It gives 0000 0100, which is equivalent to dividing by 2
  5. What is the result of the bitwise AND of 1100 and 1010?

    • 1110
    • 1000
    • 0111
    • 0110
  6. A program has LOAD #6, ADD #6 and then a logical shift left by one place, starting from an empty register. What value does the register hold at the end?

    • 12
    • 24
    • 18
    • 36
  7. Which operation changes the PC only if a stated condition is met?

    • Load
    • Halt
    • An unconditional branch
    • A conditional branch
  8. What is the result of the bitwise AND of 1011 0110 and 0000 1111?

    • 0000 0000
    • 1011 1111
    • 0000 0110
    • 1111 0000
  9. Why do assembly programmers use mnemonics such as ADD rather than binary opcodes?

    • Mnemonics remove the need for an assembler, because the processor executes them directly
    • They are easier to read and remember, and an assembler translates them into the matching opcodes
    • Mnemonics run faster than binary opcodes because the processor skips the decoding stage
    • The processor understands only mnemonics, so binary must be converted to them first
  10. A program adds two numbers stored at addresses 50 and 51 and stores the result at address 52, using direct addressing. Which sequence is correct?

    • BRANCH 50, ADD 51, STORE 50
    • STORE 50, SHIFT 51, LOAD 52
    • LOAD 50, ADD 51, STORE 52
    • LOAD #50, ADD #51, HALT
  11. Which of these is NOT a logical bitwise operator?

    • XOR
    • AND
    • ADD
    • OR
  12. Which assembly fragment loads the value 12 into a register?

    • STORE #12, which writes the value 12 into a register
    • LOAD #12, which uses immediate addressing
    • LOAD 12, which loads the value stored at address 12
    • BRANCH 12, which jumps to address 12 unconditionally
  13. A compare instruction is followed by a conditional branch. What is the purpose of the compare?

    • To copy one value into memory, replacing the previous contents of the location
    • To set status flags by comparing two values, which the branch then tests
    • To convert a value from binary to decimal before it is used in a calculation
    • To halt the processor until an interrupt arrives from a connected device
  14. Which instruction stops the fetch-execute cycle?

    • Halt
    • Compare
    • Store
    • Branch
  15. A program needs 7 + 9 in a register. Which operation is required?

    • Compare
    • Add
    • Subtract
    • Logical shift right
  16. Which of these is an unconditional branch?

    • A branch taken only if the carry flag is set by the last arithmetic operation, which decides whether the jump happens
    • A branch that always transfers control to the target address, whatever the status flags
    • A branch taken only if the last result was negative, as recorded in the status register by the processor
    • A branch taken only if the zero flag is set by the last operation, so that the jump depends on that flag
  17. A program contains LOAD #5, ADD #3 and STORE 100. What value is stored at address 100?

    • 5
    • 3
    • 8
    • 15
  18. In mnemonic form, what does ADD #3 mean?

    • Add the immediate value 3 to the value in the register
    • Add the address 3 to the status register
    • Add the contents of memory location 3 to the register
    • Add 3 to the program counter
  19. Why are shift operations useful in machine code?

    • They allow the processor to increase its clock speed while it is running a program
    • They are the only way in machine code to access main memory at all
    • They give fast multiplication or division by powers of two, and help to extract bit fields
    • They convert binary numbers into text characters for display on the screen
  20. A fragment performs LOAD 10 and then ADD 11. What is the value in the register at the end if location 10 holds 4 and location 11 holds 9?

    • 36
    • 4
    • 9
    • 13

All AQA Computer Science quizzes