OSDN Git Service

JITCのソース整理
[heavyosecpu/HeavyOSECPU.git] / jitcx86a.c
index 4044493..ef06215 100644 (file)
@@ -166,17 +166,15 @@ int jitCompA000_selectRegCache(int rxx, int reg)
 \r
 void jitCompA000_loadPRegCacheAll(struct JitCompWork *w)\r
 {\r
-       //      jitCompPutOp_MOV_GReg_EBPDisp(w, 5 /* EBP */, 256 + 0 * 32 + 0); /* EBP = P00; */\r
-       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG6_ESI, 256 + 1 * 32 + 0); /* ESI = P01; */\r
-       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG7_EDI, 256 + 2 * 32 + 0); /* EDI = P02; */\r
+       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG6_ESI, PRegOffset(0x01) + 0); /* ESI = P01; */\r
+       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG7_EDI, PRegOffset(0x02) + 0); /* EDI = P02; */\r
        return;\r
 }\r
 \r
 void jitCompA000_storePRegCacheAll(struct JitCompWork *w)\r
 {\r
-       //      jitCompPutOp_MOV_EBPDisp_GReg(w, 256 + 0 * 32 + 0, 5 /* EBP */); /* P00 = EBP; */\r
-       jitCompPutOp_MOV_EBPDisp_GReg(w, 256 + 1 * 32 + 0, IA32_REG6_ESI); /* P01 = ESI; */\r
-       jitCompPutOp_MOV_EBPDisp_GReg(w, 256 + 2 * 32 + 0, IA32_REG7_EDI); /* P02 = EDI; */\r
+       jitCompPutOp_MOV_EBPDisp_GReg(w, PRegOffset(0x01) + 0, IA32_REG6_ESI); /* P01 = ESI; */\r
+       jitCompPutOp_MOV_EBPDisp_GReg(w, PRegOffset(0x02) + 0, IA32_REG7_EDI); /* P02 = EDI; */\r
        return;\r
 }\r
 \r
@@ -237,7 +235,7 @@ void jitCompA0001_checkType0(struct JitCompWork *w, int pxx, int typ, int ac)
 {\r
        if (typ <= 0) { w->err = JITC_ERR_BADTYPE; }\r
        if (typ > 0x7f) { w->err = JITC_ERR_INTERNAL; }\r
-       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG0_EAX, 256 + pxx * 32 + 4); /* MOV(EAX, [EBP+?]); */   /* typ */\r
+       jitCompPutOp_MOV_GReg_EBPDisp(w, IA32_REG0_EAX, PRegOffset(pxx) + 4); /* MOV(EAX, [EBP+?]); */  /* typ */\r
        jitCompPutByte3(w->dst, 0x83, 0xf8, typ & 0x7f);        /* CMP(EAX, ?); */\r
        jitCompPutByte2(w->dst, 0x0f, 0x85); /* JNE */\r
        jitCompPutImm32(w->dst, errfnc - (w->dst + 4));\r
@@ -255,11 +253,11 @@ void jitCompA0001_checkType(struct JitCompWork *w, int pxx, int typ, int ac)
 void jitCompA0001_checkLimit(struct JitCompWork *w, int reg, int pxx)\r
 {\r
        jitCompPutByte1(w->dst, 0x3b);  /* CMP(reg, [EBP+?]); */\r
-       jitCompPutModRM_Disp_BaseEBP(w, 256 + pxx * 32 + 8, reg);       /* p0 */\r
+       jitCompPutModRM_Disp_BaseEBP(w, PRegOffset(pxx) + 8, reg);      /* p0 */\r
        jitCompPutByte2(w->dst, 0x0f, 0x82); /* JB */\r
        jitCompPutImm32(w->dst, errfnc - (w->dst + 4));\r
        jitCompPutByte1(w->dst, 0x3b);  /* CMP(reg, [EBP+?]); */\r
-       jitCompPutModRM_Disp_BaseEBP(w, 256 + pxx * 32 + 12, reg);      /* p1 */\r
+       jitCompPutModRM_Disp_BaseEBP(w, PRegOffset(pxx) + 12, reg);     /* p1 */\r
        jitCompPutByte2(w->dst, 0x0f, 0x83); /* JAE */\r
        jitCompPutImm32(w->dst, errfnc - (w->dst + 4));\r
        return;\r