I dabbled a tiny little bit in assembly, mostly for my own enjoyment. Here are a few exemples I made that use the Win32 API and the C standard library.
You should know what assembler is already and have some notions about it : the basic instructions, the registers, calling conventions (cdecl / stdcall) and their stack frames and entry/exit sequences).
All my examples use the GNU assembler (gas) and the GNU toolchain. It is free software and available on all three major platforms (Unix, Windows and Mac).
On Windows, you can get the tools by installing mingw (minimalist GNU for Windows) then make sure that mingw\bin is added to the %PATH% environment variable. In particular the tools we will use to program in assembler form the core of what is called the "binutils".
I will use the following conventions in the documentation of my assemby "functions":
%eax ->
means that %eax is an input of the function.-> %eax
means that %eax is an output of the function.~~ %eax
means that %eax is modified by the function (but is neither an input or an output).
box
Windows Dialog in Assemblerconsole
Windows Console Message in Assembler with win32 APIprintf
Windows Console Message in Assembler with C Standard Librarydll
Producing a DLL from Assemblershared
Shared Memory in DLLs and Executablesstatic
Producing a static library from Assembler
- x86 Architecture
- GAS Syntax
- x86 Instructions Reference
- x86 Instructions Description
- x86 Instructions Description (alt)
- win32 API calls
- win32 API calls export names
- binutils documentation
- Linkers and Loaders (simple)
- Linkers by Ian Lance Taylor (thorough)
- File extensions used in linking