summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-11-10 20:29:00 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2021-11-10 20:29:00 -0500
commit2701784311542c2b5af3d8c9f72f859374bbab56 (patch)
tree7464775ab7366d49f371d96345ea560343ec9672
parente434cf9d650dc877b8164ecd549aedec4d578ee4 (diff)
Conditional ret
-rw-r--r--Optimizing-assembly-code.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md
index fd5b7b5..2612299 100644
--- a/Optimizing-assembly-code.md
+++ b/Optimizing-assembly-code.md
@@ -1881,6 +1881,17 @@ Don't do this:
...
```
+And don't do this:
+
+```asm
+ ; 3 bytes, 7 or 2 cycles
+ jr nz, .return
+ ...
+
+.return
+ ret
+```
+
Instead, do this:
```asm