Is there a way to assemble assembly code across multiple files with rars? #95
-
Hi, I'm pretty new w/ assembly, so apologies if I'm using the wrong words to describe what I mean here. I'm trying to separate my assembly code into multiple files using the For example, I have a project structure similar to this:
where main.s contains something like the following: .globl main
.data
# ...
.text
main:
# do some setup here...
jal ra other
# do something with results & exit... and other.s is like this: .globl other
.text
other:
# process args & return a result here... I've learned about using the stack pointer, return address, etc. to manage control flow between "functions" and am doing all of that correctly (I believe), but when I try to separate a function out to another file like in the above example, I get the following error when trying to run rars:
Is rars capable of doing what I'm trying to do here & I'm just getting it wrong, or am I asking rars to do something that it isn't made to do? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay so in asking the question, I may have stirred the pot enough for me to answer it now too. I added the |
Beta Was this translation helpful? Give feedback.
Okay so in asking the question, I may have stirred the pot enough for me to answer it now too.
I added the
sm
option to my cli invocation, and things appear to be linking correctly now. So my invocation for the above example now looks likejava -jar rars-1.7.jar main.s sm p
. Hopefully anyone else who gets stuck on this like me can find this Q&A and get unstuck a little faster.