Support FPE card auto-detection.

The second parameter of #pragma float is now optional, and if it missing or invalid then the FPE slot is auto-detected by the start-up code. This is done by calling the new ~InitFloat function in the FPE version of SysFloat.
This commit is contained in:
Stephen Heumann 2023-06-26 18:33:54 -05:00
parent adcab004df
commit 9a56a50f5f
4 changed files with 14 additions and 8 deletions

Binary file not shown.

View File

@ -2547,13 +2547,15 @@ procedure InitFile {keepName: gsosOutStringPtr; keepFlag: integer; partial: bool
SetDataBank;
{set FPE slot, if using FPE}
if floatCard = 1 then
if floatSlot in [1..7] then begin
CnOut(m_pea);
CnOut2(floatSlot);
CnOut(m_jsl);
RefName(@'SETFPESLOT', 0, 3, 0);
end; {if}
if floatCard = 1 then begin
CnOut(m_lda_imm);
if floatSlot in [1..7] then
CnOut2(floatSlot)
else
CnOut2(0);
CnOut(m_jsl);
RefName(@'~INITFLOAT', 0, 3, 0);
end; {if}
{write JSL to main entry point}
CnOut(m_jsl);

View File

@ -3151,6 +3151,8 @@ var
floatSlot := token.ival;
NextToken;
end {if}
else if token.kind = eolsy then
floatSlot := 0
else
Error(18);
end; {DoFloat}

View File

@ -687,7 +687,9 @@ A new #pragma optimize bit has now been introduced to control this behavior. Se
Changes to #pragma float
------------------------
If #pragma float is used to generate code for an FPE card, the slot number given in the pragma is now used to configure the FPE slot. This removes the need to call setfpeslot() in the program's code, although that can still be done to override the setting in #pragma float. If the specified slot number is not in the range 1-7, it will be ignored and setfpeslot() will still need to be used. You must also call setfpeslot() if you wish to use the FPE in any of the special types of programs that can be created using other pragmas.
The second numeric parameter to #pragma float is now optional. If it is provided, it specifies the slot number of the FPE card. If it is not provided or is not in the range 1-7, the FPE card is auto-detected instead. With these changes, it is generally no longer necessary to call setfpeslot() in programs that use the FPE card.
If you use #pragma float in any of the special types of programs that can be created using other pragmas, the slot parameter will be ignored and the FPE will not be auto-detected. In those cases, the program will still need to call setfpeslot() to set the slot number before doing any floating-point operations.
Additions to #pragma ignore