Skip to content

6502: Introduce inline assembly labels and relative addressing #216

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Miezekatze64
Copy link
Contributor

This allows to use and define labels in 6502 assembly (also allows to acess extrn functions) and adds syntax for relative addresses used in branch instructions

Examples:

__asm__("label:",
"BCC label",
"BMI *+42")

@rexim
Copy link
Member

rexim commented Jul 13, 2025

I think it's a bit sus that something like this doesn't error out

main() {
    __asm__("label:", "label:");
}

What's expected in here?

@Miezekatze64
Copy link
Contributor Author

Fixed it now, this also adds the name_loc fields to ir::Global

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants