Conditional translation

Example:

%ifndef Macro1

%ifdef Macro1Value

%error Macro1Value is defined without Macro1

%else

%error Macro1 is not defined

%endif

%elif Macro1='yes'

%define Macro1Value 1

%elif Macro1='no'

%define Macro1Value 0

%else

%error Unrecognized value in Macro1

%endif

Macros definition:

Example:

%define MyFirstMacroDefinition Value

%define! MyFirstMacroDefinition Value redefinition

%undef MyFirstMacroDefinition

%undef! MyFirstMacroDefinition

Including external file:

%include {filename} includes file {filename} to the current position of text. {filename} must be with relative path from directory ProcessorExpert\Drivers\.

%include {filename}({par1},{par2},..) is the same as simple %include command, and additionally parameters are accessible using macros %1, %2, ... Parameter par? is defined as all characters between separators (,,,).

Example:

%include SubProg.prg (Value)

contents of ProcessorExpert\Drivers\SubProg.prg

%if MyMacro!=%1

%define! MyMacro %1

%endif

Comments and text formatting:

Example:

%- Comment: This is assembler formatting

%>20 ADD A,20

%>20 SUB A,B

Errors:

The following messages are displayed in Processor Expert Error window.

Example:

%error I'm sorry but this driver is not finished yet.

%warning This configuration is not useful.

%error! Internal error in the driver. Please contact your distributor.

Lists:

Macroprocessor supports macros with list as a value. You can have several items in a list.

Example:

%apploc MyFirstList Item1

%apploc MyFirstList Item2

%apploc MyFirstList Item2

%for i from MyFirstList

Report: List Item is "%i"

%endfor

%for i from [0..7]

%i

%endfor

Expressions:

Evaluation of expressions is done in real numbers. For integer operations, the value is rounded to 32-bit signed integer.

Example:

%:a=0

%:a+=1

%:b?=%a,0:3.1415,1:6.2830

Subsections: