Macro Processor Overview

The FHDL macro processor was designed to provide a convenient method for expanding the FHDL language. Currently the FHDL compiler recognizes functional blocks such as registers and ALUs. The FHDL macro processor provides a method for defining new functional blocks and for implementing other language extensions. The macro processor can also be used to extend the capabilities of the FHDL ROM and PLA preprocessors.

The syntax of an FHDL macro statement is identical to that of an ordinary FHDL statement. Each statement contains a label field, an opcode, and an operand field. The label field starts at the first character of the statement and ends with a colon (:). The label field is optional for most macro statements. The opcode, which is mandatory for all statements, must be separated from the label field by one or more spaces or tabs. If there is no label field, the opcode must be preceded by one or more spaces or tabs to signify that the label field is missing. The operand field, which must be separated from the opcode by one or more spaces or tabs, consists of one or more operands separated by commas. The operand field is optional for some statements. Every statement must be terminated by a newline character (return key) or a semicolon (;). A statement normally occupies only one line, but if the operand field ends with a comma, the operand field is assumed to be continued on the next line.

All language extensions are implemented in the form of macro instructions. Macro definitions may be included with the FHDL text that uses them, or they may be placed in one or more macro libraries. Placement of macro instructions is discussed in detail in the following sections.