summaryrefslogtreecommitdiff
path: root/Optimizing-assembly-code.md
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-03-26 22:09:52 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-03-26 22:09:52 -0400
commitba41eaaa02e21a63f0f73fa745ce1190baefaed2 (patch)
treeeb3c4825884edc6d50a443f5fe1d7860bf9e1418 /Optimizing-assembly-code.md
parent0876f85eedff5f24d5e8a01ebac7cb523fe79c29 (diff)
add a, 0
Diffstat (limited to 'Optimizing-assembly-code.md')
-rw-r--r--Optimizing-assembly-code.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md
index 8a90e9e..2f9ab4c 100644
--- a/Optimizing-assembly-code.md
+++ b/Optimizing-assembly-code.md
@@ -247,6 +247,15 @@ Don't do:
adc 0
```
+And don't do:
+
+```asm
+ ; 4 bytes, 4 cycles
+ ld b, a
+ ld a, 0
+ adc c
+```
+
But do:
```asm
@@ -256,7 +265,7 @@ But do:
sub b
```
-And don't do:
+Also, don't do:
```asm
; 5 bytes, 5 cycles
@@ -265,6 +274,15 @@ And don't do:
adc 0
```
+And don't do:
+
+```asm
+ ; 5 bytes, 5 cycles
+ ld b, a
+ ld a, 0
+ adc N
+```
+
But do:
```asm