Preview

02 - Assembly Language

 1. Assembly language instruction sets will be specified by your exam board. There is only one global instruction set that is used for all CPUs.
Example of instruction set command and description
-------------------------------------------------------------

LDR Rd, <memory ref>    : Load the value stored in the memory 
                          locationspecified by <memory ref> into 
                          register d.

  TRUE

  FALSE

 2. There are different types of mnemonics in any given instruction set. For example. A______, Data transfer, Logic, Jump and Miscellaneous mnemonics.

  Ample

  Arithmetic

  Ardous

  Adder

 3. AND, OR, XOR and NOT are examples of:

  logic mnemonics

  arithmetic mnemonics

  data transfer mnemonics

  jump mnemonics

 4. MOV, POP, IN and OUT are examples of:

  data transfer mnemonics

  arithmetic mnemonics

  logic mnemonics

  jump mnemonics

 5. JZ is a jump mnemonic and it means jump if you have reached the last (i.e. 'z') register in the CPU.

  TRUE

  FALSE

 6. Analyse the code below. Which of these lines is not executed?
assembly_language_code_example_1.png

  Line 5

  Line 6

  Line 4

  All of these lines are executed

 7. An addressing mode refers to how you are addressing memory in a given location.

  FALSE

  TRUE

 8. ______________ is called that because the value to be stored in memory immediately follows the operation code in memory

  Non addressing

  Immediate addressing

  Direct addressing

  Indexed addressing

 9. The purpose of the accumulator is to provide permanent ROM storage. It holds data that is being processed and stores it securely.

  TRUE

  FALSE

 10. This instruction uses immediate addressing because the accumulator will be ____________________________.
MOV A,#30h

  loaded with the value that immediately follows; in this case 30 (hexadecimal).

  loaded with the address location and then added to 30 which is in the accumulator

  moved to location 30h with the data 'A' placed in this label

  loaded with the value that does not immediately follow, and then is placed in location 30h

 11. Immediate addressing is very slow since the value to be loaded is not included in the instruction.

  FALSE

  TRUE

 12. What is symbolic addressing?

  the use of characters to represent the address of a store location

  the use of the letter 'S' to indicate that the number will be stored in a register

  the use of numbers to represent the number held in the accumulator

  None of these options are valid answers

 13. Direct addressing is called this because the value to be stored in memory is obtained by directly retrieving it from another memory location. For example: MOV A,30h

  TRUE

  FALSE

 14. This type of addressing uses a second register (known as the base register) which holds the actual memory address that the program is interested in

  indirect addresing

  mnemonic addressing

  labelled addressing

  direct addressing

 15. This instruction will read the data out of RAM address 30 (hexadecimal) and store it in the accumulator
MOV A,30h

  FALSE

  TRUE

 16. This piece of code loads the accumulator with the value 40. The accumulator is then increased by one and tested against the number 46. If the accumulator is _________________.
LDA #40
label1:
INC
CMP #46
BLT label1
STO 1024

  less than 46 then you jump to the label1 so that the accumulator continues to increment

  less than 46 then you jump to the label1 to keep incrementing the accumulator.

  more than 46 then you jump to the label1 and continue incrementing the accumulator

  equal to 46 (CMP means equal) and then branch to label1,storing 1024+40 to the accumulator

 17. One feature of assembly language is flow control. Which of the following statements in regard to this is true?

  the order may be changed by a jump instruction/conditional jump instruction

  All of the listed options are true with regard to flow control

  The order in which instructions are executed is flow control

  flow control is important because order of instructions is important

 18. Match the description to the correct instruction.
Add one to the accumulator 

  DEC

  BLT label1

  CMP &34

  INC

 19. Match the description to the correct instruction.
Compare the accumulator against the hexadecimal value of 34 and store the details in the status register

  BLT

  BLT label1

  INC

  CMP &34

 20. Match the description to the correct instruction.
Move the contents of register R1 into register R2

  MOV #R1 LOAD #R2

  MOV R1, R2

  MOV R1 AND R2 INC

  MOV R1 LOAD #R2