Hi,
Just in case this isn't clear already....
Code:
IF GPIO.0 = HIGH THEN  UNLOCK
This is NOT how you you determine if an input is high or low. HIGH and LOW are commands that both sets the pin in question to "output mode" and then drives it either high or low. To check if a pin (or any bit in any register) is set you do either:
Code:
If GPIO.1 = 1 THEN GOTO Unlock
Or
Code:
If GPIO.1 THEN GOTO Unlock
Or
Code:
If GPIO.1 = 0 THEN
  GPIO.2 = 1
  Goto DoThis
ELSE
   Goto Unlock
ENDIF
Right, back to HIGH and LOW... as have been said already the HIGH and LOW commands first sets the pin to "output mode" and then drives the pin high or low. It's nothing wrong with that except that it sets the pin to "output mode" each and every time either command is used. It doesn't matter if the pin already IS in "output mode" - it still writes to the TRIS register - every time and this wastes both time and codes space. It's much better to set the TRIS register manually and only change it if needed and then simply write to the Port or GPIO register directly.

/Henrik.