summaryrefslogtreecommitdiff
path: root/Optimizing-assembly-code.md
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-08-26 12:17:38 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-08-26 12:17:38 -0400
commit0d81816cab9d4210bd4f55211ed6026c3f6a786e (patch)
tree698e19d59301f96ce46eef2130a092cfae2f0165 /Optimizing-assembly-code.md
parentd5c6ded4bf89ffa44805d58f373b946488a64f25 (diff)
carry
Diffstat (limited to 'Optimizing-assembly-code.md')
-rw-r--r--Optimizing-assembly-code.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md
index 93fa03a..8346020 100644
--- a/Optimizing-assembly-code.md
+++ b/Optimizing-assembly-code.md
@@ -277,7 +277,7 @@ If `CVAL` is $FF (i.e. set `a` to $FF if carry), then do:
```asm
; 3 bytes, 3 cycles
sbc a ; if carry, then $ff, else 0
- or NCVAL ; $ff stays $ff, $00 becomes NCVAL
+ or NCVAL ; $ff stays $ff, $00 becomes NCVAL; omit this if NCVAL is 0
```
If `NCVAL` is $FF (i.e. set `a` to $FF if not carry), invert carry and do the same:
@@ -286,7 +286,7 @@ If `NCVAL` is $FF (i.e. set `a` to $FF if not carry), invert carry and do the sa
; 4 bytes, 4 cycles
ccf ; invert carry flag
sbc a ; if originally carry, then 0, else $ff
- or CVAL ; $00 becomes CVAL, $ff stays $ff
+ or CVAL ; $00 becomes CVAL, $ff stays $ff; omit this if CVAL is 0
```
If `CVAL` equals `NCVAL - 1`, then do: