Getting Started with ARM Memory Management Using 'The Stack' | R13/SP Control in ARM Assembly

preview_player
Показать описание
In this video, we talk about the stack structure, how it applies to computer engineering, and how it gets used in ARM assembly. By the end of this video, you'll be able to write assembly that uses function calls and functions that use stack frames. Use of the stack is extremely important to writing good clean assembly, and understanding how variable scope works in other programming languages, such as C or C++.

Hit subscribe to be alerted about more videos like this!

Timestamps:
0:00 Intro
0:10 What is a Stack
0:50 Who Cares?
1:35 Calling Conventions
2:43 Let's Visualize!
5:49 Let's Code
11:54 Outro
Рекомендации по теме
Комментарии
Автор

I hope ARM is paying you for this. This is one of the best introductions to Assembly yet alone ARM Assembly, I've ever seen!

Dygear
Автор

FINALLY! I've been watching your videos since the start of this year and was waiting for ARM stack

zuhayr
Автор

I watched it many times, and every time I watched, I learned something new. Thank you so much!

PauloRoberto-qbwm
Автор

I come from a C background and am trying to learn ARM assembly (specifically ARMv7-A but at this point the subtle details don't matter) and this series is super helpful. But I would learn better if we were solving a problem (e.g. how to code for a "find and stdout print the greatest common denominator of two stdin user-supplied integers at the command line") from a top-level and working downwards. e.g. we start by planning how to solve it in high-level terms, then lower level, and then in pseudo-assembly (like assembly but more readable) and then finally in actual ARM assembly. When we start from basic assembly code into more advanced assembly code, it is possibly for me to learn and follow but it's hard for me to "care" or "see the end goal". Working from a high level and incrementally work out way down to the machine instruction wire would also allow the tutor to introduce technical concepts and new syntax bit by bit, rather than being combarded with ".section .text .ascii label: pop {r0, fp} bx bl b ldr add le" etc syntax all at once.

gregoryfenn
Автор

I have started with asm one week ago and i need to say, its really a pain in... the user guide of arm is ok but your videos are great. Subscribed :)

frankwallner
Автор

These are fantastic! I was looking forward to this one, and it really helped me wrap my head around the stack concept at this level. I'm finally getting around to genuinely learning ARM, and even though I'm using a pretty great book (Programming with 64-Bit ARM Assembly Language by Stephen Smith), it's just not possible to get the same level of illustration in a book as with these types of videos. Any chance you'll do a video or two on debugging with gdb? It's such a useful tool that I've just never managed to get an intuitive feel for.

billzoaiken
Автор

There's a detail involving thumb interlink code that seems absent and the bx instruction. Is "mov pc, lr" or "pop <stuff including pc>" proper in the general case where the caller may have been thumb?

TurboGoth
Автор

Excellent series, Do you have one that shows the different ways arguments are passed and returned from functions?

lornebonnell
Автор

Thank you..Thank youu...Thank you so much... 😀👍

shivangdesai
Автор

great video, can you make video on how to create an ARM code hex and upload on arm chip like lpc21xx, , stm32 etc.,

AmitSharma-bmqj
Автор

How does this work in aarch64? As I understand it push & pop are replaced by stp/ldp... But those instructions require an address too. Am I missing something? Or does the 64-bit mode require more manual control?

AuctorisVideo
Автор

I am new to arm. It seems that you use armv7. Pop and push are not supported in armvv8. I woule love to see a version of this video for 64 bit arm in armv8.

I would like to have an example with proper calling convention.

TheSleeperMusic
Автор

Funny what you have in memory ;)
These values are used by memory managers you find with runtimes like Java (0x0cafebabe), MSVC C/C++ (0xdeadbeef), Mac-O / MacOS (0xfeedface)...
And in debug mode only !! (putting these values in memory cost precious cycles but can help track bugs)...

Normally you'll rather find random values or even zeros if the stack is in BSS what I would expect with multitasking/modern computers (since the early 90s).
And they have nothing to do with ARM assembly ;)

TomCarbon
Автор

Can you suggest a book/document to study this stuff? Thanks in advance

franckciccio
Автор

Great video. Loved the diagrams. You mentioned that you did not need a frame for exit because you are not modifying callee saved registers, but isn't r7 one of those? This is a moot point because it is exit. Although someday if this code is copied as a base for a different function, this might be missed.

larrygass
Автор

Why did you not push fp onto the stack in hello_world? Was it because we dont care about it, as we are exiting the program anyways?

AmanSingh-spbi
Автор

Wow! Can this architecture allow you to control the PC register directly? If yes, this can lead viruses to easily take control of your machine.

fuscatube
Автор

Is there a way I can do this without an arm chip? Like an emulator

jordanlake
Автор

That's funny how it works with or without push or pop the same way

hensonk
Автор

This code does not work on an Apple M1 chip. Any tips?

xhhdbdhsb
welcome to shbcf.ru