FictionTools/z88dk/src/sccz80/codegen.c
/* Compute remainder (mod) of secondary register divided
 *      by the primary
 *      (remainder in primary, quotient in secondary)
 */
Compute remainder (mod) of secondary register divided
by the primary
(remainder in primary, quotient in secondary)
Compute remainder ( mod ) of secondary register divided by the primary ( remainder in primary quotient in secondary )
void zmod(LVALUE* lval)
{
    if (c_notaltreg && (lval->val_type == KIND_LONG || lval->val_type == KIND_CPTR)) {
        if (ulvalue(lval))
            callrts("l_long_mod_u");
        else
            callrts("l_long_mod");
        Zsp += 4;
    } else {
        if ( IS_GBZ80() ) {
            if (ulvalue(lval))
                callrts("l_mod_u");
            else
                callrts("l_mod");
        } else {
            zdiv(lval);
            if (lval->val_type == KIND_LONG || lval->val_type == KIND_CPTR)
                doexx();
            else
                swap();
        }
    }
}
void zmod ( LVALUE * lval ) { if ( c_notaltreg && ( lval -> val_type == KIND_LONG || lval -> val_type == KIND_CPTR ) ) { if ( ulvalue ( lval ) ) callrts ( " " ) ; else callrts ( " " ) ; Zsp += 4 ; } else { if ( IS_GBZ80 ( ) ) { if ( ulvalue ( lval ) ) callrts ( " " ) ; else callrts ( " " ) ; } else { zdiv ( lval ) ; if ( lval -> val_type == KIND_LONG || lval -> val_type == KIND_CPTR ) doexx ( ) ; else swap ( ) ; } } }
Compute remainder (mod) of secondary register divided
      by the primary
      (remainder in primary, quotient in secondary)
Compute remainder ( mod ) of secondary register divided by the primary ( remainder in primary quotient in secondary )
// TODO: This or just load registers?