ASM, I'm not sure which chip yet, but it will be a PIC, toroidal as in if you were to stretch it out and connect the edges, they would connect as in a torus, i.e. something that goes off the right wall will reappear on the left wall and likewise with the top wall to the bottom wall.
What do you mean, ANDing the number? I mean that if I have something on an 8x8 grid with the coordinate (1,1), then I need to sample the 8 surrounding cells:
000
0x0
000
Where the x is the cell (1,1) and the rest of the cells are those which need to be sampled.
However, if the cell is at (0,1), the surrounding cells are not all 'visible' directly, so the program wraps:
YY00000Y
CY00000Y
YY00000Y
Where C is the selected cell, Y is what needs to be sampled, and 0 is not relevant.
However, I plan to do this by having it read which pins are high of the surrounding 8, and it will work out which are the surrounding 8 and which to sample by:
1) reading the coordinates of the point, (x,y), where x and y are numbered pin outputs corresponding to which power and ground rails are high.
2) read:
(x-1,y-1)
(x-1,y)
(x-1,y+1)
(x,y-1)
(x,y+1)
(x+1,y-1)
(x+1,y)
(x+1,y+1)
by using MOVLW PORTB, (x-1)
MOVWF whatever
Now, my 2 questions were, how do I/can I use "PORTB, (x-1)" if I have previously defined x as being the x coordinate,
and can I make the pic think that the number which comes after 7 is 0?
Thanks