Is there any way that the following code can be written using less code? I have data I wish to store sequentially, the data to store is in = Read_Buffer, I have to increment a number, that then calls another to = store the data in the correct Store_Byte_X. Any ideas? Thanks Gary=20 Main_routine ;This is only a segment of the real code movwf Read_Buffer=20 incf SM_Counter call Store_Data =20 goto Main_routine End_Main_Routine =20 Store_Data : movfw SM_Counter movwf SM_Temp_Store =20 movlw .1 xorwf SM_Temp_Store,w btfsc Status_Z goto Store_Byte_1 =20 movlw .2 xorwf SM_Temp_Store,w btfsc Status_Z goto movlw .3 xorwf SM_Temp_Store,w btfsc Status_Z goto Store_Byte_3 =20 movlw .4 xorwf SM_Temp_Store,w btfsc Status_Z goto Store_Byte_4 movlw .5 xorwf SM_Temp_Store,w btfsc Status_Z goto Store_Byte_5 =20 Store_Byte_1 movfw Read_Buffer=20 movwf SM_Store_1 return Store_Byte_2 movfw Read_Buffer=20 movwf SM_Store_2 return Store_Byte_3 =20 movfw Read_Buffer=20 movwf SM_Store_3 =20 Store_Byte_4 =20 movfw Read_Buffer=20 movwf SM_Store_4 =20 Store_Byte_5 =20 movfw Read_Buffer=20 movwf SM_Store_5 return =20 =20 =20 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu