Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize the load instructions #3

Open
ZERICO2005 opened this issue Jan 24, 2025 · 0 comments
Open

Organize the load instructions #3

ZERICO2005 opened this issue Jan 24, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@ZERICO2005
Copy link

ZERICO2005 commented Jan 24, 2025

I found that the load instruction page https://ezce.github.io/ez80-docs/instructions/load/ seems to be in a random order. I think it would be better to group them based on if they are an 8bit or 24bit load, and if its loading a register/address/constant.

Here is my idea of how it could be organized

# 8 bit
	## load register
		ld reg8D, reg8S
		ld reg8, regih
		ld reg8, regil
		ld regih, reg8
		ld regil, reg8

		ld reg8, imm8
		ld regih, imm8
		ld regil, imm8

	## load pointer
		ld a, (imm24)

		ld a, (reg24)
		ld reg8, (regi + ofs8)

	## store pointer
		ld (imm24), a

		ld (reg24), a
		ld (regi + ofs8), reg8
		ld (regi + ofs8), imm8

# 24 bit
	## load register
		ld sp, hl
		ld sp, regi

		ld reg24, imm24
		ld regi, imm24

	## load pointer
		ld hl, (imm24)
		ld reg24, (imm24)
		ld regi, (imm24)

		ld reg24, (hl)
		ld regi, (hl)
			
		ld reg24, (regi + ofs8)
		ld regi, (ix + ofs8)
		ld regi, (iy + ofs8)

	## store pointer
		ld (imm24), hl
		ld (imm24), reg24
		ld (imm24), regi

		ld (regi + ofs8), reg24
		ld (ix + ofs8), regi
		ld (iy + ofs8), regi 

# memory and interrupts
	ld regir, a
	ld a, regir
	ld a, mb
	ld mb, a

I also now realize that ld reg8D, reg8S contains ld reg8, (HL), so that would probably be moved to the ## load pointer section and etc

@TIny-Hacker TIny-Hacker added the enhancement New feature or request label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants