diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-03-26 10:49:29 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-03-26 10:49:29 -0400 |
commit | c2b20f29509459cbd74e009ef30df822132e18af (patch) | |
tree | 80edbec3b89bc469057234d8912516acce7e34fa /Optimizing-assembly-code.md | |
parent | 90f1c47345084f3ad3ab8d6c89ded30ae7a686d0 (diff) |
a=carry?1:0
Diffstat (limited to 'Optimizing-assembly-code.md')
-rw-r--r-- | Optimizing-assembly-code.md | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/Optimizing-assembly-code.md b/Optimizing-assembly-code.md index 867cb07..f6e4651 100644 --- a/Optimizing-assembly-code.md +++ b/Optimizing-assembly-code.md @@ -201,15 +201,6 @@ If `FOO` equals `BAR - 2`, then do: sbc -BAR ; -1 becomes BAR - 2 aka FOO, 0 becomes BAR ``` -If `FOO` is 1 and `BAR` is 0 (i.e. set `a` to 1 if carry or 0 if not carry), then do: - -```asm - ; 3 bytes, 3 cycles - ccf ; invert carry flag - sbc a ; if originally carry, then 0, else $ff aka -1 - inc a ; 0 becomes 1, -1 becomes 0 -``` - If `FOO` is 0 and `BAR` is 0 (i.e. set `a` to 0 if carry or 1 if not carry), then do: ```asm |