Skip to content

added equzero (same as cmpzero but only outputs Zero flag)#755

Open
ZERICO2005 wants to merge 1 commit intomasterfrom
crt_equzero
Open

added equzero (same as cmpzero but only outputs Zero flag)#755
ZERICO2005 wants to merge 1 commit intomasterfrom
crt_equzero

Conversation

@ZERICO2005
Copy link
Copy Markdown
Contributor

@ZERICO2005 ZERICO2005 commented Mar 16, 2026

__*equzero is identical to __*cmpzero except that it only outputs to the Zero flag. Currently it just aliases __*cmpzero, but the intent is that it could maybe link to a smaller/faster routine.

__i48cmpzero:
; CC: 13 bytes
; Minimum  :  8F + 3R + 2
; arg == 0 : 11F + 3R + 3
; Maximum  : 14F + 3R + 3
	ex	de, hl
	add	hl, de
	or	a, a
	sbc	hl, de
	ex	de, hl
	ret	nz
	sbc	hl, de
	ret	p
	inc	e
	dec	de
	ret

; implementation 1
__i48equzero:
; CC: 9 bytes
; Minimum  :  6F + 3R + 2
; arg == 0 : 10F + 3R + 2
; Maximum  : 10F + 3R + 2
	add	hl, de
	or	a, a
	sbc	hl, de
	ret	nz
	sbc	hl, de
	add	hl, de
	ret

; implementation 2
__i48equzero:
; CC: 10 bytes
; Minimum  :  6F + 3R + 2
; arg == 0 : 11F + 3R + 2
; Maximum  : 11F + 3R + 2
	or	a, a
	sbc	hl, de
	add	hl, de
	ret	nz
	sbc	hl, hl
	adc	hl, de
	ret

@ZERICO2005 ZERICO2005 deployed to Autotester March 31, 2026 18:16 — with GitHub Actions Active
@ZERICO2005 ZERICO2005 changed the title added equzero/cmpequ (same as cmpzero/cmpu but only outputs Zero flag) added equzero (same as cmpzero but only outputs Zero flag) Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant