This repository has been archived by the owner on May 21, 2024. It is now read-only.
forked from boriel-basic/zxbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request boriel-basic#288 from boriel/feature/refact_or32
Refactorize OR32
- Loading branch information
Showing
2 changed files
with
34 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
__OR32: ; Performs logical operation A AND B | ||
; between DEHL and TOP of the stack. | ||
; Returns A = 0 (False) or A = FF (True) | ||
; between DEHL and TOP of the stack. | ||
; Returns A = 0 (False) or A = FF (True) | ||
|
||
ld a, h | ||
or l | ||
or d | ||
or e | ||
ld a, h | ||
or l | ||
or d | ||
or e | ||
|
||
pop hl ; Return address | ||
pop hl ; Return address | ||
pop de | ||
ex (sp), hl | ||
|
||
pop de | ||
or d | ||
or e | ||
|
||
pop de | ||
or d | ||
or e ; A = 0 only if DEHL and TOP of the stack = 0 | ||
|
||
jp (hl) ; Faster "Ret" | ||
or d | ||
or e | ||
or h | ||
or l | ||
|
||
#ifdef NORMALIZE_BOOLEAN | ||
; Ensure it returns 0 or 1 | ||
ret z | ||
ld a, 1 | ||
#endif | ||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters