wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ARM Instructions Set Quiz

Total questions: 30

Worksheet time: 34mins

Name
Class
Date
1.

Which of the following is a conditional branch instruction?

a)

BX

b)

BNE

c)

BL

d)

SWI

2.

Which of the following best describes the role of the Program Counter (PC) in an ARM processor?

a)

It stores the result of arithmetic operations

b)

It holds the current status flags (N, Z, C, V)

c)

It contains the memory address of the next instruction to execute

d)

It is used to perform logical AND operations

3.

What must be done before calling another subroutine to preserve the Link Register?

a)

Push LR to the stack

b)

Pop LR from the stack

c)

Reset LR to zero

d)

Store LR in a general-purpose register

4.

What is a unique feature of the ARM instruction set regarding execution?

a)

Only branch instructions can be conditional

b)

Instructions cannot be executed in parallel

c)

All instructions are executed unconditionally

d)

Instructions can be made conditional

5.

What does the SWI instruction do in ARM?

a)

Stores data in memory

b)

Executes a conditional jump

c)

Branches to a subroutine

d)

Performs a software interrupt

6.

In the context of ARM, what does the term 'nested subroutines' refer to?

a)

Subroutines that execute in parallel

b)

Subroutines that call other subroutines

c)

Subroutines that call themselves

d)

Subroutines that do not return

7.

What is the result of the instruction 'ADDEQ r3,r2,r4' if the condition is not met?

a)

r3 is set to zero

b)

r3 is set to r2 - r4

c)

r3 remains unchanged

d)

r3 is set to r2 + r4

8.

Which instruction is used to return from a subroutine in ARM?

a)

SWI

b)

BL

c)

BNE

d)

BX LR

9.

Which of the following conditions can be checked using conditional branch instructions?

a)

Greater Than

b)

Less Than or Equal To

c)

Not Equal

d)

All of the above

10.

What is the effect of using 'PUSH {LR}' before calling another subroutine?

a)

It branches to the subroutine

b)

It loads a new value into LR

c)

It clears the LR register

d)

It saves the current value of LR to the stack

11.

What does the instruction 'MLA r3,r4,r2,r8' do?

a)

Multiplies r4 and r2, then adds r8

b)

Branches to a label

c)

Adds r4 and r2, then multiplies by r8

d)

Loads a value into r3

12.

CMP r1, r2

BEQ equal_label

What happens if r1 == r2?

a)

It skips the next instruction

b)

It branches to equal_label

c)

It stops execution

d)

It stores r1 in r2

13.

What does the following program compute if r2 = 0 and r4 = 0?
CMP r2, #0

BNE S1

S1: CMP r4, #0

ADDEQ r3, r2, r4

ADDEQ r3, #12

a)

r3 = 12

b)

r3 = r2 + r4 + 12

c)

r3 = r2 - r4

d)

r3 = 0

14.

What is the function of CMP r2, #0 followed by BEQ label?

a)

Branch to label if r2 > 0

b)

Branch to label if r2 == 0

c)

Always branch to label

d)

Compare and jump if negative

15.

In this code:

CMP r2, r4

BNE S1

S1: CMP r4, r7

MLA r3, r4, r2, r8

What condition ensures execution of MLA?

a)

r2 != r4

b)

r4 == r7

c)

r4 != r7

d)

r2 == r7

16.

Consider this logic:
CMP r2, #0

CMPEQ r4, #0

ADDEQ r3, r2, r4

SUBEQ r3, #12

When will SUBEQ execute?

a)

When r2 == 0 only

b)

When r4 == 0 only

c)

When both r2 and r4 == 0

d)

Never

17.

What is the content of LR after executing BL func?

MOV r0, #1

BL func

MOV r1, #2

func:

ADD r0, r0, #1

BX LR

a)

Address of func

b)

Address of BX LR

c)

Address of instruction after BL func

d)

0x00000000

18.

Which is the correct way to preserve the return address in a nested subroutine call?

a)

MOV LR, PC

b)

LDR LR, [SP]

c)

PUSH {LR} before next BL

d)

No need to preserve

19.

What will happen in this sequence?
BL func1

BL func2

func1:

ADD r0, r0, #1

BX LR

func2:

SUB r0, r0, #1

BX LR

a)

Only func1 executes

b)

func2 overwrites LR; return address lost from func1

c)

func1 and func2 execute properly

d)

func1 doesn’t return

20.

MOV R0, #5

MOV R1, #0x2000

STR R0, [R1]

LDR R2, [R1]
What will be the value stored in R2?

a)

5

b)

0x2000

c)

0

d)

10

21.

MOV R0, #0x3000

MOV R1, #10

STR R1, [R0], #4

LDR R2, [R0]

Assume memory at 0x3004 contains 0x12345678.

What is the value of R2 after execution?

a)

10

b)

0x3004

c)

0x12345678

d)

0

22.

MOV R0, #0x4000

LDMIA R0, {R1, R2, R3}


Assume memory:

0x4000 = 0xAAAA0001

0x4004 = 0xBBBB0002

0x4008 = 0xCCCC0003

What will be the values of R1, R2, and R3 after execution?

a)

R1=0xAAAA0001, R2=0xBBBB0002, R3=0xCCCC0003

b)

R1=0x4000, R2=0x4004, R3=0x4008

c)

R1=0x00000001, R2=0x00000002, R3=0x00000003

d)

All registers remain unchanged

23.

MOV R0, #0xF0

MVN R1, R0

What value is stored in R1?

a)

0xF0

b)

0xFFFFFF0F

c)

0x0000000F

d)

0xFFFFFFF0

24.

MOV R1, #0x80

LSR R2, R1, #2

What is the result in R2?

a)

0x20

b)

0x40

c)

0x08

d)

0x10

25.

MOV R0, #15

MOV R1, #5

SUB R2, R0, R1

ADD R3, R1, R2

What is the value in R3 after execution?

a)

15

b)

10

c)

5

d)

20

26.

MOV R1, #0x0F

MOV R2, #0xF0

AND R3, R1, R2

ORR R4, R1, R2

What will be the values in R3 and R4?

a)

R3 = 0xF0, R4 = 0x0F

b)

R3 = 0x00, R4 = 0xFF

c)

R3 = 0xFF, R4 = 0x00

d)

R3 = 0xF0, R4 = 0xFF

27.

MOV R0, #10

MOV R1, #5

ADD R2, R0, R1

MOV R3, #0x2000

STR R2, [R3]

LDR R4, [R3]

What is the final value stored in R4?

a)

10

b)

5

c)

15

d)

0x2000

28.

MOV R0, #3

MOV R1, #4

BL multiply

MOV R4, R2

multiply:

MUL R2, R0, R1

BX LR

What is the value of R4 after execution?

a)

7

b)

12

c)

0

d)

1

29.

MOV R1, #2

LSL R2, R1, #2

ADD R3, R2, #1

What is the final value in R3?

a)

9

b)

10

c)

8

d)

7

30.

MOV R1, #10

MOV R2, #15

CMP R1, R2

BGT greater

MOV R3, #0

B end

greater:

MOV R3, #1

end:

What is the value in R3 after execution?

a)

0

b)

15

c)

1

d)

10