Hi
It doesn't work that way, it won't work that way and it can't work that way.
When you do AR VAR BIT[7] you are reserving space in RAM for 7 consecutive bits. You can't them simultanously mirror each bit in RAM to a ANOTHER adress (which the ports are) - it won't and can't work.
Aliases must all point to the SAME location, like
Code:
AR VAR BIT[7]
myBit VAR AR[2]
In the above case AR[2] and myBit are the one and same memory location, ie. two names for the same location, you can't do it the other way around. Ie you can't have one name for two locations which is basically what you're trying to do.
When you do
Code:
AR VAR BIT[7]
AR[1]=PORTB.6
You are reading the state of PORTB.6 and store the result of that in AR[1].
The only way I know of that is similar to what you're trying is to use a port offsets and a lookup table.
/Henrik.
Bookmarks