Past-paper question · 2016 October-November · Paper 42 · Q3(b)

Question 3(b) 2016 · October-November · Paper 42 · 12 marks

Original past-paper question for 3(B)
Original past-paper question for 3(B)
Original past-paper question for 3(B)
Original past-paper question for 3(B)
Original past-paper question for 3(B)
Original past-paper question for 3(B)
Original past-paper question for 3(B)
Reveal official mark-scheme answer Official mark-scheme answer for 3(B)Official mark-scheme answer for 3(B)

Official answer for Question 3

Part (b)

Part (b)

1 mark per line

✓
START: LDR
✓
#0
✓
// initialise index register to zero

Question 1

✓
LDX
✓
WORD
✓
// get first character of WORD

Question 1

✓
AND
✓
MASK1
✓
// ensure it is in upper case using MASK1

Question 1

✓
OUT
✓
// output character to screen
✓
INC
✓
IX
✓
// increment index register

Question 1

✓
LDM
✓
#1
✓
// load 1 into ACC

Question 1

✓
STO
✓
COUNT
✓
// store in COUNT

Question 1

✓
// load next character from indexed address
✓
LOOP: LDX
✓
WORD

Question 1

✓
WORD
✓
OR
✓
MASK2
✓
// make lower case using MASK2

Question 1

✓
OUT
✓
// output character to screen
✓
LDD
✓
COUNT
✓
// increment COUNT
✓
INC
✓
ACC
✓
//

Question 1

✓
STO
✓
COUNT
✓
//
✓
CMP
✓
LENGTH
✓
// is COUNT = LENGTH?

Question 1

✓
JPN
✓
LOOP
✓
// if FALSE – jump to LOOP

Question 1

✓
END
✓
// end of program

Question 1

✓
COUNT: 0
✓
MASK1: B11011111
✓
// bit pattern for upper case

Question 1

✓
MASK2: B00100000
✓
// bit pattern for lower case
✓
LENGTH: 4
✓
WORD: B01100110
✓
//ASCII code in binary for 'f'
✓
B01101000
✓
//ASCII code in binary for 'r'
✓
B01000101
✓
//ASCII code in binary for 'E'
✓
B01000100
✓
//ASCII code in binary for 'D'
✓
[max 12]
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International A Level – October/November 2016
✓
9608

Question 42

Mark scheme 9608_w16_ms_42.pdf →

Show text version of question

Question 3

Part (b)

Part (b)

Complete the program using op codes from the given instruction set.

Op Label Operand Comment code START: // initialise index register to zero // get first character of WORD // ensure it is in upper case using MASK1 // output character to screen // increment index register // load 1 into ACC // store in COUNT LOOP: // load next character from indexed address WORD // make lower case using MASK2 // output character to screen // increment COUNT starts here

// is COUNT = LENGTH ? // if FALSE, jump to LOOP // end of program COUNT: MASK1: // bit pattern for upper case MASK2: // bit pattern for lower case LENGTH: 4 WORD: B01100110 // ASCII code in binary for 'f' B01110010 // ASCII code in binary for 'r' B01000101 // ASCII code in binary for 'E' B01000100 // ASCII code in binary for 'D'

[12]

Question 14

Question 4 begins on page 15.

Question 15

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w16_qp_42.pdf

Keep practising this topic