Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
brianrhall committed Feb 11, 2017
1 parent 6d5192b commit a23ec33
Show file tree
Hide file tree
Showing 116 changed files with 37 additions and 51 deletions.
40 changes: 0 additions & 40 deletions Appendix_C_Disassembly/Program_C.1/fixed.asm

This file was deleted.

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.
48 changes: 37 additions & 11 deletions README.md
@@ -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` |


0 comments on commit a23ec33

Please sign in to comment.