[fpc-pascal] Interruption handling on i8086

Guillermo gmartinez at burdjia.com
Fri Apr 9 19:56:12 CEST 2021


Hi pascaloids,

I'm doing DOS development for fun and, after installing the compiler
(was quite hard), I'm having problems handling interrupts.

I started with keyboard and it doesn't work.  The handler declaration:

  procedure DOS_KbdHandler; interrupt;

but compiler says:

  keybrd.inc(14,29) Warning: Calling convention directive ignored:
  "OldFPCCall"

When running the program in DOSBox it just executes the interruption
once when I press any key and then the interruption doesn't executes
anymore.  I thought the compiler doesn't manage the interruption
enter/exit stuff properly (since it says the calling convention was
ignored) so I tried to add the "CLI" and "STI IRET" by myself, but the
compiler sayd:

  keybrd.inc(21,7) Error: Instruction not supported by the selected
  instruction set

The instruction not supported is IRET.

BTW, I tried the same thing for DOS 32bits (with all the GO32V2 stuff)
and it worked as expected.  I've attached both 16bits and 32bits code,
complete with initialization, handling and finalization.

Do anybody see what I'm doing wrong?  How can I fix it?

Guillermo "Ñuño" Martínez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyb16.inc
Type: application/octet-stream
Size: 281 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210409/6990aeba/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyb32.inc
Type: application/octet-stream
Size: 2420 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210409/6990aeba/attachment-0001.obj>


More information about the fpc-pascal mailing list