Is there anyway to make a ifdef type preprocessor syntax. I don't understand the macro system enough to do this.

define MY_SYS

ifdef MY_SYS
..Code specific to MY_SYS..
ifndef MY_SYS
..Generic Code..
Posted on 2003-03-07 03:11:18 by jInuQ
Possible conversions:

1) In this case you need to declare MY_SYS to some non-zero value to get (a) assembler or to zero to get (b) assembled, but it won't work if you don't declare MY_SYS at all:

MY_SYS = 1

; (a)
; (b)
end if

2) Second case can handle the case of undefined MY_SYS:

MY_SYS equ 1

if defined MY_SYS
; (a)
; (b)
end if

You can also use such nice macros:

macro define name
{ name equ 1 }

macro undefine name
{ local undefined
name equ undefined }

ifdef equ if defined
ifndef equ if ~defined

For example

define MY_SYMBOL

; (a)
end if

undefine MY_SYMBOL

ifndef MY_SYMBOL
; (b)
end if

Both (a) and (b) will be assembled in this case.
Posted on 2003-03-07 07:54:59 by Tomasz Grysztar
Cool, Thanks for the help.
Posted on 2003-03-07 20:14:38 by jInuQ