Hello!
I am a student in an Assembler language class and we are using Assist for the programming.
I've had some confusion when working on my assignments on using L, LR, LA and ST for storing/loading and C/CR for comparing. The book isn't really clear on these insofar as what is used when in a program, and I seem to constantly having my debugging errors coming back to how I'm using these commands incorrectly.
This is what I'm understanding, based on what I've been taught in class and what I've read in the book.
ST R1, D(X,B) - This stores the contents of R1 into the fullword indicated at D(X,B).
So if my R1 had the number 12 in it, and I was storing it at an address labeled STORE, store would then have the value of 12, but it would still retain its original address, right?
So if I did a command like ST R1, 0(R2), R2 would contain 12, but it would have the same address as it did before.
I think that's my biggest confusion. I'm trying to use registers as pointers in my program. I want the register to remain pointing at the address where it's pointing, but I want the value that is in that pointed address to change in some way.
How do the different commands work in that regard?
I understand LA is "load address".
If I have a command, LA R2, R3, R2 would now point to R3, which would mean that its "value" or the contents would be the value/contents of R3. But what about L 2,0(3)? Is that loading the address or the value?
It's very confusing to me for some reason, and I keep putting the wrong thing in the program and I get abends or very weird results.
I'm currently working on a selection sort, and I'm trying to differentiate between pointers and the values they point to so that I can work through the sort. While I can get it to compile, it's not running properly and giving me correct results. I figure it has to do with these commands again.
Any help would be very appreciated to help me understand it better. I do want to get through the homework assignment, of course, but I actually want to understand and learn so that I won't continue to have problems as I go forward.
Thanks in advance!
Susan