Saltar al contenido

Labs · 9618 AS 4.2

Two-Pass Assembler

Be the assembler. Find the address of every label in pass 1, then turn the labels into addresses in pass 2, and find the line that stops it.

6 levelsFree bench

In the exam

9618/12 May/June 2023 · Question 3(a) · 3 marks

A two-pass assembler translates a program. Match each action to the pass (first, second or both) in which it happens.

Points that gain marks

  • Reads the source code one line at a time: both passes.
  • Removes white space and adds labels to the symbol table: first pass.
  • Generates the object code: second pass.

In this lab: Pass 1 here builds the symbol table; pass 2 writes the object code with an address in place of each label.

9618/11 October/November 2022 · Question 6(c) · 2 marks

Tick one or more boxes in each row to show whether the task is performed in the first pass or the second pass of a two-pass assembler: remove comments; read the program one line at a time; generate the object code; check the opcode is in the instruction set.

Points that gain marks

  • Remove comments: first pass.
  • Read the program one line at a time: both passes.
  • Generate the object code: second pass.
  • Check the opcode is in the instruction set: first pass.

In this lab: Levels 'Labels and addresses' and 'Pass 2: object code'.

9618/11 October/November 2023 · Question 8(a) · 1 marks

Identify the purpose of the first pass of a two-pass assembler.

Points that gain marks

  • To create the symbol table.

In this lab: Levels 'Labels and addresses' and 'A forward reference'.

More real experiments

All labs →

Iniciar sesión o crear cuenta

IGCSE, A-Level & AP