Assembly ideas / if-endif


This as a simple conditional directive for telling the compiler what it does or not. You have to write "if" and "endif" words in lowercase.

In that case you declared a variable called DEBUG and initialized it by 0, the lines from 72 to 74 and from 82 to 85 are vanished when you compile the source.

This condition is not only for checking the equality of the variable and the value.

The variable and the value can be operations.

 DEBUG=5
 .
 if DEBUG+2>=10-3
 LDA #$03
 STA $0C00
 endif