In this video, I compare a simple C program with the compiled machine code of that program.
Support me on Patreon: https://www.patreon.com/beneater
Amazon Auto Links: No products found.
In this video, I compare a simple C program with the compiled machine code of that program.
Support me on Patreon: https://www.patreon.com/beneater
Amazon Auto Links: No products found.
Author: Ben Eater
There is a GCC option to output assembly code, not ready linked binary.
great clip sir!
x=y and y=z look stupid, real person coding in assembly would probably do it without esi.
Gnu C Compiler. Except it’s not. It’s Gnu Collection Compiler. 😉
virgin spotted
Is assembly the same think as machine code?
Why oh why AT&T? 😀
Wow great teaching.. thank you so much..
Awesome video.
Awesome video, thank you !
A bad teacher.
Hey Ben! Thanks for all the great videos so far! As far as using paper, please continue to do so! My C++ course in college was done on paper as well as on the computer and the paper really helps drive home a lot of stuff and makes it more accessible in a better way for learning and teaching.
Understanding prologue of the function, calling conventions, and how all of this relates to the stack is the most important part of being able to read disassembled code. When you brush it all off with, “just some stuff,” or “I don’t know what it does,” you might as well not bother with the video.
Don’t know if anyone else addressed it but I’m nearly 100% positive that movb $0x0, %al is storing a function code for the system call to printf()
great explained!
This might be an understatement, but; well, shit this sure is cool as hell.
imagine a person making a full-fledged modern game using the machine language
I dont understand why you need to move Y to the esi register before moving it into the x. Is there some reason it cant just go directly from x to y
“movl” is “move L”, “move long”, not “move one”, but otherwise cool tutorial and please keep using paper!
Great Video
Can someone explain me, why “-0xc(%rbp), %esi” => “%esi, “-0x8(%rbp)” wasn’t just compiled to “-0xc(%rbp), -0x8(%rbp)” ?
Means, why does it move the value to a temporary memory slot first instead of jsut moving it directly to the target location?
10 minutes to explain? just display the C code along with the machine code and all will become clear in 60 seconds
Honestly until I watched this video I never really realized what local variables being allocated on the stack actually ‘meant’ (I kinda got it but couldn’t visualize it!) This really opened my eyes to how that works!
Trump’s voice?
free c language classes or computer classes , please reply
nobody does better than you
Amazing video! I like the pen and paper. It makes things much easier to follow and leaves room for the side notes. I, like most programmers (just a hobby, not professional), develop in a high level language so seeing how it transfers over into assembly was extremely interesting especially with how you explained it. I’ve been looking at a lot of assembly tutorials because I’m planning on trying to make a small scale programming language just to learn more about programming and how that software is “interpreted” by the CPU. This is by far the best thing I’ve found on the internet. Earned a like and sub from me! My new favorite computer science channel.
great stuff
The otool program can run on MAC unix and or Linux
if only my it teacher would have been half as gifted as you are^^
thx
Um yeah… On the left is not machine language it’s assembly language.
the real matrix bts
Never once did I hear that x represents hexadecimal numbering. He kept referring to x8 and xc. It would be a lot more understandable if he just said that there’s a numbering system for computers that goes from 0-15 called hex and it’s identified by a 0x preceding the value. Dec 10 = Hex A and so on. In the flat address space, every integer is represented in 4 bytes (2^32). So it’s 4 bytes 8,9,10,11 (or 8,9,a,b) and the next 4 bytes starts at 0xc.
I’d love to see more videos like this, that go through each instruction, but perhaps even more thoroughly.