Maths again...


Closed Thread
Results 1 to 3 of 3

Thread: Maths again...

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809

    Default Maths again...

    Hi.

    Can the DIV32 be used with constants? I have to make the division myvar=217770/adval and was thinking in using this:

    con1 con 21777
    con2 con 10
    dummy var word

    dummy=con1*con2
    myvar=div32 adval

    Is this OK?

    Ioannis

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    DIV32 can use a constant.
    But in your multiplication prior to the DIV32, one of the values have to be a WORD.
    Otherwise the constants are multiplied at compile time and the PBP system registers aren't loaded with the proper values at Run-Time.

    You can also use the PutMulResult macro I posted back in 2003.
    http://www.picbasic.co.uk/forum/show...24&p=50#post50
    DT

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,809


    Did you find this post helpful? Yes | No

    Default

    Ooops. What a stupid idea to mult. 2 constants!

    Thanks Darrel.

    Ioannis

Members who have read this thread : 1

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