(added PIC tag) Dwayne, your version is very tricky :-) You did not say which MCU do you want to do that, but I guess it's not 18F otherwise you would just simply write this: movlw OFFSET_LOW addwf TIMER3_LOW,w movwf TIMER4_LOW movlw OFFSET_MED addwfc TIMER3_MED,w movwf TIMER4_MED movlw OFFSET_HI addwfc TIMER3_HI,w movwf TIMER4_HI Tamas ---------- Forwarded message ---------- From: Spehro Pefhany Date: Dec 23, 2007 2:08 AM Subject: Re: multi-byte addition with a constant To: "Microcontroller discussion list - Public." ; Untested code -- haven't written asm in a while.. ; add 24 bit constant to 24-bit number in result_high:result_mid:result_low ; no registers other than result required, easily expanded to more bytes ; 8-10 instructions depending on constant value ; ; ADDER_LOW low byte of constant ; ADDER_MID middle byte of constant ; ADDER_HIGH high byte of constant movlw (ADDER_LOW) addwf result_low,F ;LS byte movlw (ADDER_MID) #if ((1+ (ADDER_MID)) & 0xFF) skpnc movlw ((1+ (ADDER_MID)) & 0xFF) #else skpc #endif addwf result_mid,F ; mid byte movlw (ADDER_HIGH) #if ((1+ (ADDER_HIGH)) & 0xFF) skpnc movlw ((1+ (ADDER_HIGH)) & 0xFF) #else skpc #endif addwf result_high,F ; MS byte Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist