Background
Currently, the x86-64 assembler implements instruction encoding through individual functions and hardcoded values. This approach makes the code harder to maintain and less efficient. Adding encoding tables would make the code more maintainable and potentially faster.
Proposed Solution
Create encoding tables that contain the necessary information for instruction encoding. The tables should include:
- Primary instruction table containing:
- Instruction name (e.g., "MOV", "ADD")
- Opcode variants (based on operand sizes)
- Encoding type (register-to-register, immediate-to-register, etc.)
- Required prefixes
- Operand types and sizes