Hello again!!
Switching to COMPACT mode instead of TINY solved many pointer/far pointer programs.
I have come across a problem that I don't know how to solve, and so I am requesting if someone does.
The relevant code bits are the following:
ppcross8086.exe -WmCompact -Wtexe -Sg KEYB.PAS
===
TYPE
SimpleProc = procedure; { parameter-less callable function }
...
CONST
...
BIOSStoreKey: SimpleProc = NIL; { procedure EXCLUSIVE to StoreKey }
...
Procedure EfStoreKey0; far; assembler;
asm
...
end;
...
BIOSStorekey := EfStoreKey0;
===
This last line gives the error:
KEYB.PAS(2960,21) Error: Incompatible types: got "untyped" expected "<procedure variable type of procedure;Pascal>"
I assume that, whereas TPC is assuming that EfStoreKey0 is a procedure-type variable, FPC assumes that I want to assign the result of executing the procedure, which I assume is "untyped" (as in C would be void).
I don't know how to solve it. According to FPC documentation, this should make it work:
BIOSStorekey := @EfStoreKey0;
but it gives
KEYB.PAS(2960,21) Error: Incompatible types: got "<address of procedure;far;Pascal>" expected "<procedure variable type of procedure;Pascal>"
and
BIOSStorekey := SimpleProc(@EfStoreKey0);
KEYB.PAS(2960,21) Error: Illegal type conversion: "<address of procedure;far;Pascal>" to "<procedure variable type of procedure;Pascal>"
and
BIOSStorekey := @EfStoreKey0^;
KEYB.PAS(2960,34) Error: Illegal qualifier
(Also not using the TYPE or replacing VAR for CONST does not make a difference)
What is wrong here?
The -MTP option does NOT help, it produces a bunch new errors, that are corrected if I use:
TYPE
SimpleProc = procedure; far; { parameter-less callable function }
...
which is NOT TPC compatible.
And the "old" problem is not corrected anyway, it is changed to:
KEYB.PAS(2960,21) Error: Illegal type conversion: "<address of procedure;far;Pascal>" to "NearCsPointer"
Thanks in advance for your help,
Aitor