website/content/blog/asm-cheatsheet.md

53 lines
1.3 KiB
Markdown
Raw Normal View History

+++
title = "Assembly cheatsheets"
date = 2024-10-24
description = "Some resources and cheatsheets about assembly"
insert_anchor_links = "left"
draft = true
[taxonomies]
tags = ["assembly"]
+++
<style type="text/css">
table code {
background-color: initial;
}
</style>
* [x86 Linux syscalls](https://syscalls32.paolostivanin.com/)
* [x86_64 Linux syscalls](https://syscalls64.paolostivanin.com/)
* [Another website with Linux syscalls](https://syscall.sh/)
* [x86 and x86_64 instruction reference](https://www.felixcloutier.com/x86/)
## Conditional jump
```asm
cmp A, B
jcc after
; conditionally executed code, see the table below
after:
```
| `Jcc` | code executed if | jump if |
|--------|----------|----------|
| `ja` | `A <= B` | `A > B` |
| `jae` | `A < B` | `A >= B` |
| `jb` | `A >= B` | `A < B` |
| `jbe` | `A > B` | `A <= B` |
| `je` | `A == B` | `A != B` |
| `jg` | `A <= B` | `A > B` |
| `jge` | `A < B` | `A >= B` |
| `jl` | `A >= B` | `A < B` |
| `jle` | `A > B` | `A <= B` |
| `jna` | `A > B` | `A <= B` |
| `jnae` | `A >= B` | `A < B` |
| `jne` | `A != B` | `A == B` |
| `jnb` | `A < B` | `A >= B` |
| `jnbe` | `A <= B` | `A > B` |
| `jng` | `A > B` | `A <= B` |
| `jnge` | `A >= B` | `A < B` |
| `jnl` | `A < B` | `A >= B` |
| `jnle` | `A <= B` | `A > B` |
| `jnz` | `A == B` | `A != B` |
| `jz` | `A != B` | `A == B` |