Tell us more information, please
What exactly do you wanna read? One pin, low or high level? A changing-with-time-digital-signal? A whole byte? The storage part of the process looks easy. If it is a number (suposse you've got it now in PORTB) you only have to move it to the work register and place it wherever you want:
PORTB equ 0x06 ; You're giving a familiar name to mem position h'6'
NUMBER equ 0x0C ; You're saying this mem position is called "number"
movf PORTB,0 ; You're moving your value to the work register (that "0" indicates it, if "1" you will be moving it to PORTB= no move at all, but useful sometimes)
movwf NUMBER ; You're taking a copy of your value from the work register to mem position h'C'=d'12'=NUMBER
Now, if your number is bigger than a byte size= more than 8 (bits) pins, you'll have to cut it to store it. Imagine you've received this number b'0101111010' (a ten bits number) you'll get a part in PORTB and a part in PORTA (cause PORTB has only 8 pins assigned to it) so you´ll have to connect your wires to get, for example, the lowest bits in PORTB and the highest in PORTA. Your ports could be like this:
porta= 00000001
portb= 01111010
See? You should save it also in two registers which you could name, for example:
NUMHIGH equ 0x0C
NUMLOW equ 0x0D
This was in order to get a single number (with 8 or more bits). In comparison with this, getting a sole bit would be very easy. But, in comparison with this getting a digital signal at real time would be very hard.
It's said: tell us more :wink: