A few general questions about the CODE


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    232

    Default A few general questions about the CODE

    Hi All, I have a few general questions:

    (1) Ser2mod.pbp, I’m not sure where I found this document but it has some good examples of using Serout2 expressions. At the end of this document there is a bonus note:
    To count the number of bytes actually sent in a 25 byte delimited string.
    NumberBytes=25-R$.Highbyte
    Has anyone used this undocumented system function successfully using it after a STR receive?

    NumberBytes var byte

    Serin2 PinOut, 396, [STR Mystring\25\”~”]
    NumberBytes=25-R$.Highbyte


    (2) What is the difference in these commands?
    If
    Ifdef
    Ifndef

    (3)
    BIT?GOTO
    L?GOTO
    MOVE?CT
    CHKRP?T…………. what does the “?” do……. Are these system functions or customized commands or labels?

    (4) Does anyone have a list of undocumented system commands?



    Thanks,
    Wayne

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: A few general questions about the CODE

    Hi Wayne,

    1) Haven't seen the document/example in question so I won't comment.

    2) It depends.... IF can be both a PBP command, a compiler directive OR an assembler directive - it all depends on on where in a program it is. IFDEF and IFNDEF are compiler directives (and possible also assembler directives) so they are not really PBP commands.

    Think of the PBP command IF as a command that is executed and evaluated when the PIC is running and executing your program. IFDEF and IFNDEF are used to change the output of the compiler or assembler, ie the actual program - before it even gets into the PIC. Neither of them are parts of the actual program that is executed in the PIC.

    3) The ?-mark doesn't do anything as far as I know. It's just part of the name of the macro. See, your PBP program gets compiled into an assembly language program. The assembly language program consists of A) pure assembly instructions and B) assembly macros which, in turn, is just assembly more instructions. MOVE?CT and BIT?GOTO etc are just the names of these macros. Look at the .lib and .mac files in your PBP installation folder.

    4) I don't think they are system commands and I don't Think there's any list. If you're good enough to make use of them you're good enough to figure out what they do and how to use them by looking at the files provided. I'm not by the way....

    /Henrik.
    Last edited by HenrikOlsson; - 10th January 2014 at 21:34.

  3. #3
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    232


    Did you find this post helpful? Yes | No

    Default Re: A few general questions about the CODE

    Thank you Henrik for your reply. There are many little items that I always wondered about but never asked, now I have!
    I would still like to hear from anyone that can answer question#1.


    Thanks,
    Wayne

Similar Threads

  1. LTC2492 Code questions/16bit A/D, SPI
    By BUBBA2 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th January 2011, 20:01
  2. General USB questions
    By BobEdge in forum USB
    Replies: 2
    Last Post: - 21st April 2009, 04:19
  3. addressing general IO
    By jcb344 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th July 2008, 13:26
  4. general info for project
    By miniman in forum General
    Replies: 1
    Last Post: - 31st January 2005, 22:41
  5. General Programmer Questions
    By mslaney in forum General
    Replies: 1
    Last Post: - 17th December 2004, 18:16

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