Writing a Gecko Register to an Address

Started by Almas, January 03, 2009, 02:27:59 AM

Previous topic - Next topic

Almas

I'm going to look like a fool for asking this, I fear.

I have a code that stores one of two values into a gecko register pending an If codetype. However, I am having issues writing this value to another place. The CT4/CST2 (Gecko Register Functions / Save Register To) codes write to [XXXXXXXX], but I can find no codes which do the equivalent to XXXXXXXX, which would make life a lot easier. I suppose it is possible for me to use a second register to permanently store the place where I'd like to write to, but I was wondering if there was a more efficient means to write to this point.

Thanks for your help.


EDIT: There was a mistake elsewhere in my code, it seems, and I managed to patch it up. It turns out the codetypes DO write to XXXXXXXX. Does this mean that the codetype document is incorrect, or did I make an error reading it? Sorry for the fuss.

hetoan2

you could always set the value to 0 and have your gecko Register be added to the value, which is basically moving it :|

Romaap

what are you trying to do?

because there is an option to store XXXXXXXX to gR

hetoan2


Romaap

gR to [XXXXXXXX] or to XXXXXXXX? because you can't store anything to a value xwink

use this:
84UYZZZN XXXXXXXX:
8400 : writes the 8bits in grN ZZZ times+1 at [XXXXXXXX]
8401 : writes the 8bits in grN ZZZ times+1 at [XXXXXXXX+ba]
9401 : writes the 8bits in grN ZZZ times+1 at [XXXXXXXX+po]
8410 : writes the 16bits in grN ZZZ times+1 at [XXXXXXXX]
8411 : writes the 16bits in grN ZZZ times+1 at [XXXXXXXX+ba]
9411 : writes the 16bits in grN ZZZ times+1 at [XXXXXXXX+po]
8420 : writes the 32bits in grN ZZZ times+1 at [XXXXXXXX]
8421 : writes the 32bits in grN ZZZ times+1 at [XXXXXXXX+ba]
9421 : writes the 32bits in grN ZZZ times+1 at [XXXXXXXX+po]

I think you should use 8420

Doesnt anybody read the codetypes? >_>

Romaap

eehh... yeah, sorry. but why put an 04 in front?

Romaap

but still, people shoud look at the codetypes before asking.

Almas

My initial concern was that there was no simple way to write grN to XXXXXXXX - thanks paprika for resolving this for me. However, I later discovered that the gecko register codetypes which SAY they write to [XXXXXXXX] ACTUALLY write to XXXXXXXX. Which is different, I thought.

Romaap

[XXXXXXXX] is a address and XXXXXXXX is a value

Almas

QuoteSo [XXXXXXXX] means "the data stored at XXXXXXXX".

Does this not imply that:
Quote8420 : writes the 32bits in grN ZZZ times+1 at [XXXXXXXX]
means:

Write grN ZZZ times+1 at the address stored at XXXXXXXX

?

Romaap

#10
Quote from: Almas on January 04, 2009, 08:36:24 PM
QuoteSo [XXXXXXXX] means "the data stored at XXXXXXXX".

Does this not imply that:
Quote8420 : writes the 32bits in grN ZZZ times+1 at [XXXXXXXX]
means:

Write grN ZZZ times+1 at the address stored at XXXXXXXX

?
no

Almas

Well then, my point is that the codetype doesn't do that. It writes the Gecko Register to the address XXXXXXXX, rather than the value stored at the address XXXXXXXX, as the codetype document would suggest (and you have just agreed with me upon).

Romaap

yeah, I'm sorry. it does write to the address, I didn't read it properly. my bad

Romaap

84200000 80123456

that code will write the value at gR0 to 80123456
so if gR0 is 11111111, 80123456 will become 11111111

Almas

No, it doesn't. Which is what my editted point was - the description of it in the codetype document is incorrect, I believe.