VOGONS


First post, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

The LaserLok code in Championship Manager 2 uses this. I don't know how I missed it before.
It hooks int 6 (invalid opcode) then executes 0xff 0xff, expecting the hook to be hit., which doesn't happen.
No exception is raised.

Reply 1 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
peterferrie wrote:

The LaserLok code in Championship Manager 2 uses this. I don't know how I missed it before. It hooks int 6 (invalid opcode) then executes 0xff 0xff, expecting the hook to be hit., which doesn't happen. No exception is raised.

What core are you using?

A very quick scan of the 0.72 sources reveals that at least in the dynamic cores, some exceptions may be missing:

In core_dynrec/decoder.h:

		case 0xfe:
if (dyn_grp4_eb()) goto finish_block;
break;
case 0xff:
if (dyn_grp4_ev()) goto core_close_block;
break;

I'd expect a "goto illegalopcode;" before both breaks.

In core_dyn_x86/decoder.h:

		case 0xff: 
/* ... */
default:
IllegalOption("opcode 0xff");

Again, I'd expect a "goto illegalopcode;" after the IllegalOption() call.

Note that these are just quick scans, I have no experience with the code of these course at all, so I may be wrong.

JAL

Reply 3 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
peterferrie wrote:

I suspect that all of the cores are affected. I posted in a different message a patch for the normal core, which is what I was using at the time.

I suspected as much, but I didn't have enough time to check. I hope one of the developers will find this thread to explain what's happening there (or not).

JAL

Reply 6 of 7, by jal

User metadata
Rank Oldbie
Rank
Oldbie
h-a-l-9000 wrote:

They don't trust the exception handlers that games may install and exit DOSBox instead so the program won't do random harm.

There's no exiting DOSBox at all here, since the exception is not generated.

EDIT: E.g. this thread suggests that DOSBox is supposed to exit when 0xffff is encountered, but what I understand from the OP, there is no exception raised at all.

JAL

Reply 7 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

There's no exiting DOSBox at all here, since the exception is not generated.

DOSBox is calling E_Exit() when the instruction is encountered, that is the "exit" here; although the error message displayed in the status window is different for normal and dynamic core.