FictionTools/z88dk/src/sccz80/codegen.c
/* Push an argument for a function pointer call: regular or far pointer */
Push an argument for a function pointer call: regular or far pointer
Push an argument for a function pointer call : regular or far pointer
int push_function_argument(Kind expr, Type *type, int push_sdccchar)
{
    if (expr == KIND_DOUBLE) {
        dpush();
        return type_double->size;
    } else if (expr == KIND_LONG || expr == KIND_CPTR) {
        lpush();
        return 4;
    } else if ( expr == KIND_CHAR && push_sdccchar ) {
        ol("ld\tb,l");
        ol("push\tbc");
        ol("inc\tsp");
        Zsp--;
        return 1;
    } else if (expr == KIND_STRUCT) {
        swap();             
        vconst(-type->size);
        ol("add\thl,sp");
        ol("ld\tsp,hl");
        Zsp -= type->size;
        swap();
        outfmt("\tld\tbc,%d\n",type->size);
        ol("ldir");
        return type->size;
    } 
    zpush();
    return 2;
}
int push_function_argument ( Kind expr , Type * type , int push_sdccchar ) { if ( expr == KIND_DOUBLE ) { dpush ( ) ; return type_double -> size ; } else if ( expr == KIND_LONG || expr == KIND_CPTR ) { lpush ( ) ; return 4 ; } else if ( expr == KIND_CHAR && push_sdccchar ) { ol ( " \t " ) ; ol ( " \t " ) ; ol ( " \t " ) ; Zsp -- ; return 1 ; } else if ( expr == KIND_STRUCT ) { swap ( ) ; vconst ( - type -> size ) ; ol ( " \t " ) ; ol ( " \t " ) ; Zsp -= type -> size ; swap ( ) ; outfmt ( " \t \t \n " , type -> size ) ; ol ( " " ) ; return type -> size ; } zpush ( ) ; return 2 ; }
Push an argument for a function pointer call: regular or far pointer
Push an argument for a function pointer call : regular or far pointer
/* de = stack address */ // Default push the word