Yoshiki Ohshima wrote:
Apparently, %esi is used (exclusively) for IP, and %ebx keeps the next byte, and "jmp *" takes you to the next location stored in the table starts at 0x2780.
All of that comes straight out of sqGnu.h:
#define BC_CASE(N) case N: _##N: #define BC_BREAK goto *jumpTable[currentBytecode]
#if defined(__i386__) # define IP_REG asm("%esi") # define SP_REG asm("%edi") # define CB_REG asm("%ebx") #endif
You might want to check if the gnuifier got confused over time - I had to update it to deal correctly with sqInt etc. gnu-interp.c should look like here:
sqInt interpret(void) { sqInt localReturnValue; sqInt localReturnContext; sqInt localHomeContext; register char* localSP SP_REG; register char* localIP IP_REG; register sqInt currentBytecode CB_REG; BC_JUMP_TABLE;
switch (currentBytecode) { BC_CASE(0) /* pushReceiverVariableBytecode */ BC_BREAK;
%esi is almost used for IP but use %eax for fetching the next byte, jmp also seems to use %eax so right before it is spilled and the destination address is brought into %eax.
Sounds more like the static register assignments get ignored.
Cheers, - Andreas