UA04 - 4.2 Assembly Language
UA04 - 4.2 Assembly Language
Paper | 1
(a) The op codes LDM and LDD are used to load a register.
The op code LDM uses immediate addressing, and the op code LDD uses direct addressing.
Describe what happens when the following instructions are run.
LDM #300 ………..……………...………………………………………….…………….………...
………………………..……………...…………………………………….…….………...….……...
LDD 300 ………….……………...………………………………………….…………….………...
………………………..……………...…………………………………….…….………...….…...[2]
(b) Assembly language instructions can be grouped by their purpose.
The following table shows four assembly language instructions.
Tick (✓) one box in each row to indicate the group each instruction belongs to.
Paper | 1
ACC...................................................................[1] 497 92
498 486
(iii) LDX 500 499 489
ACC...................................................................[1] 500 496
501 497
(iv) LDI 500 502 499
ACC...................................................................[1] 503 502
(b) Each machine code instruction is encoded as 16-bits (8-bit op code followed by an 8-bit operand).
Write the machine code for the following instructions:
LDM #17
LDX #97
[4]
(c) Using an 8-bit operand, state the maximum number of memory locations, in denary, that can be directly
addressed.
………………………..……………...…………………………………….…….………...….…...[1]
(d) Computer scientists often write binary representations in hexadecimal.
(i) Write the hexadecimal representation for this instruction:
………………………..……………...…………………………………….…….………...….…...[2]
A second instruction has been written in hexadecimal as:
05 3F
(ii) Write the equivalent assembly language instruction, with the operand in denary.
………………………..……………...…………………………………….…….………...….…...[1]
(e) Show the contents of the Accumulator after the execution of the instruction:
LDX 501
IX 0 0 0 0 0 0 1 1
ACC:
Explain how you arrived at your answer.
……………………..……………...………………………………………….…………….………...
……………………..……………...………………………………………….…………….………...
………………………..……………...…………………………………….…….………...….…...[2]
(f) Show the contents of the Accumulator after the execution of the instruction:
LDX 503
ACC: