Six original Cambridge-style questions on binary shifts and bit masking with the 9618 instruction set, with mark-scheme style solutions.
Describe the difference between a logical shift, an arithmetic shift and a cyclic shift.
The ACC holds the unsigned value 00110101. Give the contents of the ACC after (a) LSL #2 and (b) LSR #3, each applied to the original value. State the effect of each shift on the denary value.
The 8-bit two's complement value 10011000 is shifted 2 places to the right using an arithmetic shift. Give the result in binary and in denary.
Bit 3 of the byte at address STATUS switches on a pump. Write assembly language instructions, using the 9618 instruction set, to switch the pump on without changing any other bit.
Bit 6 of the byte at address SENSOR is 1 when a door is open. Write assembly language instructions, using the 9618 instruction set, to jump to the label DOOROPEN if the door is open.
The ACC holds 11010010. Give the contents of the ACC after XOR B00001111 and explain the effect of this mask.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.