Help, PBPL and DIV 32.


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2010
    Posts
    13

    Question Help, PBPL and DIV 32.

    Hello. I have a code that uses DIV 32, because of code lenght I am switching to PIC18F4620, and since I have the extra space I want to add more functions that could be more easily done using PBPL. BUT when I try to compile in PBPL it says "ERROR: Macro DIV32?CW not found in macro file."
    I don't want to rewrite the DIV32 routine it works just fine as it is, is there any way to use DIV32 in PBPL? Can you use both Macro files at once? Or can the 18L macro file be edited in some way to include DIV32?

    Thanks!

    Rogerio

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


    Did you find this post helpful? Yes | No

    Default

    With PBPL, you don't need DIV32 anymore.
    Just do the division ...

    Code:
    Dummy = A * B
    Result = DIV32 C
    Becomes ...

    Code:
    Result = (A * B) / C
    Last edited by Darrel Taylor; - 16th March 2010 at 09:37.
    DT

  3. #3
    Join Date
    Feb 2010
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel! That was a fast change and it's working OK.
    Now I need to find out how to display a number bigger than a Word using LCDOUT, any ideas?

    Thanks!

    Rogerio

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


    Did you find this post helpful? Yes | No

    Default

    Use LONG variables.

    Then you can go up to ...
    Code:
    LCDOUT  DEC10 MyLong
    or simply DEC will display however many digits there are.
    <br>
    DT

  5. #5
    Join Date
    Feb 2010
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    I was using Long variables but trying to display with #Variable, thought it was the same as DEC. Working great now.

    Thanks again Darrel!

    Rogerio

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink

    Hi, Darrel

    While you're here ...

    A question I have for long time ... linked to the subject.

    Is it possible to do something like conditionnal assembly with PBP ??? never saw anything about that ...
    and Google doesn't return anything nor ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Is it possible to do something like conditionnal assembly with PBP ???
    At the PBP level ... NO.
    At the ASM level ... YES.

    In other words, you can not conditionally compile variables, array sizes or anything that PBP needs to know before passing it on to the assembler.

    Once it's at the assembler, you can conditionally remove any part of the PBP "Code" that you wish.

    But only the code.
    Not the variables, defines or any variables/defines in other include files.

    All you do is put if/endif's around what you want or don't want...
    Code:
    DEFINE MyOption 1
    
    @  if (MyOption == 1)
        LCDOUT "Option 1 HardCoded"
    @  endif
    <br>
    DT

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Re,

    Ok, that's more than nice to me ....

    just looked for " embedding " PBP commands ...

    Thanks, Darrel

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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