At 05:54 AM 3/7/00 -0500, Lorick wrote: >Is there a 24 bit addition routine anywhere? I found 16 bit but I'm not >sure if I can think clearly enough to properly adapt those to 24 bits. I >might miss something that seems to work on a glitch but wouldn't work for >all numbers or something like that. here is an example that takes the value in R1H,M,L and adds it to the value contained in AD2H,M,L (result in AD2H,M,L). You should be able to see how to extend it to more than 24 bits. There is a similar version that does subtraction. I often extend to 40 bits or more - its easier to do this when manipulating integer values than it is to try and figure out which bits I can discard. ;now add new sample movfw R1L ; addwf AD2L,F ;LS byte movfw R1L ;middle byte skpnc incfsz R1L,W addwf AD2M,F ; movfw R1H ;MS byte skpnc incfsz R1H,W addwf AD2H,F ; Hope this helps. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 16 years of Engineering Innovation (1984 - 2000) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email.