Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d5192b
commit a23ec33
Showing
116 changed files
with
37 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
# Assembly | ||
*Assembly Programming and Computer Architecture for Software Engineers* Code Repository | ||
## Running the code | ||
### NASM | ||
For 32-bit:<br /> | ||
1. nasm -f elf32 prog.asm<br /> | ||
2. ld -e _main -melf_i386 -o prog.o<br /> | ||
<br /> | ||
For 64-bit:<br /> | ||
1. nasm -f elf64 prog.asm<br /> | ||
2. ld -e _main -melf_x86_64 -o prog.o<br /> | ||
*This page currently a work in progress as we are in the production stage with expected publication in July 2017* | ||
|
||
# Assembly Programming and Computer Architecture for Software Engineers (APCASE) | ||
|
||
#### * Code Repository * | ||
|
||
## About | ||
Welcome to the code repository for our book! *APCASE* is a very practical and comprehensive educational text for students, educators, and professionals seeking to learn about Assembly programming and computer architecture. But what makes our book helpful and unique? | ||
|
||
- Based on x86 and x86_64 architecture. | ||
- All programming examples are provided for three common assemblers: GAS, MASM, and NASM, which ensures both AT&T and Intel syntax. This allows for learning on any OS platform: Mac, Windows, and Linux. | ||
- Context and examples provided in both 32-bit and 64-bit, both of which are useful for a programmer. | ||
- Code-oriented and detailed overviews of function calls, floating-point operations (x87 through AVX), Inline Assembly, and system calls, all in one book. | ||
- The Appendices provide practical information and guide students in learning Assembly programming. | ||
- Chapter Supplements provide a deeper dive on topics as necessary. | ||
- Links to wikis, developer resources, and videos are provided to assist in further exploration of topics. | ||
- Attention, Programming, and Learning notes are placed throughout the text to guide the reader in beneficial ways. | ||
|
||
|
||
## FAQ | ||
|
||
Here are some example `nasm` and `as` commands to assemble and link in Linux. The GAS examples in the book assume you are using Xcode on macOS, so if you are using GAS on Linux, remember to change the exit routine. | ||
|
||
| Linux | NASM 32-bit | NASM 64-bit | | ||
|--------------|-----------|-----------| | ||
| Assemble | `nasm -f elf32 prog.asm` | `nasm -f elf64 prog.asm` | | ||
| Link | `ld -e _main -melf_i386 -o prog prog.o` | `ld -e _main -melf_x86_64 -o prog prog.o` | | ||
| Exit Routine | `mov eax, 1`<br>`mov ebx, 0`<br>`int 80h` | `mov rax, 60`<br>`xor rdi, rdi`<br>`syscall` | | ||
|
||
|
||
| Linux | GAS 32-bit | GAS 64-bit | | ||
|--------------|-----------|-----------| | ||
| Assemble | `as --32 -o prog.o prog.s` | `as --64 -o prog.o prog.s` | | ||
| Link | `ld -e _main -melf_i386 -o prog prog.o` | `ld -e _main -melf_x86_64 -o prog prog.o` | | ||
| Exit Routine | `mov $1, %eax`<br>`mov $0, %ebx`<br>`int $0x80` | `mov $60, %rax`<br>`xor %rdi, %rdi`<br>`syscall` | | ||
|
||
|