style: format arrays
This commit is contained in:
parent
2fab257d1f
commit
b65b5838f7
1 changed files with 53 additions and 53 deletions
10
README.md
10
README.md
|
|
@ -39,7 +39,7 @@ All computation happens inside registers - RAM just holds the data until it’s
|
|||
#### Special registers
|
||||
|
||||
| 64-bit | 32-bit | 16-bit | Name | Purpose |
|
||||
|--------|--------|--------|------|---------|
|
||||
|----------|----------|---------|---------------------|---------------------------------------------------------|
|
||||
| `rsp` | `esp` | `sp` | Stack Pointer | Points to the top of the stack |
|
||||
| `rbp` | `ebp` | `bp` | Base Pointer | Marks the base of the current stack frame |
|
||||
| `rip` | `eip` | `ip` | Instruction Pointer | Points to the next instruction to execute |
|
||||
|
|
@ -48,7 +48,7 @@ All computation happens inside registers - RAM just holds the data until it’s
|
|||
#### General-purpose registers
|
||||
|
||||
| 64-bit | 32-bit | 16-bit | 8-bit high | 8-bit low | Category | Conventional use |
|
||||
|--------|--------|--------|------------|-----------|----------|-----------------|
|
||||
|-------------|---------------|---------------|------------|---------------|--------------|---------------------------|
|
||||
| `rax` | `eax` | `ax` | `ah` | `al` | Caller-saved | Return value, accumulator |
|
||||
| `rbx` | `ebx` | `bx` | `bh` | `bl` | Callee-saved | General purpose |
|
||||
| `rcx` | `ecx` | `cx` | `ch` | `cl` | Caller-saved | 4th argument |
|
||||
|
|
@ -86,7 +86,7 @@ All computation happens inside registers - RAM just holds the data until it’s
|
|||
##### Conditional jumps
|
||||
|
||||
| Instruction | Flags | Condition | Description |
|
||||
|-------------|-------|-----------|-------------|
|
||||
|---------------|------------|--------------|---------------------------|
|
||||
| `jmp` | - | always | Unconditional jump |
|
||||
| `je` / `jz` | ZF | ZF = 1 | Equal / Zero |
|
||||
| `jne` / `jnz` | ZF | ZF = 0 | Not equal / Not zero |
|
||||
|
|
@ -106,7 +106,7 @@ All computation happens inside registers - RAM just holds the data until it’s
|
|||
#### Arithmetic
|
||||
|
||||
| Instruction | Description |
|
||||
|-------------|-------------|
|
||||
|-----------------|-------------------------------------------------------------|
|
||||
| `add dst, src` | dst = dst + src |
|
||||
| `sub dst, src` | dst = dst - src |
|
||||
| `inc dst` | dst = dst + 1 |
|
||||
|
|
@ -159,7 +159,7 @@ Additional arguments are pushed onto the stack. The return value is stored in `r
|
|||
**Register preservation:**
|
||||
|
||||
| Type | Registers | Who saves | Behavior |
|
||||
|------|-----------|-----------|----------|
|
||||
|--------------|-----------------------------------------------|-----------|------------------------------------------------------------------------------------|
|
||||
| Caller-saved | `rax`, `rcx`, `rdx`, `rsi`, `rdi`, `r8`–`r11` | Caller | **Will be overwritten** by the called function - save them before `call` if needed |
|
||||
| Callee-saved | `rbx`, `rbp`, `r12`–`r15` | Callee | Must be restored before returning |
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue