1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
How to start a macro?
.macro
How to end a macro?
.endm
where are macros in code?
above .data section
How to name macros?
.macro thisISMyMacroName
How to pass registewrs and varibles to macros?
.macro thisISMyMacroName src_reg1, canBeAnything, src_reg2
How to acces the varible you passed into the macro?
EX: CMP \src_reg1,
\canBeAnything
why use macros?
Increase reusability
No need to use branching
Updating registers
Having modular codes
How to call a subroutine?
BL subroutineName
translation:
LR=PC+4
PC=label
How to exit a subroutine?
BX LR
translation:
PC=LR
What are registers r0-r3 used for?
arguments and return value, these are where you want your final answers when exiting a subroutine. also the registers you want to use when passing in information to a subroutine.
What are registers r4-r11 used for?
General purpose registers, you can use for anything in a subroutine but its proper etiquette to push and pop these when exiting a subroutine.
what is register r12 used for?
(IP) intra procedure call register
what is register r13 used for?
(SP) Stack pointer
what is register r14 used for?
(LR) link register, like bread crumbs leaving a trail in your code to go back to
what is register r15 used for?
(PC) program counter
How many bits can each r0-r3 register hold when passing in arguments?
each 32-bits, combined 128-bits