Hi there (it's me again) I've got another problem, I have written some code that scans 0-7 bits of PORT B and checks to see if 0-7 bits are back low again. (Code) ;Routine to handle a 4 digit code (password) using the 16F84 ;Pass.asm using TASM.EXE -1684 -B ;Setup global variables STATUS: .EQU $03 PORTA: .EQU $05 PORTB: .EQU $06 Z: .EQU 2 W: .EQU 0 C: .EQU 0 IN: .EQU 0 ;Stores current digit code .ORG 4 .ORG 5 ;Clear Ports A and B clrf PORTA clrf PORTB bsf STATUS,5 ;Page 1 movlw %00000 ;Port A, all output movwf PORTA movlw %11111111 ;Port B, all output movwf PORTB bcf STATUS,5 ;Page 0 ;Reset ports a and b clrf PORTA clrf PORTB INIT: bsf PORTA,0 ;Indicate to user that power is on Call KeyScan ;Check to see if the user can movlw IN ;(test only) This is the value of the digit entered movwf PORTB ;(test only) Displays the digit to PORTB Goto INIT ;Re-start KeyScan: movlw %00000000 ;Check to see if the user has entered a digit xorwf PORTA,W btfsc STATUS,Z Goto KeyScan ;No, recheck movlw PORTB ;Store the value movwf IN ;(IN) KeyCheck: bcf STATUS,Z ;Check to see key has been released clrf PORTA movlw %00000000 xorwf PORTA,W btfsc STATUS,Z return ;Yes, key has been released Goto KeyCheck ;No, still waiting for release, recheck .END The problem here is that I want to store the value in PORT B into variable 'IN' and display the value to PORT A, for testing purpose. This doe not work, any comments would be greatefull. Pul Phillips PIC@Colindale.demon.co.uk