|
Hi, Michael.
I had some trouble with getting variables into registers, as well.
I can think of three ways:
1) Pass the variable to a function - the first function argument seems to be r0.
You can easily experiment with this by inspecting the assembler output from gcc.
2) Figure out the assembler idiom for referring to symbols and use that.
3) I spent a bit of time surfing around the existing code, and there seems to be
an assembler macro idiom where variables can be pasted directly into the
assembler. I was too lazy to find the documentation on how to use it, but
someone might post here to tell you ;)
I found that nr. 1 worked sufficiently well for me not to bother following up
the other two.
Iain
|
|
Message has 1 Reply: | | Re: BrickOS Assembler
|
| (...) I need to access elements of a 2d array. I don't think this is an option for that. Nevertheless, could you post code that demonstrates this? (...) How do I do that? (...) ??? (...) Hmm... this sounds more like what I'm trying to do. Someone? (...) (21 years ago, 18-Jan-04, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | BrickOS Assembler
|
| Okay, I'm working on a proc in ASM, and I need help with using MOV to move stuff back and forth between memory and registers. I have the following (very simple) program working, but I can't for the life of me get the MOV to work. I've got the (...) (21 years ago, 17-Jan-04, to lugnet.robotics.rcx.legos)
|
11 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|