Skip to content

6502: Introduce inline assembly labels and relative addressing#216

Merged
rexim merged 5 commits intobext-lang:mainfrom
Miezekatze64:6502-asm-labels
Aug 3, 2025
Merged

6502: Introduce inline assembly labels and relative addressing#216
rexim merged 5 commits intobext-lang:mainfrom
Miezekatze64:6502-asm-labels

Conversation

@Miezekatze64
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@rexim
Copy link
Copy Markdown
Member

rexim commented Aug 3, 2025

@Miezekatze64 alright, looks good! Thank you!

@rexim rexim merged commit fdb14e7 into bext-lang:main Aug 3, 2025
7 checks passed
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