1 %default {"result":"%eax"} 2 /* 3 * Generic 32-bit "lit16" 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 eax, you can override "result".) 7 * 8 * For: add-int/lit16, rsub-int, 9 * and-int/lit16, or-int/lit16, xor-int/lit16 10 */ 11 /* binop/lit16 vA, vB, #+CCCC */ 12 movzbl rINST_HI,%eax # eax<- 000000BA 13 sarl $$4,%eax # eax<- B 14 GET_VREG(%eax,%eax) # eax<- vB 15 movswl 2(rPC),%ecx # ecx<- ssssCCCC 16 movzbl rINST_HI,rINST_FULL # rINST_FULL<- BA 17 andb $$0xf,rINST_LO # rINST_FULL<- A 18 $instr # for example: addl %ecx, %eax 19 SET_VREG($result,rINST_FULL) 20 FETCH_INST_WORD(2) 21 ADVANCE_PC(2) 22 GOTO_NEXT 23