aarch64-pgaarch64 playgroundsheet 04 · learn
04 · learn
Lessons
Step-by-step lessons that pair a short reading with a live, runnable editor.
- 4.1Registers and immediatesHow registers hold values, and how to load a constant too wide for one instruction.registersimmediates
- 4.2The stack and the frame pointerHow a function claims a stack frame, saves fp and lr, and reaches its locals by offset.stackframe pointer
- 4.3Printing a string with printfHow to store a string in .data, load its address, and hand it to printf.printing
- 4.4Printing integers and charactersHow format specifiers such as %d and %c decide what printf does with an argument.printingformat strings
- 4.5Printing a variable from .dataHow to load a value out of .data with two ldr instructions and print it.printingvariables
- 4.6Conditionals with cmp and b.condHow cmp sets the condition flags and how b.cond reads them to build if-else.conditionalsbranching
- 4.7Pre-test loopsHow to build a for or while loop, where the condition is checked before every pass.loopspre-test loop
- 4.8Post-test loopsHow to build a do-while loop, where the body always runs at least once.loopspost-test loop