Assembly Anti-Patterns Overview
Assembly Anti-Patterns Overview
Assembly language, despite being the closest programming language to machine code, has several common anti-patterns that can lead to bugs, maintainability problems, and performance issues. Here are the most important anti-patterns to avoid when writing Assembly code.
Hardcoded Memory Addresses
Hardcoded Memory Addresses
Not Using Comments
Not Using Comments
Self-Modifying Code
Self-Modifying Code
Not Preserving Registers
Not Preserving Registers
Excessive Use of Jumps
Excessive Use of Jumps
Not Using Stack Frames
Not Using Stack Frames
Magic Numbers
Magic Numbers
Inefficient Memory Access Patterns
Inefficient Memory Access Patterns
Not Checking Return Values
Not Checking Return Values
Not Using Appropriate Instructions
Not Using Appropriate Instructions
xor reg, reg
is faster and smaller than mov reg, 0
for clearing a register.Not Using Macros for Common Patterns
Not Using Macros for Common Patterns
Not Using Proper Data Alignment
Not Using Proper Data Alignment
Not Using SIMD Instructions When Appropriate
Not Using SIMD Instructions When Appropriate
Not Using Proper Segmentation
Not Using Proper Segmentation
Not Using Proper Stack Management
Not Using Proper Stack Management
push
should have a corresponding pop
, and they should be in the correct order.Not Using Proper Function Documentation
Not Using Proper Function Documentation
Not Using Proper Testing
Not Using Proper Testing
Not Using Version Control
Not Using Version Control