Newer
Older
emul / emul_reg.h
#ifndef EMUL_REG__
#define EMUL_REG__

#define REG_SIZE 32
typedef enum {
    // 翻訳のための擬似オペランド
    OPERAND_DECODE_ERROR,

    Szero,    // Zero register

    Sat,      // using asem

    Sv0,      // return
    Sv1, 

    Sa0,      // argment
    Sa1, 
    Sa2, 
    Sa3, 

    St0,      // temp
    St1, 
    St2, 
    St3, 
    St4, 
    St5, 
    St6, 
    St7, 

    Ss0,      // var
    Ss1, 
    Ss2, 
    Ss3, 
    Ss4, 
    Ss5, 
    Ss6, 
    Ss7, 

    Sk0,      // kernel
    Sk1, 

    Sgp,      // grobal

    Ssp,      // stack

    Sfp,      // frame

    Sra,      // return address

    Spc       // program counter
} EMUL_REG;


/* initialize register 
 * this must be called */
void emul_reg_init();

int emul_reg_get(EMUL_REG r);
void emul_reg_set(EMUL_REG r, int value);

#endif