Fusion_C and HTIMI

Pagina 2/2
1 |

Van zPasi

Champion (472)

afbeelding van zPasi

01-10-2019, 07:26

Grauw wrote:
zPasi wrote:

I think there might come problems if using disk-rom etc when the handler is active, depending on where in ram "my_int_function" is located. Haven't tested that yet. But most BIOS usage, like KB / joystick reading etc should be fine.

It works fine if all the interrupt handling code is in page 3.

I'm using interslot call. In SetInterruptHandler() I install an "int-handler" (starting at inthandler_start: ) to page 3. That handler makes interslot call to the user code, that may reside even on page 0.

So I could skip that "int-handler" and use CALLF instead?

The thing I'm not sure about is, will it work, if the user code is near page-boundary? Normally it will be fine, when the hook is been called, page 0 is BIOS and page 1 and following are RAM, it doesn't matter where there user code is. But what if page 1 is some ROM?

Van Grauw

Ascended (8457)

afbeelding van Grauw

01-10-2019, 10:34

Ah, yes good point, I missed that! Because I saw a C3H in the hook instead of a CALLF I assumed you didn’t.

But you got a good point that if the code that you’re calling is near a page boundary there will still be an issue, because e.g. if the handler address is at 3FF0H and the handler is 20H bytes long, then it will only have swapped in the correct page 0. And page 1 can be ROM when an interrupt occurs (e.g. DiskROM). I suppose the only thing you can do is to make sure the code doesn’t cross a page boundary (I don’t know how to instruct the linker to make sure that doesn’t happen). Or configure the entire slot layout in the handler, but that seems to become quite cumbersome.

Van ducasp

Master (154)

afbeelding van ducasp

02-10-2019, 01:02

zPasi wrote:
Grauw wrote:
zPasi wrote:

I think there might come problems if using disk-rom etc when the handler is active, depending on where in ram "my_int_function" is located. Haven't tested that yet. But most BIOS usage, like KB / joystick reading etc should be fine.

It works fine if all the interrupt handling code is in page 3.

I'm using interslot call. In SetInterruptHandler() I install an "int-handler" (starting at inthandler_start: ) to page 3. That handler makes interslot call to the user code, that may reside even on page 0.

So I could skip that "int-handler" and use CALLF instead?

The thing I'm not sure about is, will it work, if the user code is near page-boundary? Normally it will be fine, when the hook is been called, page 0 is BIOS and page 1 and following are RAM, it doesn't matter where there user code is. But what if page 1 is some ROM?

Makes sense, for a library it is better, in my code I've preferred to move the function at startup using ldir for page 4 and used a simple call to get better performance. Smile

Pagina 2/2
1 |