From: Ben S. <pow...@16...> - 2014-03-07 10:57:37
|
Hello, for the definition in stm8/gen.h typedef struct asmop_byte { bool in_reg; union { reg_info *reg; /* Register this byte is in. */ long int stk; /* Stack offset for this byte. */ } byteu; } asmop_byte; typedef struct asmop { AOP_TYPE type; short size; union { value *aop_lit; char *aop_immd; char *aop_dir; asmop_byte bytes[8]; } aopu; signed char regs[6]; // Byte of this aop that is in the register. -1 if no byte of this aop is in the reg. } asmop; 1. Does offset i (and i + 1) of an asmop in register X (for example) mean the following 2 conditions are both true ? (1) asmop.regs[XL_IDX] == i && asmop.regs[XH_IDX] == i + 1 (2) asmop.aopu.bytes[i].in_reg == TRUE && asmop.aopu.bytes[i].byteu.reg == &stm8_regs[XL_IDX] && asmop.aopu.bytes[i + 1].in_reg == TRUE && asmop.aopu.bytes[i + 1].byteu.reg = &stm8_regs[XH_IDX] Are there exceptions ? I find in the function "static void aopOp (operand *op, const iCode *ic)" both fields of an asmop are set. While the function "static bool aopInReg (const asmop *aop, int offset, short rIdx)" only uses aopu. 2. If these 2 do not equal, what is the difference ? I find in the code, sometimes aopInReg(aop, i, XL_IDX) is called, and sometimes "aop->regs[XL_IDX] == i " is used. Ben |