You are on page 1of 23

Computer Science 9608

Topical Past Papers with Answers

1.4.4 Assembly Language


May/June 2015.P13

[5]

Examiner’s Report

Question 2

Candidates need to improve their understanding of two-pass assemblers. Most candidates realised that the activity
on the fourth line would need to be completed during the first pass, but there was considerable confusion about the
other stages. Some candidates wrote that all the activities were carried out in the same stage.

7 (a)(i)

[1]

(ii)

[1]

explanation

• content of 124 is 0 1 1 1 1 1 1 1

• this is equivalent to 127

• contents of 127 are 0 1 1 0 1 0 0 1 [2]

(iii)

[1]

Page 1 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


explanation

• index register value = 6

• 120 + 6 = 126

• contents of 126 placed in the accumulator [2]

(b) 1 mark for each correct value in the table.

[6]

May/ June 2016.P11 and May/June 2016.P12

9 (a)(i) One mark for the contents of the accumulator and one mark for the reason. [2]

Accumulator contents: 0100 0101

Reason:

Address is 60

Contents of the index register is 8

And 60 + 8 = 68 in denary gives the address

The contents of which is 0100 0101 in binary.

(ii) 0000 0111 [1]


Page 2 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(b)

One mark for each shaded block. [7]

• Contents of the Accumulator in first 2 lines (instruction addresses 50 and 51)

• Updating address 103 (instruction 52)

• Loading the Accumulator and addition (instructions 53 and 54)

• Not executing instruction 58

• Incrementing the index register (instruction 59)

• Loading the Accumulator and addition (instructions 60 and 61)

• Correct output of 'x' (instruction 62)

Page 3 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Examiner’s Report

Question 9

(a)(i) There were many fully correct answers to this question. The vast majority of candidates understood what
was meant by indexed addressing and were able to correctly show the contents of the accumulator and
describe how the answer was obtained. Candidates who showed an incorrect value in the accumulator, had
frequently correctly added the contents of the index register to the base address, but then, instead of
looking at the contents of address 68, had converted 68 in denary to its binary equivalent and entered that
binary value into the accumulator.

(ii) The question was answered well. Most candidates correctly decremented the value in the index register.

(b) Most candidates correctly completed the first three instructions and the incrementing of the index register
and there were a good number of completely correct answers to this question. The most frequent causes of
error were the omission of the instruction addresses in the first column and the incorrect interpretation of
the OUT instruction, outputting 120 instead of ‘x’.

This question was one where many candidates had initially answered in pencil and then had overwritten
their answers in ink. When scanned electronically this creates a double image which is sometimes very
difficult to read. There is plenty of blank space in the question paper and candidates should be encouraged
to do their rough working on these blank pages so that the answers to be marked are clear and can be easily
read.

May/ June 2016.P13

4 (a) 11001110 [1]

(b)

Page 4 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


One mark each for:

• Instruction 20

• Instructions 21 and 22

• Instruction 23

• Instructions 24 and 25

• Not executing instructions 29 and 30

• Instructions 31 and 32

• Correct output [7]

Oct/Nov 2016.P11 and Oct/Nov 2016.P13

8 (a)(i) [1]

(ii) One mark for answer and two marks for explanation

• Index Register contains 1001 = 9

• 800 + 9 = 809 [3]

(b) (i) ONE mark for each correct row.

[4]
Page 5 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(ii) 107 [1]

Examiner’s Report

Question 8

(a)(i) Almost all candidates were able to correctly write the contents of the accumulator after the execution of the
given instruction.

(ii) There were some very good answers to this question, with many candidates entering the correct value into
the accumulator and explaining clearly how they had carried out the operation. There is still, however,
considerable confusion amongst some candidates with regard to indexed addressing. Nearly every incorrect
answer to this question had the value 0011 0001 in the accumulator. This value was obtained by incorrectly
adding the contents of the index register to the contents of the given address rather than by correctly adding
the contents of the index register to the actual address given in the instruction. There were many good
explanations of the method used, although candidates need to be aware of the need to carefully state each
step in the process.

(b)(i) Many candidates successfully traced the first four lines of the code, although some candidates incorrectly
changed the value in the accumulator to zero when storing the value in address 802. However, when
executing line 104 quite a number of candidates used the original value of zero from address 802 instead of
the updated value of 90. This meant that the result of the comparison was false and execution was
incorrectly transferred to line 110 instead of line 107. Candidates must take care on questions of this type
and check carefully on the column headings in the trace table. In this case there was not a column headed
‘Address’. The first column was headed ACC. A small number of candidates incorrectly put the address values
in the ACC column and then had nowhere to write the values that should have been in the accumulator.

(ii) The majority of the candidates who correctly used the updated value of the contents of address 802 in part
(b)(i) realised that the statement at line 107 was the one that was not needed. Candidates must take care to
read the question carefully. Some gave the instruction as the answer when the question clearly says ‘state
the address of this instruction’.

Page 6 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Oct/Nov 2016.P12

5 (a)(i) [1]

(ii) ONE mark for Accumulator contents, ONE mark for the explanation.

• Index Register holds the value 4; 101 + 4 = 105 so load data from address 105 [2]

(iii) ONE mark for Accumulator contents, TWO marks for the explanation.

• Memory address 103 contains the value 107

• So address 107 is the address from which to load the data [3]

(b) ONE mark for each correct row.

[6]

Page 7 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Examiner’s Report

Question 5

(a)(i) This question was very well answered, and almost all candidates were able to correctly write the contents of
the accumulator after the execution of the given instruction.

(ii) There were also some very good answers to this question, with many candidates entering the correct value
into the accumulator and explaining clearly how they had carried out the operation. There is still
considerable confusion amongst some candidates about indexed addressing. Nearly every incorrect answer
to this question had the value 1001 0111 in the accumulator. This value was obtained by incorrectly adding
the contents of the index register to the contents of the given address rather than correctly adding the
contents of the index register to the actual address given in the instruction.

(iii) The majority of candidates understood what was meant by indirect addressing and gave the correct contents
of the accumulator. There were also many good explanations of the method used, but candidates need to be
aware of the need to carefully state each step in the process.

(b) Many candidates successfully traced the first three lines of the code, but some candidates incorrectly
changed the value in the accumulator to zero when storing the values in addresses 812 and 813. The
instruction at line 803 was also generally understood and completed correctly. When executing line 804, a
significant number of candidates used the original value of zero from address 812 instead of the updated
value of 29. This meant that the final value in the accumulator and the value stored in address 813 were
then both incorrect. Candidates must take care on questions of this type and check carefully on the column
headings in the trace table. In this case, there was not a column headed ‘Address’. The first column was
headed ACC. A small number of candidates incorrectly put the address values in the ACC column and then
had nowhere to write the values that should have been in the accumulator.

May/June 2017.P11 and May/June 2017.P13

4 (b)

Both correct op codes [1]

Operand 0001 0001 [1]

Operand 0110 0001 [1]

[3]

Page 8 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(c) 256 [1]

(d)(ii) LDI 63

LDI [1]

63 [1]

[2]

Examiner’s Report

Question 4

(b) The majority of candidates able to correctly convert the instructions and denary values into 8-bit binary.

(c) The majority of candidates understood that the biggest number that could be stored in 8-bit binary was 1111
1111, that is, 255 in denary. Others need to improve their understanding of the number of different values
that this represents. The most common incorrect answer was 255, where candidates omitted to include zero
as a possible memory location.

(d)(ii) Many candidates were correctly able to convert the hexadecimal value to the correct assembly language
instruction. A number of candidates will need to improve their understanding of the format of assembly
language instructions; a common incorrect answer was LDR #63. Candidates must be aware that where a
table of assembly language instructions is given in the question, answers should conform to the syntax of
those instructions.

May/June 2017.P12

5 (b)

Both correct op codes [1]

Operand 0100 0011 [1]

Operand 0000 0111 [1]

[3]

Page 9 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(c)(i) 14 5E

14 [1]

5E [1]

[2]

(c)(ii) LDR #77

LDR [1]

#77 [1]

[2]

Examiner’s Report

Question 5

(b) The majority of candidates were able to correctly convert the instructions and denary values to 8-bit binary.
A common incorrect answer was the conversion of 7 in denary to 000 1101 in binary.

(c)(i) Many candidates able to correctly convert the binary values to hexadecimal. Some candidates need to
improve their understanding of the hexadecimal number system. Common errors were to convert the
leftmost 8-bit binary pattern to denary and to put 22 instead of 14 or to put 5D rather than 5E.

(ii) Many candidates were correctly able to convert the hexadecimal value to the correct assembly language
instruction. Some candidates need to improve their understanding of hexadecimal to denary conversion. A
common incorrect answer was LDR 413, where the hexadecimal 4D had been incorrectly converted to 413 in
denary.

Page 10 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Oct/Nov 2017.P11 and Oct/Nov 2017.P13

4 (b)

(c) Three marks from:

• The assembler scans the assembly language instructions in sequence

• When it meets a symbolic address checks to see if already in symbol table

• If not, it adds it to the symbol table in the symbolic address column

• If it is already in symbol table check if absolute address known

• If the absolute address is known, it is entered in the appropriate cell

• If the absolute address is not known mark / leave as unknown [Max 3]

(d)(i) The op code / mnemonic / instruction table [1]

Examiner’s Report

Question 4

(b) Many candidates found this question challenging. Candidates need to improve their understanding of
relative addressing. Many candidates were able to continue the trace table for the next two rows i.e. the
decrementing and storing of the value. Only a small number were able to successfully continue from there

(c) Many candidates found this question challenging. Candidates need to improve their understanding of how
an assembler creates the symbol table. There was also considerable confusion about what was entered into
the symbol table, even though the table had been completed in the question. Many candidates described

Page 11 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


the entry of instructions instead of the symbolic names; very few made any reference to the given table
even though the question was quite specific.

(d)(i) This question was also not well answered. Candidates need to improve their understanding of the assembly
process, and that the instructions are also translated into machine code from the mnemonic form, hence a
table of binary equivalents for each assembly code instruction is also required.

Oct/Nov 2017.P12

4 (c)(i) 1 Mark per bullet

Maximum 2 for Macro

Maximum 2 for Directive

Maximum 3 in total

Macro

• A group of instructions given a name // subroutine

• A group of instructions that need to be executed several times within the same program

• The statements are written once and called using the name whenever they need to be executed

• Macro code is inserted into the source file at each place it is called

• By example

Directive

• An instruction that directs the assembler to do something

• A directive is not a program instruction

• It is information for the assembler

• By example [3]

(c)(ii) 1 Mark for a suitable example

For example: State the start address for the program //tell the assembler to set aside space for variables //
include an external file etc. [1]

Page 12 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(d) Mark as shown

(e) Mark as follows:

Table entries:

1 Mark per bullet, max 4

• EndProg

• 2 × Unknown

•9

• 14

•8

Numbering:

1 Mark per bullet, max 2

• Relative address of Value is numbered 6

• Number given for EndProg is next number in sequence to relative address of Value

• All numbers correct – award 2 marks

Page 13 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language

[6]

Examiner’s Report

Question 4

(c)(i) This question was not well answered. A minority of candidates could explain the meaning of the two terms.
Candidates need to improve their understanding of the terminology and the differences between macros
and directives.

(ii) This question was also not well answered. A minority of candidates were able to give a correct example of a
directive. The most common error was to include one of the assembly language mnemonics given in the
question paper.

(d) There were a few excellent answers to this question. Candidates need to improve their understanding of
relative addressing. Many candidates were able to continue the trace table for the next two rows (the
incrementing and storing of the value). Only a small number were able to successfully continue from there.

(e) Many candidates found this question challenging. Candidates improve their understanding of how an
assembler creates the symbol table. A significant number of candidates were able to successfully complete
the relative address entry for Value, and the symbolic address entry for EndProg. The majority of
candidates found it difficult to complete the rest of the table.

Page 14 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Oct/Nov 2018.P11

4 (d) 1 mark per bullet point

• Outputting * (instruction 71)

• Storing 130 in 203 (instruction 72)

• Loading, incrementing accumulator and storing in 204 (instructions 73, 74 and 75)

• Incrementing Index Register (instruction 76)

• Loading 133, comparing and jumping to 81 (instructions 77, 78 and 79)

• Loading, comparing and jumping to 74 (instructions 81, 82 and 83)

• Incrementing accumulator, storing in 204 and incrementing index register, loading 130 (instructions 74–79)

• Outputting * to end (instructions 80–84) [8

Page 15 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


Oct/Nov 2018.P12

3 (a)(i) 1 mark per bullet point

Absolute addressing:

• The operand is a numeric address // The numeric address is given // referring directly to a memory
location

Symbolic addressing:

• The operand is a word/symbol // A word/symbol represents the memory location/address [2]

(a)(ii) 1 mark per example

Absolute addressing: For example, ADD 230

Symbolic addressing: For example, ADD num1 [2]

(d) 1 mark per bullet point

• Loading 2, comparing with 104 (instructions 40 and 41)

• Loading 302 (instruction 43)

• Comparing, and branching to 47 (instructions 44, 45)

• Loading, decrementing accumulator and storing (instructions 47, 48 and 49)

• Incrementing Index Register (instruction 50)

• Loading 303, comparing and outputting + (instructions 43–46)

• Loading, decrementing accumulator and storing, incrementing Index Register and end (instructions 47–51,
41, 42 and 54) [7]

Page 16 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language

Examiner’s Report

Question 3

(a)(i) Many candidates found this part question challenging. Candidates need to improve their understanding of
symbolic addressing and absolute addressing.

(ii) Some candidates gave correct examples of an ADD instruction using absolute addressing. A minority of
candidates were able to give a correct example of a similar instruction using symbolic addressing.

Page 17 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


(d) The majority of the candidates were successful in completing the first line of the trace table. Many
candidates found it challenging to complete the rest of the table. There were a small number of completely
correct answers.

Oct/Nov 2018.P13

2 (c) 1 mark per bullet point

• Loading 8 (instruction 20)

• Comparison and loading 453 (instructions 21–23)

• Outputting & (instruction 26)

• Loading, incrementing and storing in 96 (instructions 27–29)

• Incrementing Index Register (instruction 30)

• Jumping and loading 452 (instruction 23)

• Jumping, loading, incrementing, storing in 96, incrementing IX and end (instructions 24–32) [7]

Page 18 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language

Examiner’s Report

Question 2

(c) The majority of candidates were successful in completing the first line of the trace table. Many candidates
found it challenging to complete the rest of the table. There were a small number of completely correct
answers.

Page 19 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


May/June 2019.P11

5 (a) 1 mark for two correct ticks, 2 marks for three correct ticks

[2]

(c) 1 mark per bullet point

• Storing 0 in 300 (line 21)

• Loading 65 (line 28)

• Outputting A (line 29)

• Loading 0 (line 30), incrementing ACC (line 31) and storing in 300 (line 32)

• Incrementing IX (line 33)

• Loading 67 (line 24) and adding 33 (line (25)

• Outputting d (line 26)

• Loading 1 (line 30), incrementing ACC (line 31), storing in 300 (line 32) and incrementing IX (line 33)

Page 20 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language

[8]

Examiner’s Report

Question 5

(a) There were a small number of correct answers to this question. Many candidates need to improve their
understanding of the operation of a two-pass assembler.

(c) Tracing of assembly language programs is improving steadily and this one was generally very well done, with
many candidates providing completely correct solutions, neatly set out in the table provided. The most
common error was the inclusion of the word END in the OUTPUT column after the final statement.

Page 21 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


May/June 2019.P12

3 (c) 1 mark per bullet

• Storing 0 in 401 (line 51)

• Loading memory location 300, value 2 to ACC (line 52)

• Adding 64 to ACC to give 66 (line 55)

• Outputting B (line 56)

• Load 0 (line 57), increment ACC (line 58) and store 1 in 401 (line 59)

• Incrementing IX (line 60)

• Loading 5 (line 52), adding 64 (line 55), outputting E (line 56) loading 1 (line 57), incrementing ACC (line
58), storing 2 in 401 (line 59) and incrementing IX (line 60)

• Load 0 (line 52) and end

Page 22 of 23
Computer Science 9608
Topical Past Papers with Answers

1.4.4 Assembly Language


May/June 2019.P13

4 (a) 1 mark per bullet

• LDM #300 The (denary) number 300 is loaded (into the register)

• LDD 300 The contents of address 300 are loaded (into the register) [2]

Page 23 of 23

You might also like