diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-03-15 19:28:16 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-03-15 19:28:16 -0400 |
commit | 41df2304aeeaad9b37430b0e741e7fce607fe6e8 (patch) | |
tree | 0d80dd6a078238eaf4434597cc6cab5c8c7e2018 /Optimizing-assembly-code.md | |
parent | 8c24867c887a63488b7cd232dcf46931a0e3b5aa (diff) |
inc/dec l
Diffstat (limited to 'Optimizing-assembly-code.md')
-rw-r--r-- | Optimizing-assembly-code.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md index 2b51bf1..8b9d8f7 100644 --- a/Optimizing-assembly-code.md +++ b/Optimizing-assembly-code.md @@ -330,7 +330,7 @@ When possible, avoid doing: dec hl ; 1 byte, 2 cycles ``` -If the low byte won't overflow, then do: +If the low byte *definitely* won't overflow, then do: ```asm inc l ; 1 byte, 1 cycle @@ -340,6 +340,8 @@ If the low byte won't overflow, then do: dec l ; 1 byte, 1 cycle ``` +This is applicable, for instance, if you're reading a data table via `hl` one byte at a time, it has no more than 256 entries, and it's in its own `SECTION` which has been `ALIGN`ed to 8 bits. It's unlikely to apply to pokecrystal's existing systems. + ### Load from an address to `hl` |