Discussion:
Problem with acquiring input
(too old to reply)
Ryan McNeeley
2005-11-09 02:48:11 UTC
Permalink
I don't think I am thinking the right way on this. In my loadMem section, I
go about doing a few things, but the two important ones are acquiring a
"memory address" and a "value" to be stored at that address (which could
also possibly be an instruction).

Now, my problem is this, I am a little confused on after acquiring input for
the first time from the user into %r8 from the ta getint command, how can I
go about making that value, that should be an address, into a register?
Basically, what I want to do is pull a value in and say, "Ok, you inputted
27 in hexadecimal, now I know the next value you input I should store into
%r27."

But I can't do that because the value they input is in register 8, I can't
simply do stb %r[%r8], that's not a valid format. Any suggestions or pushes
in the right direction?
--
Ryan McNeeley
***@osu.edu
John Hayford
2005-11-09 03:26:22 UTC
Permalink
The SAM memory are not stored in registers, they are stored in the MEM
section of the sparc memory. Registers 2-6 of the sparc are used for
different registers in the sam.
John
Post by Ryan McNeeley
I don't think I am thinking the right way on this. In my loadMem section, I
go about doing a few things, but the two important ones are acquiring a
"memory address" and a "value" to be stored at that address (which could
also possibly be an instruction).
Now, my problem is this, I am a little confused on after acquiring input for
the first time from the user into %r8 from the ta getint command, how can I
go about making that value, that should be an address, into a register?
Basically, what I want to do is pull a value in and say, "Ok, you inputted
27 in hexadecimal, now I know the next value you input I should store into
%r27."
But I can't do that because the value they input is in register 8, I can't
simply do stb %r[%r8], that's not a valid format. Any suggestions or pushes
in the right direction?
Continue reading on narkive:
Loading...