----- Original Message ---- >From: Sean Schouten dev.seantech@gmail.com >Hi guys, >What seems to be no more than perhaps a simple logical operation seems to >defy my logic. >Using the following code in a small loop, I don't seem to be getting the >desired-output when monitoring the W-Register: >[code] >START > MOVLW 0xFF > MOVWF TEMP_VAR >MAIN > NOP > MOVF TEMP_VAR, W > RRF TEMP_VAR > GOTO MAIN >[/code] [snip] here is what I tested in the simulator TEMP_VAR EQU 0x20 ;for this code must be gp reg in bank 0 START MOVLW 0xFF MOVWF TEMP_VAR clrc ;clear the carry or there will be not 0 bir rotating around MAIN NOP ;not needed MOVF TEMP_VAR, W ;not needed RRF TEMP_VAR ;going to file as default GOTO MAIN end It works for me Note the remarks at the equ (bank 0 gp reg= 0x20 to 0x7F) the line movf temp_var,w does nothing. Peter van Hoof -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist