Retrieving 32bit Multiply Result


Results 1 to 40 of 43

Threaded View

  1. #10


    Did you find this post helpful? Yes | No

    Default Checking for a smaller result

    Checking for a smaller result is a simple trick, thanks,

    right now my code is never suposed to exced the Max= 4,294,967,296
    so i am ignoring the OVRFLOW32 = 0.

    This is the code that i am using
    Code:
    Bigword   var word [2]
    BigwordL  var BigWord(0)
    BigwordH  var BigWord(1)
    Bigword1  var word [2]
    Bigword1L var BigWord(0)
    Bigword1H var BigWord(1)
    
    
    AddTwoBigWords:   'Adds Bigword1 and BigWord2 result in BigWord
       BigWordH = BigWordH + BigWord1H  ;ignoring any overflow
       BigWordL = BigWordL + BigWord1L
       if BigWordL < BigWord1L then
             BigWordH = BigWordH+1          ;ignoring any overflow
       endif
    return
    Would this be ok? i made some tests and it seems ok but your experience might see anything wrong here.
    Last edited by Josuetas; - 28th July 2007 at 16:03.

Similar Threads

  1. Strugling without floating point
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 27th March 2011, 07:29
  2. Math help please!!!
    By jbirnsch in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th August 2007, 15:45
  3. 32-bit Variables and DIV32, Hourmeter 99999.9
    By Darrel Taylor in forum Code Examples
    Replies: 9
    Last Post: - 23rd November 2006, 08:23
  4. PBP 16-bit ADC result math
    By sonic in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2005, 15:21
  5. Retrieving Div32 Remainder
    By Darrel Taylor in forum Code Examples
    Replies: 4
    Last Post: - 20th August 2003, 04:53

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts