Quote:
Originally Posted by Kengurius
maybe, wanna i will make laugh u ? it writen in pascal ROFL
|
mmm, funny

i dont realy know what reason in your program, but nice - i give another one in your collection
Code:
program dem_size;
uses crt;
var
P:pointer;
I:word;
procedure Prog_size;
var
SystemTotalSize:word;
PrefixSize:word;
CodeSize:word;
DataSize:word;
HeapSize:word;
AllocHeapSize:word;
Factor:real;
S:string[80];
L:byte absolute S;
L1:byte;
function Lin_adr (P:pointer):longint;
begin
Lin_adr:=longint(Seg(p^))*16+Ofs(P^)
end;
begin
SystemTotalSize:=640*1024 div 16;
PrefixSize:=256 div 16;
CodeSize:=Dseg - PrefixSeg - PrefixSize;
DataSize:=Seg(HeapOrg^)-SSeg;
HeapSize:=MemW[PrefixSeg:2] - Seg(HeapOrg^);
AllocHeapSize:=(Lin_adr(HeapPtr)-Lin_adr(HeapOrg)+1) div 16;
Factor:=67/SystemTotalSize;
L:=Round(Factor*PrefixSize);
FillChar(S[1],L,#176);
Writeln('PSP ',PrefixSize:5,' ',S);
L:=Round(Factor*CodeSize);
FillChar(S[1],L,#176);
Writeln('Code ',CodeSize:5,' ',S);
L:=Round(Factor*DataSize);
FillChar(S[1],L,#176);
Writeln('Data ',DataSize:5,' ',S);
L:=Round(Factor*HeapSize);
L1:=Round(Factor*AllocHeapSize);
FillChar(S[1],L1,#176);
FillChar(S[L1+1],L-L1,#219);
Writeln('Heap ',HeapSize:5,' ',S);
end;
begin
Randomize;
for I:=1 to 100 do
GetMem(P,Random(1000));
Rrog_size;
end.
GL