mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 23:14:02 +02:00
+ added n8086cal.pas, based on n386cal.pas; this pulls in nx86cal.pas as well and fixes compilation of the system unit on i8086 after the merge of the i8086 branch to trunk
git-svn-id: trunk@24335 -
This commit is contained in:
parent
a07af824ea
commit
3853d06ac0
17
.gitattributes
vendored
17
.gitattributes
vendored
@ -244,6 +244,7 @@ compiler/i8086/i8086op.inc svneol=native#text/plain
|
|||||||
compiler/i8086/i8086prop.inc svneol=native#text/plain
|
compiler/i8086/i8086prop.inc svneol=native#text/plain
|
||||||
compiler/i8086/i8086tab.inc svneol=native#text/plain
|
compiler/i8086/i8086tab.inc svneol=native#text/plain
|
||||||
compiler/i8086/n8086add.pas svneol=native#text/plain
|
compiler/i8086/n8086add.pas svneol=native#text/plain
|
||||||
|
compiler/i8086/n8086cal.pas svneol=native#text/plain
|
||||||
compiler/i8086/n8086inl.pas svneol=native#text/plain
|
compiler/i8086/n8086inl.pas svneol=native#text/plain
|
||||||
compiler/i8086/n8086mat.pas svneol=native#text/plain
|
compiler/i8086/n8086mat.pas svneol=native#text/plain
|
||||||
compiler/i8086/r8086ari.inc svneol=native#text/plain
|
compiler/i8086/r8086ari.inc svneol=native#text/plain
|
||||||
@ -10597,7 +10598,7 @@ tests/test/jvm/trange3.pp svneol=native#text/plain
|
|||||||
tests/test/jvm/tset1.pp svneol=native#text/plain
|
tests/test/jvm/tset1.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tset3.pp svneol=native#text/plain
|
tests/test/jvm/tset3.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tset7.pp svneol=native#text/plain
|
tests/test/jvm/tset7.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tsetansistr.pp -text svneol=native#text/plain
|
tests/test/jvm/tsetansistr.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tstr.pp svneol=native#text/plain
|
tests/test/jvm/tstr.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tstring1.pp svneol=native#text/plain
|
tests/test/jvm/tstring1.pp svneol=native#text/plain
|
||||||
tests/test/jvm/tstring9.pp svneol=native#text/plain
|
tests/test/jvm/tstring9.pp svneol=native#text/plain
|
||||||
@ -13156,7 +13157,7 @@ tests/webtbs/tw19548.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw19555.pp svneol=native#text/pascal
|
tests/webtbs/tw19555.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw19581.pp svneol=native#text/plain
|
tests/webtbs/tw19581.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw19610.pp svneol=native#text/plain
|
tests/webtbs/tw19610.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw19622.pp -text svneol=native#text/plain
|
tests/webtbs/tw19622.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1964.pp svneol=native#text/plain
|
tests/webtbs/tw1964.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw19651.pp svneol=native#text/plain
|
tests/webtbs/tw19651.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw19700.pp svneol=native#text/plain
|
tests/webtbs/tw19700.pp svneol=native#text/plain
|
||||||
@ -13224,7 +13225,7 @@ tests/webtbs/tw20872c.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw20873.pp svneol=native#text/plain
|
tests/webtbs/tw20873.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw20874a.pp svneol=native#text/pascal
|
tests/webtbs/tw20874a.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw20874b.pp svneol=native#text/pascal
|
tests/webtbs/tw20874b.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw20880.pp -text svneol=native#text/plain
|
tests/webtbs/tw20880.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw20889.pp svneol=native#text/pascal
|
tests/webtbs/tw20889.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw20909.pp svneol=native#text/pascal
|
tests/webtbs/tw20909.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw20940.pp svneol=native#text/pascal
|
tests/webtbs/tw20940.pp svneol=native#text/pascal
|
||||||
@ -13357,7 +13358,7 @@ tests/webtbs/tw2317.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw2318.pp svneol=native#text/plain
|
tests/webtbs/tw2318.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23185.pp svneol=native#text/pascal
|
tests/webtbs/tw23185.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw2318b.pp svneol=native#text/plain
|
tests/webtbs/tw2318b.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23204.pp -text svneol=native#text/plain
|
tests/webtbs/tw23204.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23212.pp svneol=native#text/plain
|
tests/webtbs/tw23212.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2323.pp svneol=native#text/plain
|
tests/webtbs/tw2323.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23270.pp svneol=native#text/pascal
|
tests/webtbs/tw23270.pp svneol=native#text/pascal
|
||||||
@ -13370,17 +13371,17 @@ tests/webtbs/tw23447.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw23486.pp svneol=native#text/pascal
|
tests/webtbs/tw23486.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw23503.pp svneol=native#text/pascal
|
tests/webtbs/tw23503.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw2351.pp svneol=native#text/plain
|
tests/webtbs/tw2351.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23568.pp -text svneol=native#text/plain
|
tests/webtbs/tw23568.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2363.pp svneol=native#text/plain
|
tests/webtbs/tw2363.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23667.pp svneol=native#text/plain
|
tests/webtbs/tw23667.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23725.pp svneol=native#text/pascal
|
tests/webtbs/tw23725.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw23744.pp svneol=native#text/plain
|
tests/webtbs/tw23744.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2377.pp svneol=native#text/plain
|
tests/webtbs/tw2377.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2378.pp svneol=native#text/plain
|
tests/webtbs/tw2378.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23819.pp -text svneol=native#text/plain
|
tests/webtbs/tw23819.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2382.pp svneol=native#text/plain
|
tests/webtbs/tw2382.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2388.pp svneol=native#text/plain
|
tests/webtbs/tw2388.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23912.pp -text svneol=native#text/plain
|
tests/webtbs/tw23912.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw23962.pp svneol=native#text/plain
|
tests/webtbs/tw23962.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2397.pp svneol=native#text/plain
|
tests/webtbs/tw2397.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw24007.pp svneol=native#text/plain
|
tests/webtbs/tw24007.pp svneol=native#text/plain
|
||||||
@ -14168,7 +14169,7 @@ tests/webtbs/uw2266b.pas svneol=native#text/plain
|
|||||||
tests/webtbs/uw2269.inc svneol=native#text/plain
|
tests/webtbs/uw2269.inc svneol=native#text/plain
|
||||||
tests/webtbs/uw22741a.pp svneol=native#text/plain
|
tests/webtbs/uw22741a.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw22741b.pp svneol=native#text/plain
|
tests/webtbs/uw22741b.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw23204.pp -text svneol=native#text/plain
|
tests/webtbs/uw23204.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw2364.pp svneol=native#text/plain
|
tests/webtbs/uw2364.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw2706a.pp svneol=native#text/plain
|
tests/webtbs/uw2706a.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw2706b.pp svneol=native#text/plain
|
tests/webtbs/uw2706b.pp svneol=native#text/plain
|
||||||
|
@ -49,8 +49,8 @@ unit cpunode;
|
|||||||
nx86con,
|
nx86con,
|
||||||
nx86cnv,
|
nx86cnv,
|
||||||
|
|
||||||
n8086add{,
|
n8086add,
|
||||||
n386cal,
|
n8086cal{,
|
||||||
n386mem,
|
n386mem,
|
||||||
n386set},
|
n386set},
|
||||||
n8086inl,
|
n8086inl,
|
||||||
|
97
compiler/i8086/n8086cal.pas
Normal file
97
compiler/i8086/n8086cal.pas
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
Copyright (c) 1998-2002 by Florian Klaempfl
|
||||||
|
|
||||||
|
Generate i8086 assembler for in call nodes
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
****************************************************************************
|
||||||
|
}
|
||||||
|
unit n8086cal;
|
||||||
|
|
||||||
|
{$i fpcdefs.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
{ $define AnsiStrRef}
|
||||||
|
|
||||||
|
uses
|
||||||
|
nx86cal;
|
||||||
|
|
||||||
|
type
|
||||||
|
ti8086callnode = class(tx86callnode)
|
||||||
|
protected
|
||||||
|
procedure pop_parasize(pop_size:longint);override;
|
||||||
|
procedure extra_interrupt_code;override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
globtype,systems,
|
||||||
|
cutils,verbose,globals,
|
||||||
|
cgbase,cgutils,
|
||||||
|
cpubase,paramgr,
|
||||||
|
aasmtai,aasmdata,aasmcpu,
|
||||||
|
ncal,nbas,nmem,nld,ncnv,
|
||||||
|
cga,cgobj,cpuinfo;
|
||||||
|
|
||||||
|
|
||||||
|
{*****************************************************************************
|
||||||
|
TI8086CALLNODE
|
||||||
|
*****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
procedure ti8086callnode.extra_interrupt_code;
|
||||||
|
begin
|
||||||
|
emit_none(A_PUSHF,S_W);
|
||||||
|
emit_reg(A_PUSH,S_W,NR_CS);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure ti8086callnode.pop_parasize(pop_size:longint);
|
||||||
|
var
|
||||||
|
hreg : tregister;
|
||||||
|
begin
|
||||||
|
if (paramanager.use_fixed_stack) then
|
||||||
|
begin
|
||||||
|
{ very weird: in this case the callee does a "ret $4" and the }
|
||||||
|
{ caller immediately a "subl $4,%esp". Possibly this is for }
|
||||||
|
{ use_fixed_stack code to be able to transparently call }
|
||||||
|
{ old-style code (JM) }
|
||||||
|
dec(pop_size,pushedparasize);
|
||||||
|
if (pop_size < 0) then
|
||||||
|
current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_SUB,S_W,-pop_size,NR_SP));
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ better than an add on all processors }
|
||||||
|
if pop_size=2 then
|
||||||
|
begin
|
||||||
|
hreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
|
||||||
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_POP,S_W,hreg));
|
||||||
|
end
|
||||||
|
{ the pentium has two pipes and pop reg is pairable }
|
||||||
|
{ but the registers must be different! }
|
||||||
|
else
|
||||||
|
if pop_size<>0 then
|
||||||
|
current_asmdata.CurrAsmList.concat(taicpu.op_const_reg(A_ADD,S_W,pop_size,NR_SP));
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
ccallnode:=ti8086callnode;
|
||||||
|
end.
|
@ -28,7 +28,7 @@
|
|||||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
<Units Count="15">
|
<Units Count="16">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="pp.pas"/>
|
<Filename Value="pp.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -103,6 +103,11 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="n8086inl"/>
|
<UnitName Value="n8086inl"/>
|
||||||
</Unit14>
|
</Unit14>
|
||||||
|
<Unit15>
|
||||||
|
<Filename Value="i8086\n8086cal.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="n8086cal"/>
|
||||||
|
</Unit15>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
Loading…
Reference in New Issue
Block a user