Skip to content

replaced call to ti.LoadDEInd_s since A could be clobbered#714

Open
ZERICO2005 wants to merge 1 commit intomasterfrom
patch_libload
Open

replaced call to ti.LoadDEInd_s since A could be clobbered#714
ZERICO2005 wants to merge 1 commit intomasterfrom
patch_libload

Conversation

@ZERICO2005
Copy link
Contributor

This appears to be the implementation used for ti.LoadDEInd_s which preserves A:

ti.LoadDEInd_s:
ld de, 0
ld e, (hl)
inc hl
ld d, (hl)
inc hl

However, ti.LoadHLInd_s destroys A despite being a similar routine, this indicates that a future version of ti.LoadDEInd_s may destroy A, so I have inlined the call to prevent A from being destroyed.

ld bc, 3
ld a, JP_OPCODE
.loop:
cp a, (hl) ; jp byte ($C3)
Copy link
Contributor Author

@ZERICO2005 ZERICO2005 Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A is assumed to be preserved in this loop

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