Skip to content

specified Carry-out for __*shift_1 routines and Sign-out for __llshl_1#763

Merged
ZERICO2005 merged 1 commit intomasterfrom
shift_1_doc
Mar 28, 2026
Merged

specified Carry-out for __*shift_1 routines and Sign-out for __llshl_1#763
ZERICO2005 merged 1 commit intomasterfrom
shift_1_doc

Conversation

@ZERICO2005
Copy link
Copy Markdown
Contributor

@ZERICO2005 ZERICO2005 commented Mar 24, 2026

Added documentation to the __*shift_1 routines:

  • size and clock-cycles
  • input and output parameters
  • Specified that the __*shift_1 functions set the Carry flag to the shifted out bit.

I also specified the sign out for the __*shl_1 functions, since every reasonable implementation would output the sign and carry flag anyways. Including a hypothetical __i72shl_1 function:

__i72shl_1:
	add	hl, hl
	ex	de, hl
	adc	hl, hl
	ex	de, hl
	push	bc
	ex	(sp), hl
	adc	hl, hl
	ex	(sp), hl
	pop	bc
	ret

or actually, I guess the sign output could come back to bite us for UIY:UBC << 1

__i48shl_1_uiyubc:
	push	bc
	ex	(sp), hl
	add	hl, hl
	ex	(sp), hl
	pop	bc
	jr nc, .no_carry
	add	iy, iy
	inc	iy
	ret
.no_carry:
	add	iy, iy
	ret

@ZERICO2005 ZERICO2005 added the crt label Mar 24, 2026
@ZERICO2005 ZERICO2005 merged commit 249db4c into master Mar 28, 2026
9 checks passed
@ZERICO2005 ZERICO2005 deleted the shift_1_doc branch March 28, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant