How the Code Generator Transfers Parameters

The code generator uses standard Proton macros where possible to transfer data from the Macro to the Subroutine variables.  However, there are some special cases which require additional macros.

 

Numeric Data Types 

 

The following table lists the transfer types and the standard macros used.

 

Var Type

Standard Macros Used

No Alt Types

Alternative Types

Byte

BYTE_BYTE, NUM_BYTE

NUM_BYTE, FLOAT_BYTE

Word

WORD_WORD, WORD_NUM

NUM_WORD, BYTE_WORD, FLOAT_WORD

DWord

DWORD_DWORD, NUM_DWORD

NUM_DWORD, BYTE_DWORD, WORD_DWORD, FLOAT_DWORD

Float

FLOAT_FLOAT, NUM_FLOAT

NUM_FLOAT, BYTE_FLOAT, WORD_FLOAT, DWORD_FLOAT

 

 

Arrays and String Arrays

 

When transferring Arrays only the pointer will be passed in the variable.  The macro generator allows you to handle this in 2 different ways: either by passing the pointer into a named Variable (this should be a Word Variable) or by placing the pointer into a FSR register.

 

This latter option allows you to use the POSTINC function in conjunction with the FSR to load an array in your subroutine.

 

Var Type

Macros Used

Saved to Var

Saved to FSR(n)

Byte Array

NUM_WORD

NUM_FSR(n) *See below

Word Array

NUM_WORD

NUM_FSR(n) *See below

Char

LABEL_WORD  * See below

 

 

Labels

 

Var Type

Macros Used

Label

LABEL_WORD  *See below

 

NUM_FSR and LABEL_WORD have been added to the REG_LD16.INC and REG_LD14.INC files in the Proton Compiler directory.