You are on page 1of 2

MOCK TETS

QUESTION 1
a. Compute with example of moving data instruction below:

I . The command is to move data between registers is MOV ( move) ,


Example : MOV R2, R1

II. the instructions are Load and Store


Load (LDR) transfer data from memory to registers.
store (STR) transfers data from registers to memory.

III. Move from special register to register (MRS)


Move the contents of a special register to a general-purpose register
Example: MRS{cond} Rd, spec_reg

IV. Immediate data values are used literally in an instruction to change the contents of a
register or memory location
example:
b. If the stack pointer (SP) is initialized to 0x20000408. R0, R1, R2 and R12 registers are
initialized to 12, 3, 8 and 5 respectively

I. Show the content of the stack and the SP after the following sequence of operations:
PUSH {R0}
PUSH {R1-R2}
PUSH {R12}

SP= 0x200003F8 5
3
0x200003FC
8
0x20000400
12
0x20000404
0x20000408

II. Referring to the state register of the stack after part (i), show the content of the stack, the
SP and R3, R4 registers after the following operation

POP {R3-R4}

0x200003F8 5
3
0x200003FC
8
SP= 0x20000400
12
0x20000404
0x20000408

You might also like