/* A Dalvik interpreter might include instruction implementations like these */ typedef void (*inst_t)(unsigned char *ip, void *insts[], int *regbase); void add_int(unsigned char *ip, void *insts[], int *regbase) { regbase[ip[1]] = regbase[ip[2]] + regbase[ip[3]]; ip+=4; inst_t next = insts[ip[0]]; next(ip, insts, regbase); } void add_int_2addr(unsigned char *ip, void *insts[], int *regbase) { unsigned long regs = ip[1]; regbase[regs&15] += regbase[regs>>4]; ip+=2; inst_t next = insts[ip[0]]; next(ip, insts, regbase); }