ARM64 Flashcards

(13 cards)

1
Q

Was is ARM assembly faster than your typical x86?

A

Because of its Load/Store architecture. Memory is only accessed through specific instructions rather than part of most instructions. Allowing for fast and efficient instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two states of ARM64?

A

Aarch64 and Aarch32

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s the difference between Aarch64 and Aarch32

A

Aarch64 can both 64 & 32 bit registers where’s Aarch32 can only access 32 bit registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

x0 - x7 are typically what kind of registers?

A

They’re 64 bit registers, usually for arguments on the stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is x29 (fp)?

A

This register stores a pointer to the bottom of the frame. It marks the beginning of a new stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is x30 (lr)?

A

This is the link register. It stores the return address of a call. Allows a program to resume after a function call has finished. Essentially it saves the current progress of the program so it knows where to return to after a function has finished being called.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When looking at registers, what is the difference between a register with ‘w’ and ‘x’? For example x1 and w1.

A

x refers to the entire 64 bits where as w just refers to the lower 32 bit portion.

Essentially w1 is the first 32 bits of x1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When memory grows (the stack gets bigger) what direction does it grow?

A

Downwards, towards the lower addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is x31 (sp)?

A

This is the stack pointer, it refers to the top of the stack. The “top plate”. It is the lowest address in the stack and going past this will be out of bounds causing an error.

It will be used for storing local variables. We could cause a stack overflow or corrupt adjacent memory if we exceed the limit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What’s the register PC?

A

Program counter. This stores the memory address of the next instruction to execute. It knows this by offsetting the number of bytes the current instruction is.

If the current instruction is 4 bytes long then PC = PC + 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is usually the first register in an instruction (except certain store functions)

A

The destination, the rest are source.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do the stp and ldp instructions have in common?

A

They both are working on two registers at a time.

STP -> Store pair
LDP -> Load pair.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Where would you commonly find the instruction RET?

A

The function epilogue. This is the end of the function and we are turning back before the function call. We know the address of this as it’s stored in x30 (lr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly