summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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