breeno,

In the original example (basic version), the while loops 10 times, reading the pin and overwriting the same bit in the CODE variable. It's no different than just reading it once (other than time used).

So, with that in mind, here's another possibility...
Code:
ASM
   MOVE?CB  8, _i
IN_Loop
   MOVE?TT  _in, STATUS, C
   CHK?RP   _CODE
   rrf      _CODE, F
   CHK?RP   _i
   decfsz   _i, F
   goto     IN_Loop
ENDASM
It just reads the pin, put's the value in the Carry flag, then rotates it into the CODE variable (8 times).