I've got no idea how this came to me...magic I suppose...
How about a variable that's 'locked' into a certain memory location (porta in this case), and it's set up as an array.
Since the ports are usually in sequential order in the memory map, it seems to me like a person should be able to access those bits as bits of a variable, like you would any other ram variable.
i.e.
PIN var byte[4] $F80 system '5 bytes to handle porta, portb, portc, portd, porte, in the case of a PIC18F4620
then you'd access the pins by pin.0[index]...
Wouldn't that work?
Bookmarks