get_opcode no longer present. I use it for the sake of skip instruction. I do not know a priori the length of the next instruction as it can be either 16 or 32 bits.
On Sun, Jun 5, 2016 at 6:33 AM, Richard Henderson <r...@twiddle.net> wrote: > On 06/02/2016 01:07 PM, Michael Rolnik wrote: > >> +uint32_t get_opcode( >> + uint8_t const *code, >> + unsigned bitBase, >> + unsigned bitSize) >> +{ >> + return *(uint16_t *)code; >> +} >> > > Unused. And what was this supposed to do? > > + /* decode next instruction */ >> + ctx.inst[1].cpc = ctx.inst[0].npc; >> + decode_opc(cpu, &ctx, &ctx.inst[1]); >> > > Why are you decoding one instruction ahead? > > While I can see that this might be keen for some of the skip-next > instructions, I don't see that you're using that just now. So perhaps > delay this until it's actually used? > > > r~ > -- Best Regards, Michael Rolnik