There are multiple subprojects in the subprojects
folder:
- o - subprojects
+ - o subproj01
+ - o bin
+ - o main
+ - o src
+ - o main.nasm
+ - o makefile
...
+ - o subproj02
...
...
Within each subproject bin
contains the executable main
and src
holds the NASM source code file main.nasm
and
potentially more source code files. The makefile
defines the build and clean procedure for each subproject.
- CPU with IA-32 architecture
- macOS v10.7
- nasm
- Xcode commadline tools
- make
The following tools available as scripts:
command | tool |
---|---|
./build <subproject> |
build the executalbe (must be performed before running) |
./run <subproject> <args> |
run the executalbe |
./debug <subproject> |
debug the executable with LLDB |
./disassemble <subproject> [<label>] |
disassemble text and data section of the executalbe (starting at <label> ) |
./symbol_table <subproject> |
show symbol table of executable (may not be complete) |
./stats <subproject> |
show stats (size of executable and SLOC) |
./clean <subproject> |
remove executable and temporary build files |
The subprojects are:
name | description |
---|---|
minimal_working_example |
simplest valid program possible |
nasmXX |
inspired by the lessons on asmtutor.com (numbers do not match) |
Further useful commands are:
command | description |
---|---|
file <file path> |
get details about the file type (beyond the extension, e.g. architecture of executables) |
- complete NASM instruction set reference
- system calls on MAC OS X (32bit and 64bit) Note: Alignment for 32bit can be 8 bytes instead of 16 bytes!
- more on system calls on MAC OS X for 64bit
- system call table for MAC OS X
- system call table for macOS (64bit)
- IA-32 calling convention
- LLDB command cheat sheet
- System V ABI for i386 (conventions)
- GNU make documentation