Sebastian Theophil

Passive ARM Assembly Skills for Debugging, Optimization (and Hacking)

How does your C++ code actually run on Apple Silicon? Learn to read ARM assembly to debug, optimize, and understand the compiler's secrets.

Passive ARM Assembly Skills for Debugging, Optimization (and Hacking)
#1about 2 minutes

Core concepts of ARM assembly language

Assembly language consists of instructions and operands like registers, immediate values, memory addresses, and labels.

#2about 2 minutes

Overview of ARM CPU architecture and memory

Modern ARM CPUs like the Apple M1 feature numerous 64-bit registers and a multi-level cache system to mitigate slow main memory access.

#3about 3 minutes

Implementing a Fibonacci sequence loop in assembly

A practical example demonstrates basic ARM instructions like MOV, ADD, SUB, CMP, and B.NE for arithmetic and control flow.

#4about 3 minutes

Comparing handwritten assembly to optimized compiler output

The compiler often generates more efficient code than a direct translation, such as converting an incrementing for-loop into a decrementing counter.

#5about 4 minutes

Managing local variables using the stack

The stack provides fast, temporary memory for local variables, managed by the stack pointer (SP) and accessed with store (STR) and load (LDR) instructions.

#6about 4 minutes

How function calls work in ARM assembly

Function calls use the Branch and Link (BL) instruction, which saves the return address in the link register (X30) and transfers control.

#7about 2 minutes

The ARM procedure call standard and ABI

The Application Binary Interface (ABI) defines strict rules for register usage, including which registers pass arguments, return values, and must be saved by the caller or callee.

#8about 4 minutes

Loading 64-bit pointers with 32-bit instructions

ARM uses a two-step process with ADRP and ADD instructions to load a full 64-bit address by first getting the memory page and then the offset within it.

Related jobs
Jobs that call for the skills explored in this talk.

job ad

Saby Company
Delebio, Italy

Intermediate

d

Saby Company
Delebio, Italy

Junior

Featured Partners

Related Articles

View all articles
CH
Chris Heilmann
All the videos of Halfstack London 2024!
Last month was Halfstack London, a conference about the web, JavaScript and half a dozen other things. We were there to deliver a talk, but also to record all the sessions and we're happy to share them with you. It took a bit as we had to wait for th...
All the videos of Halfstack London 2024!
CH
Chris Heilmann
Dev Digest 138 - Are you secure about this?
Hello there! This is the 2nd "out of the can" edition of 3 as I am on vacation in Greece eating lovely things on the beach. So, fewer news, but lots of great resources. Many around the topic of security. Enjoy! News and ArticlesGoogle Pixel phones t...
Dev Digest 138 - Are you secure about this?
Dev Digest 113 - Debugging above the cloud
Hello there and welcome to Dev Digest 113! This time, we got an old friend in the sky back, jQuery asks us to upgrade and AI is eating the web. Also, are you sure the LLM you use is secure against code injection?News and ArticlesGood news everyone! N...
Dev Digest 113 - Debugging above the cloud
Dev Digest 123 - Easy as A, B, C1
Hello there, lots to talk about in terms of security and things in the AI world. And the WeAreDevelopers World Congress is very, very soon, so we're busy planning CODE100 and finding moderators - all of which you could help us with!News and ArticlesL...
Dev Digest 123 - Easy as A, B, C1

From learning to earning

Jobs that call for the skills explored in this talk.