Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Syntax Question...

fredsbfredsb Member Posts: 3
I'm a newbie, so please be kind.

I'm trying to interpret some code, and I'm not sure what's going on...
This is in C/C++ (I think) it is for an 8051 uC. This sequence defines a series of VCC & VDD settings, but my question is about the +9 & +23 at the beginning of these lines. They are not line#s, maybe a ref. of some kind.
FYI, the code has similar numbering in other routines. What is it?

example code:

DEFINE_MACRO BCP (x)
+9 VCC=1 VDD=0;
+9 VCC=X VDD=0;
+23 VCC=1 VDD=0;
+9 VCC=1 VDD=1;
END_MACRO

What does the +9 and +23 mean? are they some kind of reference?

thanks.

Comments

  • IDKIDK Member Posts: 1,784
    : I'm a newbie, so please be kind.
    :
    : I'm trying to interpret some code, and I'm not sure what's going
    : on...
    : This is in C/C++ (I think) it is for an 8051 uC. This sequence
    : defines a series of VCC & VDD settings, but my question is about the
    : +9 & +23 at the beginning of these lines. They are not line#s, maybe
    : a ref. of some kind.
    : FYI, the code has similar numbering in other routines. What is it?
    :
    : example code:
    :
    : DEFINE_MACRO BCP (x)
    : +9 VCC=1 VDD=0;
    : +9 VCC=X VDD=0;
    : +23 VCC=1 VDD=0;
    : +9 VCC=1 VDD=1;
    : END_MACRO
    :
    : What does the +9 and +23 mean? are they some kind of reference?
    :
    : thanks.
    :
    :

    How is the macro used?

    And what are VCC and VDD, macros too?
    The following code would be illegal according to ansi C:
    VCC=1 VDD=1;
  • fredsbfredsb Member Posts: 3
    : : example code:
    : :
    : : DEFINE_MACRO BCP (x)
    : : +9 VCC=1 VDD=0;
    : : +9 VCC=X VDD=0;
    : : +23 VCC=1 VDD=0;
    : : +9 VCC=1 VDD=1;
    : : END_MACRO
    : :
    : : What does the +9 and +23 mean? are they some kind of reference?
    : :
    : : thanks.
    : :
    : :
    :
    : How is the macro used?
    :
    : And what are VCC and VDD, macros too?
    : The following code would be illegal according to ansi C:
    : VCC=1 VDD=1;
    --------------------------------
    The macro just sets a relay condition for a supply. It is called from the main body of the program several times.

    The code is for an 8051 uC, written in a C, or C-like environment. I'm just not sure what the "+9" and "+23" are doing at the start of these lines. There are other macros assoiciated with the main that are similar, but with different numbers (e.g. +10, or +5, etc.) I don't really see what they are for. I don't see any kind of link with main or anything else.

    Any ideas???
  • LundinLundin Member Posts: 3,711
    It is not ANSI C, so check your compiler docs.
  • IDKIDK Member Posts: 1,784
    : :
    : : How is the macro used?
    : :
    : : And what are VCC and VDD, macros too?
    : : The following code would be illegal according to ansi C:
    : : VCC=1 VDD=1;
    : --------------------------------
    : The macro just sets a relay condition for a supply. It is called
    : from the main body of the program several times.
    :
    : The code is for an 8051 uC, written in a C, or C-like environment.
    : I'm just not sure what the "+9" and "+23" are doing at the start of
    : these lines. There are other macros assoiciated with the main that
    : are similar, but with different numbers (e.g. +10, or +5, etc.) I
    : don't really see what they are for. I don't see any kind of link
    : with main or anything else.
    :
    : Any ideas???
    :

    Again, I can't say much unless knowing how the macros are used.
Sign In or Register to comment.