Get matched

Assembly, operating systems and translators

Start questions

AI-assisted English content review; independent teacher approval pending.

Practice scope and review

Original, AI-authored English practice with worked guidance. Selected topics only; independent teacher review is pending. This is not a complete syllabus, official past-paper collection or predicted exam score. Check your own exam-board specification: these concepts are not certified against a particular board or exam year.

151 original questions across 21 selected topic areas. No account or payment required to practise.

Cambridge International AS & A Level Computer Science (9618), examination year 2027: AI-assisted conceptual alignment to official sources, not teacher or exam-board certification. Syllabus mapping and remaining coverage.

5 questions in this topic

Exact English revisions checked in an AI-assisted academic review; independent teacher approval is still pending.

All topics

Original English exercises targeting selected 9618 2027-29 requirements. Conceptual alignment only; independent teacher approval, practical competence and complete teaching coverage are not established.

Subtopics in this topic (3)
  • Indexed addressing and bit masks
  • Scheduling and paging
  • Grammars and stack evaluation

5 of 5 questions shown

Loading saved responses

Question 1Use the syllabus example assembly instruction meanings: LDR #n loads IX, LDX address loads ACC from memory[address+IX], AND/OR with Bn are bitwise, STO address stores ACC. Memory[100]=9, Memory[101]=182. Trace LDR #1; LDX 100; AND B00001111; OR B00100000; STO 200; END. Give IX, effective read address, intermediate ACC bytes and Memory[200]. Explain how to test bit2 (least-significant bit is bit0) without changing other bits in memory.6 indicative marks

Use the syllabus example assembly instruction meanings: LDR #n loads IX, LDX address loads ACC from memory[address+IX], AND/OR with Bn are bitwise, STO address stores ACC. Memory[100]=9, Memory[101]=182. Trace LDR #1; LDX 100; AND B00001111; OR B00100000; STO 200; END. Give IX, effective read address, intermediate ACC bytes and Memory[200]. Explain how to test bit2 (least-significant bit is bit0) without changing other bits in memory.

Show indicative guidance

Worked guidance

  1. LDR #1
    LDX 100
    AND B00001111
    OR B00100000
    STO 200
    END
  2. The effective address is100+1=101, so the fetched byte is182. Masking with15 retains its low nibble6; OR with32 sets bit5, giving38. Memory[100] remains9 and Memory[101] remains182; only Memory[200] is written.
  3. For the stored byte38, AND4 gives4 so bit2 is1. AND8 would give0 so bit3 is0. A test can alter ACC while leaving backing memory unchanged; an AND mask is not automatically a persistent device update.

Self-marking points

View marking points
  1. IX becomes1 and indexed address is101.
  2. LDX reads182=10110110 into ACC, not address101 itself.
  3. AND00001111 gives00000110=6.
  4. OR00100000 gives00100110=38.
  5. STO writes38 to Memory[200].
  6. Load the value and AND00000100; nonzero means bit2 is set, without storing the masked result back.

Examiner tip

Indicative distinct points, not an official Cambridge mark allocation. State bounds, assumptions and intermediate states; practical teacher review remains required.

Question 2All processes arrive at time0 in queue order A,B,C, need CPU times5,3,1, never block, and run round robin with quantum2 and zero switching overhead. Give schedule and completion times. Separately, a process has three initially empty page frames using FIFO replacement and references1,2,3,1,4,2,5. Trace faults and final frames. Explain why ready differs from blocked, and why a FIFO hit does not refresh replacement age.6 indicative marks

All processes arrive at time0 in queue order A,B,C, need CPU times5,3,1, never block, and run round robin with quantum2 and zero switching overhead. Give schedule and completion times. Separately, a process has three initially empty page frames using FIFO replacement and references1,2,3,1,4,2,5. Trace faults and final frames. Explain why ready differs from blocked, and why a FIFO hit does not refresh replacement age.

Show indicative guidance

Worked guidance

  1. After A's first slice its remaining time is3; B then has1 left. C completes after one unit at5. A's next slice leaves1, B finishes at8, and A finishes at9. All wait in ready while another runs because the problem specifies no blocking. Waiting times are A9-5=4, B8-3=5, C5-1=4.
  2. Frames evolve [1,-,-], [1,2,-], [1,2,3], unchanged on1, [4,2,3], unchanged on2, [4,5,3]. The fault sequence is F,F,F,H,F,H,F, so5 faults. Replacing the least recently accessed page would be a different policy, not FIFO.
  3. This short trace does not establish operating-system implementation skill, all scheduling policies, segmentation or thrashing analysis; those remain separate requirements.

Self-marking points

View marking points
  1. Schedule begins A0-2,B2-4,C4-5.
  2. It continues A5-7,B7-8,A8-9; completion times A9,B8,C5.
  3. Ready means able to run but awaiting CPU; blocked means waiting for an event/resource.
  4. References1,2,3 cause three initial faults and reference1 then hits.
  5. Reference4 evicts1, reference2 hits, reference5 evicts2: total5 faults and frames[4,5,3].
  6. FIFO ages pages by load order; a hit changes neither insertion order nor the next victim.

Examiner tip

Indicative distinct points, not an official Cambridge mark allocation. State bounds, assumptions and intermediate states; practical teacher review remains required.

Question 3Let <digit> denote any single digit0..9. Construct BNF for expressions with + and * (multiplication binds more tightly), including parentheses. Tokenise3*(4+2), reject3+*4 with a grammatical reason, translate the valid expression to RPN and trace its evaluation stack. Relate tokens and grammar to two compilation stages.6 indicative marks

Let <digit> denote any single digit0..9. Construct BNF for expressions with + and * (multiplication binds more tightly), including parentheses. Tokenise3*(4+2), reject3+*4 with a grammatical reason, translate the valid expression to RPN and trace its evaluation stack. Relate tokens and grammar to two compilation stages.

Show indicative guidance

Worked guidance

  1. <expr> ::= <term> | <expr> "+" <term>
    <term> ::= <factor> | <term> "*" <factor>
    <factor> ::= <digit> | "(" <expr> ")"
  2. For3*(4+2), the seven tokens are3,*,(,4,+,2,). The grammar makes multiplication operate on factors within a term, while+ combines terms at the expression level. Parentheses allow an inner expression to become a factor. After3+ the invalid input supplies*, which cannot begin a factor/term.
  3. RPN3 4 2 + *: push3 ->[3]; push4 ->[3,4]; push2 ->[3,4,2]; + pops4,2 and pushes6 ->[3,6]; * pops3,6 and pushes18 ->[18]. A subtraction operator, if added, would require preserving operand order. Tokenisation is lexical analysis; applying production rules is syntax analysis; neither alone generates machine code.

Self-marking points

View marking points
  1. Define expression from terms joined by+ and term from factors joined by*.
  2. Define factor as a digit or parenthesised expression.
  3. Tokens are3,*,(,4,+,2,), with lexical analysis identifying tokens and syntax analysis checking grammar.
  4. 3+*4 is invalid because a required term cannot start with*.
  5. RPN is3 4 2 + *.
  6. Stack states culminate in18 after adding4+2 then multiplying by3.

Examiner tip

Indicative distinct points, not an official Cambridge mark allocation. State bounds, assumptions and intermediate states; practical teacher review remains required.

Question 4Use these supplied instruction meanings: LDM #n loads literal n into ACC; LDD a loads Memory[a]; LDI a loads Memory[Memory[a]]; STO a stores ACC. Memory[40]=70 and Memory[70]=9. Trace LDM #40; STO 80; LDD 40; STO 81; LDI 40; STO 82. Give stored values and the number of data-memory reads used by each load, excluding instruction fetch.4 indicative marks

Use these supplied instruction meanings: LDM #n loads literal n into ACC; LDD a loads Memory[a]; LDI a loads Memory[Memory[a]]; STO a stores ACC. Memory[40]=70 and Memory[70]=9. Trace LDM #40; STO 80; LDD 40; STO 81; LDI 40; STO 82. Give stored values and the number of data-memory reads used by each load, excluding instruction fetch.

Cambridge 2027: Direct conceptual match

Traced immediate/direct/indirect through supplied memory40->70->9; counted operand reads without mixing fetch/store traffic.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. LDM uses the literal 40, so the first store places 40 in location 80 without a data-memory lookup for its operand.
  2. LDD looks at address 40 once, finding 70 and storing that at 81. LDI reads 40 to find pointer 70, then reads 70 to find 9 for location 82.
  3. The three stored values are 40,70,9. Counting only operand reads gives 0,1,2; stores and instruction fetches are different accesses and are excluded by the question.

Self-marking points

View marking points
  1. Memory[80]=40 from immediate loading.
  2. Memory[81]=70 from direct loading.
  3. Memory[82]=9 from indirect loading.
  4. Load data-read counts are 0,1,2 respectively.

Examiner tip

An address held in memory is not the data found at that address.

Question 5Evaluate RPN tokens 12 3 2 * - 2 / using a stack and REAL division. Give the stack after each operator, bottom first. Supply pseudocode for handling a binary operator by popping Right then Left. Explain what reversing these operands would do at the subtraction.4 indicative marks

Evaluate RPN tokens 12 3 2 * - 2 / using a stack and REAL division. Give the stack after each operator, bottom first. Supply pseudocode for handling a binary operator by popping Right then Left. Explain what reversing these operands would do at the subtraction.

Cambridge 2027: Direct conceptual match

Independent stack evaluation produced12/6 then6 then3; selected RPN evaluation, not required graph implementation or new grammar claims.

AI-assisted placement. Independent teacher approval pending.

Show indicative guidance

Worked guidance

  1. Push 12,3,2; multiplying the top two replaces them with 6, leaving [12,6]. Subtraction must use 12 as the left operand, leaving [6].
  2. Right <- Pop()
    Left <- Pop()
    // Apply is supplied as the selected arithmetic operator
    Push(Apply(Left, Operator, Right))
  3. Pushing 2 then dividing gives 6/2=3. Reversing pop order for subtraction yields -6, showing why commutative multiplication alone is not a sufficient evaluator test.

Self-marking points

View marking points
  1. After * stack is [12,6].
  2. After - it is [6], and after / it is [3].
  3. Pops Right before Left and pushes Left operator Right.
  4. Reversal computes 6-12=-6 at subtraction.

Examiner tip

Use subtraction or division to test operand order, not addition alone.

All AS & A Level subjects