How does assembly language map onto the processor, and what do the different addressing modes mean?
Assembly language and the relationship between assembly instructions and machine code, the instruction set with opcode and operand, the Little Man Computer model, and the addressing modes (immediate, direct, indirect and indexed).
An OCR H446 answer on assembly language and addressing modes: how assembly maps to machine code, the opcode-and-operand structure of an instruction, the Little Man Computer model, and the immediate, direct, indirect and indexed addressing modes with examples.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
OCR wants the relationship between assembly language and machine code, the opcode-and-operand structure of an instruction, the Little Man Computer (LMC) model, and the four addressing modes (immediate, direct, indirect, indexed) with examples. Expect "explain opcode and operand" and "distinguish the addressing modes" questions.
The answer
Assembly language and machine code
Opcode, operand and the Little Man Computer
Addressing modes
Examples in context
The Little Man Computer is OCR's standard way to set assembly questions, asking you to trace or write a short program. Indexed addressing is how compiled code walks an array in a loop. Indirect addressing underlies pointers and dynamic data structures. Assembly and these modes connect the high-level constructs of Component 02 to the hardware of Component 01. OCR links this to the fetch-decode-execute cycle (which executes these instructions) and to translators (the assembler that produces machine code).
Try this
Q1. State what the opcode and the operand of an instruction each specify. [2 marks]
- Cue. The opcode specifies the operation; the operand specifies the data, the address of the data, or a register.
Q2. State the difference between immediate and direct addressing. [2 marks]
- Cue. Immediate: the operand is the actual value. Direct: the operand is the address of the location holding the value.
Q3. State one reason indexed addressing is useful. [1 mark]
- Cue. Incrementing the index register steps through consecutive memory locations, so it is ideal for processing an array or list in a loop.
Exam-style practice questions
Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
OCR 20206 marksAn instruction is made up of an opcode and an operand. Explain what each part specifies, and explain the difference between immediate and direct addressing.Show worked answer →
Opcode and operand (up to 2): the opcode specifies the operation to be carried out (for example ADD, STORE, LOAD); the operand specifies the data to be operated on, or the address of that data, or a register.
Immediate versus direct (up to 4): in immediate addressing the operand is the actual value to be used, so the data is part of the instruction itself (for example "ADD 5" adds the literal 5). In direct addressing the operand is the address of the memory location holding the data, so the processor goes to that location to fetch the value (for example "ADD 30" adds the contents of address 30). Markers reward operation-versus-data for opcode/operand, and value-in-the-instruction versus address-of-the-data for the two modes.
OCR 20216 marksExplain the difference between direct, indirect and indexed addressing modes, and state one reason indexed addressing is useful.Show worked answer →
Direct (up to 2): the operand holds the address of the location containing the data; the processor reads that location.
Indirect (up to 2): the operand holds the address of a location that itself contains the address of the data (a pointer), so the processor follows two steps to reach the data; this allows access to more memory than the operand field could address directly, and the use of pointers.
Indexed (up to 2): the address of the data is found by adding the operand (a base address) to the contents of an index register; incrementing the index register steps through consecutive locations, which is why indexed addressing is useful for processing arrays or lists in a loop. Markers reward the one-step, two-step (pointer) and base-plus-index descriptions, and the array-traversal use for indexed.
Related dot points
- The structure and function of the processor: the arithmetic logic unit, control unit, registers (PC, ACC, MAR, MDR, CIR), buses (data, address, control), and the fetch-decode-execute cycle in the von Neumann architecture.
An OCR H446 answer on the structure and function of the processor: the ALU, control unit, the five registers (PC, ACC, MAR, MDR, CIR), the data, address and control buses, and a step-by-step trace of the fetch-decode-execute cycle in the von Neumann architecture.
- Factors affecting processor performance (clock speed, number of cores, cache size and type), pipelining, and the characteristics and uses of CISC and RISC processors, multicore and parallel systems, and GPUs.
An OCR H446 answer on what affects processor performance: clock speed, cores and cache, how pipelining overlaps the fetch-decode-execute stages, and the characteristics and uses of CISC versus RISC processors, multicore and parallel systems, and GPUs.
- The need for, and the characteristics of, translators (assemblers, compilers, interpreters), the stages of compilation (lexical analysis, syntax analysis, code generation, optimisation), and the role of linkers, loaders and libraries.
An OCR H446 answer on translators and compilation: the characteristics of assemblers, compilers and interpreters, when each is used, the four stages of compilation (lexical analysis, syntax analysis, code generation and optimisation), and the roles of linkers, loaders and libraries.
- Programming paradigms (procedural, low-level / assembly and object-oriented), the need for and characteristics of different levels of programming language, and the core principles of object-oriented programming: classes, objects, methods, attributes, encapsulation, inheritance and polymorphism.
An OCR H446 answer on programming paradigms and language levels: procedural, low-level and object-oriented programming, the characteristics of high-level versus low-level languages, and the OOP principles of classes, objects, methods, attributes, encapsulation, inheritance and polymorphism.
- Data structures: arrays, records, tuples and lists, the stack and queue abstract data types and their operations, linked lists, trees and graphs, and hash tables, including how each is used and its advantages.
An OCR H446 answer on data structures: arrays, records, tuples and lists, the stack and queue abstract data types with their operations, linked lists, trees, graphs and hash tables, including how each is used and its advantages and disadvantages.