Easy Code macros (all project type)


Some useful macros are included internally in Easy Code. Their names are colorized as Easy Code reserved words (see Settings menu). As they are built-in, you can use them when you like along the code.These macros have the following syntax:

Color (byRed, byGreen, byBlue)

Arguments byRed, byGreen, byBlue must be 8-bit values (DB). Eax returns an RGB color (a 32-bit value or DD).

Example:

Color (0AH, 0BH, 0CH)

Eax returns 000C0B0AH


HiByte (wValue)

Argument wValue must be a 16-bit value (DW). Al returns the high byte (8-bit value or DB) of wValue.

Example:

HiByte (0C0AH)

Al returns 0CH


HiWord (dwValue)

Argument dwValue must be a 32-bit value (DD). Ax returns the high word (16-bit value or DW) of dwValue.

Example:

HiWord (000C000AH)

Ax returns 000CH


LoByte (wValue)

Argument wValue must be a 16-bit value (DW). Al returns the low byte (8-bit value or DB) of wValue.

Example:

LoByte (0C0AH)

Al returns 0AH


LoWord (dwValue)

Argument dwValue must be a 32-bit value (DD). Ax returns the low word (16-bit value or DW) of dwValue.

Example:

LoWord (000C000AH)

Ax returns 000AH


MakeWord (byLow, byHigh)

Arguments byLow and byHigh must be 8-bit values (DB). Ax returns the resultant 16-bit value (DW).

Example:

MakeWord (0CH, 0AH)

Ax returns 0A0CH


MakeLong (wLow, wHigh)

Arguments wLow and wHigh must be 16-bit values (DW). Eax returns the resultant 32-bit value (DD).

Example:

MakeLong (0A0BH, 0C0DH)

Eax returns 0C0D0A0BH


Move (dwValue1, dwValue2)

Arguments dwValue1 and dwValue2 must be a 32-bit (DD) variable or memory position.

Example:

Move (dwMemPos1, dwMemPos2)

Moves the value in variable or memory position specified by dwMemPos2 to variable or memory position specified by dwMemPos1.

This macro does not return a value.


Return (dwValue)

Argument dwValue must be a 32-bit value (DD). It loads the Eax register with dwValue and returns from a procedure.

Example:

Return (TRUE)

Loads the Eax register with TRUE (1) and returns.


TEXT ("string")

Argument "string" must be a quoted string. It returns a string in ANSI or Unicode format.

Example:

Invoke lstrlen, TEXT ("Hello")

Eax returns 5, the length of the string in characters. For ANSI version it means 5 bytes, while for Unicode version it means 5 words (DW).

The string returned by TEXT will be in ANSI or Unicode format depending on the Use Unicode text strings option in the Project Properties.


REMARKS
: The TEXT macro always returns the effective address of the specified string, so you should NEVER use the Addr operator.

IMPORTANT: If you are not going to use any of these macros (included by default), or their names conflict with any variable, procedure o macro name of the project, you just can remove them by unchecking the corresponding option in Project Properties.