PDA

View Full Version : A few general questions about the CODE



MOUNTAIN747
- 10th January 2014, 18:33
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

HenrikOlsson
- 10th January 2014, 21:31
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.

MOUNTAIN747
- 12th January 2014, 16:13
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