NASM Programming Notes
NASM Programming Notes
Assembler converts .asm to .o files. Linker converts .o files to executables (.exe or a.out).
4. Run: ./program
Assembler Directives
.data, .bss, .text, global, extern, section - used to manage memory and program structure.
Use of Counter
Macro
Example:
%macro display 1
mov rsi, %1
call print_string
%endmacro
Procedure
A function called with 'call' and exited with 'ret'. Used for code reuse.
Macro vs Procedure
Unconditional: jmp
NASM Programming Concepts - Summary Notes
Swap Instruction
xchg AX, BX
Program Logic
BT Instruction
0x0A
Positive/Negative Check
NASM Programming Concepts - Summary Notes
DIV Instruction
PUSH Instruction
Hex vs BCD
Operating Modes
NASM Programming Concepts - Summary Notes
CR0 Register
Multiplication Methods
Stack Size
Data Types
Coprocessor
Arithmetic Instructions