Skip to content

.include won't just inline files, but "project assemble" them as in the IDE#128

Open
ajccosta wants to merge 2 commits intorarsm:masterfrom
ajccosta:pr-incluce
Open

.include won't just inline files, but "project assemble" them as in the IDE#128
ajccosta wants to merge 2 commits intorarsm:masterfrom
ajccosta:pr-incluce

Conversation

@ajccosta
Copy link

@ajccosta ajccosta commented Mar 2, 2026

This is a QoL change. Before, one had to either open all files in the project (e.g., printf.s, printnum.s printstr.s to be able to run bottles.s) or had to declare all files in the command line like so: java -jar rars.jar bottles.s printf.s printnum.s printstr.s.
Doing a .include wouldn't fix this because includes used to just inline the whole file. This would lead to .text, .data, etc, conflicts which was a mess. Note, the problem wasn't something like declaring a variable twice, but was actually like declaring .text twice. The typical C, C++ pre-processors don't have these kinds of conflicts. We are also using this in an educational context and this was a pain.
This PR changes it so that .include does the same as if you had the included files open (in the IDE) or had given them to as command line arguments. It's probably a bit hacky. Hope it's helpful.

The assembleString path did not have these changes, meaning this PR would deprecate it (it leaves it with the previous behavior).

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.

1 participant