CtoASM.inc


/*
    CtoASM.inc

    Specify the parameter passing from C functions

    Michael Stumpf, (c) 9. August 1999
*/

#ifndef __CTOASM_INC
#define __CTOASM_INC

#define rP0      R25   /* first incoming parameter (MSB) */
#define rP1      R24   /* 2nd incoming parameter         */
#define rP2      R23   /* 3rd incoming parameter         */
#define rP3      R22   /* 4th incoming parameter         */
#define rP4      R21   /* */
#define rP5      R20   /* */
#define rP6      R19   /* */
#define rP7      R18   /* */

#define rByte    R24   /* a function returning a byte passes this as if it was
                          an integer in R25:R24, but R25 is unused */
/* temporary registers, usable without saving,
   maybe clobbered after an external function call */
#ifndef __tmp_reg__
#define __tmp_reg__     R0
#endif
#ifndef __zero_reg__
#define __zero_reg__    R1
#endif

#define rTI0     R31  /* 1st temporary with immidiate */
#define rTI1     R30  /* 2nd temporary with immidiate */
#define rTI2     R27  /* 3rd temporary with immidiate */
#define rTI3     R26  /* 4th temporary with immidiate */

/* registers wich have to be saved */
#define rSI0     R17   /* first saved (pushed) register with immidiate */
#define rSI1     R16   /* 2nd push register  */
#define rSI2     R29   /* 3rd saved (pushed) register */
#define rSI3     R28   /* 4th saved (pushed) register  */

#define rS0      R15   /* 3rd pushed register  */
#define rS1      R14   /* 4th pushed register  */
#define rS2      R13   /* */
#define rS3      R12   /* */
#define rS4      R11   /* */
#define rS5      R10   /* */
#define rS6      R9    /* */
#define rS7      R8    /* */
#define rS8      R7    /* */
#define rS9      R6    /* */
#define rS10     R5    /* */
#define rS11     R4    /* */
#define rS12     R3    /* */
#define rS13     R2    /* */

#endif /* __CTOASM_INC */

Back