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

Implement SETDP pseudo operation #58

Open
craigthomas opened this issue Aug 11, 2022 · 0 comments
Open

Implement SETDP pseudo operation #58

craigthomas opened this issue Aug 11, 2022 · 0 comments

Comments

@craigthomas
Copy link
Owner

Describe the enhancement
The SETDP pseudo-operation is used to tell the assembler to optimize code. Specifically, the SETDP mnemonic allows the programmer to specify what the contents of the direct page register are during compilation. The assembler can then look for any addresses during assembly that have a most significant byte the same as what is stored in the direct page register. It will then transform those statements from their extended addressing mode equivalents into direct addressing mode statements instead.

For example, normally:

LDA $0F01

Would generate the following machine code:

B6 0F 01

However, if the direct page were loaded with $0F, and the SETDP pseudo-operation were implemented, then:

SETDP $0F
LDA $0F01

Would generate the following machine code:

96 01
@craigthomas craigthomas changed the title Implement SETDP Implement SETDP pseudo operation Aug 11, 2022
@craigthomas craigthomas added this to the Release Version 1.2.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant