As part of figuring out logarithms, i came across some code i didnt understand, and chasing it back, found it came from basic stamp usage. This allowed me to address a bit "relative" to another bit, using an integer offset index
ie

test var word
fred var test.bit0

then fred(3) is equivalent to test.bit3

hence i could directly address bits within a for--next loop

I tried experimenting with this using ports instead and it works
ie 16F876
-------------
xport var porta.0 'define base point
k VAR byte 'loop var

ADCON1 = 7
trisa = %00000000
trisb = %00000000
trisc = %00000000
portA = 0
portB = 0
portC = 0
loop:
portA = 0
pause 1000
for k = 0 to 7 'this accesses port a
xport(k) = 1 ' set pin high
pause 1000
next k

portB = 0
pause 1000
for k = 8 to 15 'this accesses port b
xport(k) = 1
pause 1000
next k

portC = 0
pause 1000
for k = 16 to 23
xport(k) = 1
pause 1000
next k

goto loop
end
-------------------------
you will note you appear to be able to access ALL ports, not just those defined by the PINS directive.
Using this allows me to access ports within a subroutine using a preset integer to define the port i want.
It compiles and seems to run OK, but has no syntax description anywhere ( except half a page in the basic stamp instructions booklet ).
Based on the fact it works, but is undocumented for Pics, is there a reason it shouldnt be used???

Andrew