2
$Id: simbase.pas,v 1.2 2002/09/07 15:40:37 peter Exp $
3
This file is part of the Free Pascal simulator environment
4
Copyright (c) 1999-2000 by Florian Klaempfl
6
This unit implemements some helper routines
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
**********************************************************************}
31
{ tindex must be at least of type integer }
38
tdword = array[0..3] of byte;
47
1 : (low32,high32 : dword);
48
2 : (bytes : array[0..7] of byte);
49
3 : (words : array[0..3] of word);
52
oword = array[0..7] of word;
56
1 : (bytes : array[0..15] of byte);
57
2 : (words : array[0..7] of word);
58
3 : (low64,high64 : qword);
61
function hexstr(val : longint;cnt : byte) : string;
62
function qword2str(q : qword) : string;
63
function realtime : double;
70
function hexstr(val : longint;cnt : byte) : string;
73
HexTbl : array[0..15] of char='0123456789ABCDEF';
80
for i:=cnt downto 1 do
82
hexstr[i]:=hextbl[val and $f];
87
function qword2str(q : qword) : string;
90
qword2str:=hexstr(tqwordrec(q).high32,8)+hexstr(tqwordrec(q).low32,8);
93
function realtime : double;
100
realtime:=h*3600+m*60+s+s100/100.0;
103
procedure _stopsim;{$ifdef TP}far;{$endif TP}
106
writeln('Simulation stopped');
118
$Log: simbase.pas,v $
119
Revision 1.2 2002/09/07 15:40:37 peter
120
* old logs removed and tabs fixed