Catalog / Assembly Language Cheat Sheet
Assembly Language Cheat Sheet
A quick reference for Assembly Language syntax, instructions, and concepts. Covers basic instructions, addressing modes, and common programming constructs.
Basic Instructions
Data Transfer Instructions
|
Move data from one location to another. Example:
|
|
Load Effective Address. Loads the address of the source operand into the destination operand. Example:
|
|
Push data onto the stack. Example:
|
|
Pop data from the stack. Example:
|
|
Exchange the contents of two operands. Example:
|
Arithmetic Instructions
|
Add two operands. Example:
|
|
Subtract two operands. Example:
|
|
Multiply two operands. Example:
|
|
Divide two operands. Example:
|
|
Increment operand by 1. Example:
|
|
Decrement operand by 1. Example:
|
Logical Instructions
|
Bitwise AND operation. Example:
|
|
Bitwise OR operation. Example:
|
|
Bitwise XOR operation. Example:
|
|
Bitwise NOT operation. Example:
|
|
Shift Left / Shift Arithmetic Left. Example:
|
|
Shift Right / Shift Arithmetic Right. Example:
|
|
Rotate Left. Example:
|
|
Rotate Right. Example:
|
Control Flow
Comparison and Jump Instructions
|
Compare two operands (affects flags). Example:
|
|
Jump if Equal / Jump if Zero. Example:
|
|
Jump if Not Equal / Jump if Not Zero. Example:
|
|
Jump if Greater / Jump if Not Less or Equal. Example:
|
|
Jump if Less / Jump if Not Greater or Equal. Example: |
|
Jump if Greater or Equal / Jump if Not Less. Example: |
|
Jump if Less or Equal / Jump if Not Greater. Example: |
|
Unconditional jump. Example:
|
Looping
|
Decrement Example:
|
Subroutines (Functions)
|
Call a subroutine. Pushes the return address onto the stack and jumps to the subroutine. Example:
|
|
Return from a subroutine. Pops the return address from the stack and jumps to it. Example:
|
Addressing Modes
Addressing Modes
Immediate Addressing: Operand is a constant value. Example:
|
Register Addressing: Operand is a register. Example:
|
Direct Addressing: Operand is a memory address. Example:
|
Indirect Addressing: Operand is a register that contains the memory address. Example:
|
Base-Plus-Index Addressing: Operand is a memory address calculated by adding a base register and an index register. Example:
|
Base-Plus-Index with Displacement Addressing: Operand is a memory address calculated by adding a base register, an index register, and a displacement value. Example:
|
Data Directives
Data Definition Directives
|
Define Byte. Allocates one byte of storage. Example:
|
|
Define Word. Allocates two bytes of storage. Example:
|
|
Define Doubleword. Allocates four bytes of storage. Example:
|
|
Define Quadword. Allocates eight bytes of storage. Example:
|
|
Define Ten Bytes. Allocates ten bytes of storage. Example:
|
Other Directives
|
Equate. Defines a constant value. Example:
|
|
Represents the current address of the assembler. Example:
|