exercises for learning assembly language
- Assembly 93.2%
- Shell 6.8%
| chap06 | ||
| chap07 | ||
| chap08 | ||
| chap09 | ||
| chap10 | ||
| .gitignore | ||
| chap3ex1-64bit.s | ||
| chap3ex1.s | ||
| chap3ex2.s | ||
| chap3ex2a.s | ||
| chap3ex2b.s | ||
| chap4ex1.s | ||
| chap4ex2.s | ||
| chap5ex1.s | ||
| chap5ex1_stdin.s | ||
| README.md | ||
| return_word_size.s | ||
| run.sh | ||
Programming From The Ground Up
This book teaches programming using Linux Assembly Language.
The Exercises are written in 32-bit x86 assembler. This is kind of obsolete but does the purpose of teaching how the machine works.
Table of Exercises
| Program | Purpose |
|---|---|
| chap3ex1 | exit system call |
| chap3ex2 | find max value |
| chap4ex1 | function for power |
| chap4ex2 | recursive factorial function |
| chap5ex1 | toUpper function with file args |
| chap06 | reading and writing records |
| chap07 | records with error handling for add-year |
| chap08/hello | hello world linking libc.so |
| chap08/librecord | creating a dynamic library |
| chap09/memory-1.0 | memory manager like malloc |
| chap09/memory-64-bit | 64-bit malloc and free |
| chap09/records | read-records using memory manager |
| chap10 | converting numbers to strings |
Install 32 bit version libc
$ apt-get install libc6:i386 libc6-dev-i386
Assemble the source to an object file
$ as --32 chap3ex1.s -o exit.o
Link the object file to an executable
$ ld -m elf_i386 exit.o -o exit
Do all and run
$ as --32 chap3ex1.s -o object.o && ld -m elf_i386 object.o -o prog && ./prog