~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/tests/webtbs/tw1066b.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ %CPU=i386 }
 
2
{----------------cut here----------------}
 
3
 
 
4
{$asmmode intel}
 
5
{$inline on}
 
6
 
 
7
var
 
8
 somevar:longint;
 
9
 
 
10
 
 
11
procedure wastememory(x,y,color:longint);assembler;inline;
 
12
asm
 
13
mov edi,x
 
14
mov eax,y
 
15
cmp edi,0
 
16
jl @@wastememoryend
 
17
cmp eax,0
 
18
jl @@wastememoryend
 
19
cmp edi,1023
 
20
jg @@wastememoryend
 
21
cmp eax,767
 
22
jg @@wastememoryend
 
23
shl eax,12
 
24
mov ebx,color
 
25
add eax,somevar
 
26
mov [eax+edi*4],ebx
 
27
@@wastememoryend:
 
28
end ['eax','ebx','edi'];
 
29
 
 
30
 
 
31
procedure wastememory2(y,x1,x2,color:longint);assembler;inline;
 
32
asm
 
33
mov edi,x1
 
34
mov ecx,x2
 
35
mov eax,y
 
36
cmp edi,ecx
 
37
jle @@wastememory2dirok
 
38
xchg edi,ecx
 
39
@@wastememory2dirok:
 
40
cmp eax,0
 
41
jl @@endwastememory2
 
42
cmp eax,767
 
43
jg @@endwastememory2
 
44
cmp ecx,0
 
45
jl @@endwastememory2
 
46
cmp edi,1023
 
47
jg @@endwastememory2
 
48
cmp edi,0
 
49
jge @@wastememory2x1ok
 
50
mov edi,0
 
51
@@wastememory2x1ok:
 
52
cmp ecx,1023
 
53
jle @@wastememory2x2ok
 
54
mov ecx,1023
 
55
@@wastememory2x2ok:
 
56
sub ecx,edi
 
57
shl eax,12
 
58
inc ecx
 
59
add eax,somevar
 
60
cld
 
61
lea edi,[eax+4*edi]
 
62
mov eax,color
 
63
rep stosd
 
64
@@endwastememory2:
 
65
end ['eax','ecx','edi'];
 
66
 
 
67
 
 
68
function str(w:word):string;
 
69
var tmp:string;
 
70
begin
 
71
system.str(w,tmp);
 
72
str:=tmp;
 
73
end;
 
74
 
 
75
function str(l:longint):string;
 
76
var tmp:string;
 
77
begin
 
78
system.str(l,tmp);
 
79
str:=tmp;
 
80
end;
 
81
 
 
82
 
 
83
procedure testcompiler(x0,y0,r,color:longint);
 
84
var x,y:longint;
 
85
begin
 
86
for x:=0 to trunc(r*(sqrt(2)/2))+1 do
 
87
 begin
 
88
 y:=round(sqrt(r*r-x*x));
 
89
 wastememory(x0+x,y0+y,color);
 
90
 wastememory(x0-x,y0+y,color);
 
91
 wastememory(x0+x,y0-y,color);
 
92
 wastememory(x0-x,y0-y,color);
 
93
 wastememory(x0+y,y0+x,color);
 
94
 wastememory(x0-y,y0+x,color);
 
95
 wastememory(x0+y,y0-x,color);
 
96
 wastememory(x0-y,y0-x,color);
 
97
 end;
 
98
end;
 
99
 
 
100
 
 
101
procedure testcompiler2(x0,y0,r,color:longint);
 
102
var x,y:longint;
 
103
begin
 
104
for x:=0 to trunc(r*(sqrt(2)/2))+1 do
 
105
 begin
 
106
 y:=round(sqrt(r*r-x*x));
 
107
 wastememory2(y0+y,x0-x,x0+x,color);
 
108
 wastememory2(y0-y,x0-x,x0+x,color);
 
109
 wastememory2(y0+x,x0-y,x0+y,color);
 
110
 wastememory2(y0-x,x0-y,x0+y,color);
 
111
 end;
 
112
end;
 
113
 
 
114
 
 
115
begin
 
116
 
 
117
end.