A talk by Ciro Durán (@chiguire)
<ciro.duran@gmail.com>
December 2015
Press 's' for the speaker notes
My name is Ciro Durán, and during the next hour we will be talking about assembly.
Let's honour the fallen from the Ringworld and prevent another disaster like this
mov eax, [ebx]
→ gets value from address specified in ebxmov [var], ebx
→ stores register value in address specified in constantmov eax, [esi-4]
→ gets value from address specified in ebx ± 4 bytesmov [esi+eax], foo
→ stores value in memory to address at esi + eaxmov edx, [esi+4*ebx]
→ gets value from address specified in in esi + 4 * ebxcdecl, stdcall.
Here's Microsoft Assembler, MASM32
We can create a project automatically
It generates some boilerplate code
With a convenient batch file that assembles and links the code
Here's the build output
And here's the code in action
The combination of the symbols and disassembly might assist you when debugging.
Let's compile a simple Hello World console application
Let's set a breakpoint, run it, and go to disassembly
Woah, that's a lot of instructions, what's 945858h?
Turns out we can watch it and see it's the pointer to the string
“Although, some people can program in assembly language and understand the intricacy of the spacecraft [Voyager programme], most younger people can't or really don't want to.” - Suzanne Dodd (NASA JPL)
You can also practice here http://challenges.re/
Your questions are welcome!
http://ciroduran.com
@chiguire
ciro.duran@gmail.com
Browse this talk (press 's' for notes) at
http://ciroduran.com/talks/assembly