Ive got a bunch of switches, where each switch represents a bit in a
word...
So from each switch, in the control panel, it goes throu a boolean to
integer vi, and then to a x*2^n vi.
I then set a constant for each n.. so that if the switch is true (x=1
after the conversion) and n = 5 for that switch,
then the output will be 1 * 2^5.
Finally, I add all 16 outputs together (x*2^0 to x*2^15) to create a
word.. I actually have so many switches
that I have a couple of words (each made up with the above scheme)!
So far, this works fine, however, my question is, I would like to have
a global array that contains these words. I
dont want to insert this word into the array, but rather, I'd like to
sort of latch the values...
If in the array's word, the n bit was already one (i.e. that switch at
one point was on), then I dont want to reset it
to 0, even though the switch is off now.
This probably sounds confusing, I know I am confused just reading that
back, anyhoot, if I could make a global
array (ten 16-bit unsigned words), that I can read any word from,
modify it and set it back to its same place,
that would be great!