home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / tools / pcmac / condemo.asm < prev    next >
Assembly Source File  |  1991-05-22  |  836b  |  48 lines

  1. ;CONDEMO.ASM
  2. ;Program to demonstrate
  3. ;the directives
  4. ;#if
  5. ;#ifdef
  6. ;#ifndef
  7. ;#else
  8. ;#elsif
  9. ;#endif
  10.  
  11. ;Some simple exapmles first:
  12. #if 1
  13. #message "The expression 1 is true"
  14. #endif
  15.  
  16. #if 0
  17. #message "No matter what this string is,"
  18. #message "because it won't appear on the screen."
  19. #endif
  20.  
  21. ;Some more complex
  22. var variable
  23. variable := 1
  24.  
  25. #ifdef variable
  26. #message "The identifier variable is defined."
  27.  
  28. #if variable
  29. #message "The value of variable is true."
  30. #else
  31. #message "The value of variable is false."
  32. #endif
  33.  
  34. #else
  35. #message "The identifier variable is not defined."
  36. #endif
  37.  
  38. ;Three different cases to separate
  39. variable := 3
  40. #if variable = 1
  41. #message "Variable = one."
  42. #elsif variable =2
  43. #message "Variable = two."
  44. #else
  45. #message "Variable greather than two."
  46. #endif
  47. ;End of file CONDEMO.ASM
  48.