Professional Documents
Culture Documents
1.4.4 Assembly Language (Answers)
1.4.4 Assembly Language (Answers)
[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
(iii)
[1]
Page 1 of 23
Computer Science 9608
Topical Past Papers with Answers
• 120 + 6 = 126
[6]
9 (a)(i) One mark for the contents of the accumulator and one mark for the reason. [2]
Reason:
Address is 60
Page 3 of 23
Computer Science 9608
Topical Past Papers with Answers
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.
(b)
Page 4 of 23
Computer Science 9608
Topical Past Papers with Answers
• Instruction 20
• Instructions 21 and 22
• Instruction 23
• Instructions 24 and 25
• Instructions 31 and 32
8 (a)(i) [1]
(ii) One mark for answer and two marks for explanation
[4]
Page 5 of 23
Computer Science 9608
Topical Past Papers with Answers
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
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.
• So address 107 is the address from which to load the data [3]
[6]
Page 7 of 23
Computer Science 9608
Topical Past Papers with Answers
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.
4 (b)
[3]
Page 8 of 23
Computer Science 9608
Topical Past Papers with Answers
(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)
[3]
Page 9 of 23
Computer Science 9608
Topical Past Papers with Answers
14 [1]
5E [1]
[2]
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
4 (b)
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
(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
Maximum 3 in total
Macro
• 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
• By example [3]
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
Table entries:
• EndProg
• 2 × Unknown
•9
• 14
•8
Numbering:
• Number given for EndProg is next number in sequence to relative address of Value
Page 13 of 23
Computer Science 9608
Topical Past Papers with Answers
[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
• Loading, incrementing accumulator and storing in 204 (instructions 73, 74 and 75)
• Incrementing accumulator, storing in 204 and incrementing index register, loading 130 (instructions 74–79)
Page 15 of 23
Computer Science 9608
Topical Past Papers with Answers
Absolute addressing:
• The operand is a numeric address // The numeric address is given // referring directly to a memory
location
Symbolic addressing:
• 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
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
Oct/Nov 2018.P13
• 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
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
5 (a) 1 mark for two correct ticks, 2 marks for three correct ticks
[2]
• Loading 0 (line 30), incrementing ACC (line 31) and storing in 300 (line 32)
• 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
[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
• Load 0 (line 57), increment ACC (line 58) and store 1 in 401 (line 59)
• 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)
Page 22 of 23
Computer Science 9608
Topical Past Papers with Answers
• 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