1 %default {"result":"%eax"} 2 /* 3 * Generic 32-bit "lit8" binary operation. Provide an "instr" line 4 * that specifies an instruction that performs "result = eax op ecx". 5 * This could be an x86 instruction or a function call. (If the result 6 * comes back in a register other than r0, you can override "result".) 7 * 8 * For: add-int/lit8, rsub-int/lit8 9 * and-int/lit8, or-int/lit8, xor-int/lit8, 10 * shl-int/lit8, shr-int/lit8, ushr-int/lit8 11 */ 12 /* binop/lit8 vAA, vBB, #+CC */ 13 movzbl 2(rPC),%eax # eax<- BB 14 movsbl 3(rPC),%ecx # ecx<- ssssssCC 15 movzx rINST_HI,rINST_FULL # rINST_FULL<- AA 16 GET_VREG (%eax,%eax) # eax<- rBB 17 $instr # ex: addl %ecx,%eax 18 SET_VREG ($result,rINST_FULL) 19 FETCH_INST_WORD(2) 20 ADVANCE_PC(2) 21 GOTO_NEXT 22