Skip to content

Commit c73bf8f

Browse files
committed
[ADD] adding very interesting pdf, thought agner is sometimes outdated
1 parent 02aa2ef commit c73bf8f

8 files changed

+80
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ bash Usage
2424
```
2525

2626
## Miscelleaneous links (MUST READ / SEE)
27+
Please read very interesting PDFs in the resources folder of this git<br />
2728
Instructions' List : https://c9x.me/x86<br />
2829
Optimization: http://agner.org/optimize/<br />
2930
About loops: https://stackoverflow.com/questions/47783926/why-are-loops-always-compiled-like-this<br />
3031
Compiler Explorer (git / online version):
31-
https://github.com/mattgodbolt/compiler-explorer
32+
https://github.com/mattgodbolt/compiler-explorer /
3233
https://godbolt.org/<br />
3334
[![Great video about compilers & asm](https://img.youtube.com/vi/bSkpMdDe4g4/0.jpg)](https://www.youtube.com/watch?v=bSkpMdDe4g4)<br />
3435
Calling Conventions : https://en.wikipedia.org/wiki/X86_calling_conventions<br />
Binary file not shown.

doc/optimizing_assembly.pdf

1.59 MB
Binary file not shown.
Binary file not shown.

resources/cmp.doc

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
+--------+------------------------------+-------------+--------------------+
2+
|Instr | Description | signed-ness | Flags |
3+
+--------+------------------------------+-------------+--------------------+
4+
| JO | Jump if overflow | | OF = 1 |
5+
+--------+------------------------------+-------------+--------------------+
6+
| JNO | Jump if not overflow | | OF = 0 |
7+
+--------+------------------------------+-------------+--------------------+
8+
| JS | Jump if sign | | SF = 1 |
9+
+--------+------------------------------+-------------+--------------------+
10+
| JNS | Jump if not sign | | SF = 0 |
11+
+--------+------------------------------+-------------+--------------------+
12+
| JE/ | Jump if equal | | ZF = 1 |
13+
| JZ | Jump if zero | | |
14+
+--------+------------------------------+-------------+--------------------+
15+
| JNE/ | Jump if not equal | | ZF = 0 |
16+
| JNZ | Jump if not zero | | |
17+
+--------+------------------------------+-------------+--------------------+
18+
| JP/ | Jump if parity | | PF = 1 |
19+
| JPE | Jump if parity even | | |
20+
+--------+------------------------------+-------------+--------------------+
21+
| JNP/ | Jump if no parity | | PF = 0 |
22+
| JPO | Jump if parity odd | | |
23+
+--------+------------------------------+-------------+--------------------+
24+
| JCXZ/ | Jump if CX is zero | | CX = 0 |
25+
| JECXZ | Jump if ECX is zero | | ECX = 0 |
26+
+--------+------------------------------+-------------+--------------------+
27+
Then the unsigned ones:
28+
29+
+--------+------------------------------+-------------+--------------------+
30+
|Instr | Description | signed-ness | Flags |
31+
+--------+------------------------------+-------------+--------------------+
32+
| JB/ | Jump if below | unsigned | CF = 1 |
33+
| JNAE/ | Jump if not above or equal | | |
34+
| JC | Jump if carry | | |
35+
+--------+------------------------------+-------------+--------------------+
36+
| JNB/ | Jump if not below | unsigned | CF = 0 |
37+
| JAE/ | Jump if above or equal | | |
38+
| JNC | Jump if not carry | | |
39+
+--------+------------------------------+-------------+--------------------+
40+
| JBE/ | Jump if below or equal | unsigned | CF = 1 or ZF = 1 |
41+
| JNA | Jump if not above | | |
42+
+--------+------------------------------+-------------+--------------------+
43+
| JA/ | Jump if above | unsigned | CF = 0 and ZF = 0 |
44+
| JNBE | Jump if not below or equal | | |
45+
+--------+------------------------------+-------------+--------------------+
46+
And, finally, the signed ones:
47+
48+
+--------+------------------------------+-------------+--------------------+
49+
|Instr | Description | signed-ness | Flags |
50+
+--------+------------------------------+-------------+--------------------+
51+
| JL/ | Jump if less | signed | SF <> OF |
52+
| JNGE | Jump if not greater or equal | | |
53+
+--------+------------------------------+-------------+--------------------+
54+
| JGE/ | Jump if greater or equal | signed | SF = OF |
55+
| JNL | Jump if not less | | |
56+
+--------+------------------------------+-------------+--------------------+
57+
| JLE/ | Jump if less or equal | signed | ZF = 1 or SF <> OF |
58+
| JNG | Jump if not greater | | |
59+
+--------+------------------------------+-------------+--------------------+
60+
| JG/ | Jump if greater | signed | ZF = 0 and SF = OF |
61+
| JNLE | Jump if not less or equal | | |
62+
+--------+------------------------------+-------------+--------------------+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>URL</key>
6+
<string>https://gcc.godbolt.org/</string>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>URL</key>
6+
<string>https://schweigi.github.io/assembler-simulator/</string>
7+
</dict>
8+
</plist>

resources/optimizing_assembly.pdf

1.59 MB
Binary file not shown.

0 commit comments

Comments
 (0)