summaryrefslogtreecommitdiff
path: root/Optimizing-assembly-code.md
diff options
context:
space:
mode:
authorDamian Yerrick <git@pineight.com>2020-11-26 14:19:22 -0500
committerDamian Yerrick <git@pineight.com>2020-11-26 14:19:22 -0500
commit1481cc2c1a7bdfcc026dba02facb33bc2d12099d (patch)
treef575285675ca8153611b74c1e805d43c8003c4f0 /Optimizing-assembly-code.md
parent617e9f725d29910a608af6d9ead9e91867aa604d (diff)
save 2 bytes and 9 cycles off size over speed bit reversal
Diffstat (limited to 'Optimizing-assembly-code.md')
-rw-r--r--Optimizing-assembly-code.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md
index 17dbc88..e2afc6f 100644
--- a/Optimizing-assembly-code.md
+++ b/Optimizing-assembly-code.md
@@ -231,13 +231,12 @@ But do:
Or if you really want to optimize for size over speed, then do:
```asm
- ; 10 bytes, 59 cycles
- ld bc, 8 ; lb bc, 0, 8
+ ; 8 bytes, 50 cycles
+ ld b, $01 ; loop finishes once this 1 shifts to carry
.loop
rra
rl b
- dec c
- jr nz, .loop
+ jr nc, .loop
ld a, b
```