Defining C Macros Containing HLI Assembler Code

You can define some ANSI C macros that contain HLI assembler statements when working with the HLI assembler. Because the HLI assembler is heavily Backend-dependent, the following example uses a pseudo Assembler Language.

Listing: Coding Example
CLR Reg0       ; Clear Register zero
CLR Reg1       ; Clear Register one

CLR var        ; Clear variable `var' in memory

LOAD var,Reg0  ; Load the variable `var' into Register 0

LOAD #0, Reg0  ; Load immediate value zero into Register 0

LOAD @var,Reg1 ; Load address of variable `var' into Reg1

STORE Reg0,var ; Store Register 0 into variable `var'

The HLI instructions above are only a possible solution. For real applications, replace the pseudo HLI instructions above with the HLI instructions for your target.