EQU substitution??

This is a discussion on EQU substitution?? within the C Programming forums, part of the General Programming Boards category; I think in assembly EQU pulls the trick but in C, how do you equate on variable to another so ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    5

    EQU substitution??

    I think in assembly EQU pulls the trick but in C,

    how do you equate on variable to another so that everytime the compiler sees a word it substitutes the other word into it...

    EXAMPLE:

    DIN EQU RC0;

    DIN = 1;
    DIN = 0;
    DIN = !DIN;

    *I want complier to substitue RC0 in for DIN...thanks

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Code:
    DIN EQU RC0;
    #define DIN RC0
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dynamic Array substitution in composite data variable
    By DavidDobson in forum C Programming
    Replies: 2
    Last Post: 08-12-2008, 05:29 AM
  2. Liskov substitution principle
    By George2 in forum C++ Programming
    Replies: 9
    Last Post: 02-25-2008, 05:30 AM
  3. Backward substitution in gaussian elimination
    By Meander14 in forum C Programming
    Replies: 0
    Last Post: 09-30-2007, 08:02 AM
  4. Replies: 7
    Last Post: 05-24-2006, 10:49 AM
  5. Substitution Cipher Program Problem...
    By Junior89 in forum C++ Programming
    Replies: 13
    Last Post: 12-28-2005, 05:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21