Lompat ke konten

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

Exam questions on what this lab teaches, with the points that gain marks.

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

  1. Reads the source code one line at a time: both passes.
  2. Removes white space and adds labels to the symbol table: first pass.
  3. 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

  1. Remove comments: first pass.
  2. Read the program one line at a time: both passes.
  3. Generate the object code: second pass.
  4. 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

  1. To create the symbol table.

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

The question as printed in the exam paper

More real experiments

All labs →

Masuk atau buat akun

IGCSE, A-Level & AP