Code:
Program tstacksize;
Uses windows,sysutils;
{$AppType CONSOLE}
Var stk:record
org:integer;
shx,shp,sht:integer;
stb,stb1,stl,sto,stor,sts,shs:integer;
end;
Function getvar_tstacksize:integer;
asm
mov eax, fs:[4]
sub eax, esp
end;
Var ecobo:string='4 M Sf. Cuv. Ioanichie cel Mare; Sf. Mc. Nicandru Ep. si Ermeu pr. (Post) ';
domenicomaria:shortstring='+ Sf. M. Mc. Varvara; Sf. Cuv. Ioan Damaschin (Dezlegare la ulei si vin)';
kauff:integer;
rr:string;
Procedure shx(a:shortstring);
Begin stk.shx:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure shp(const a:shortstring);
Begin stk.shp:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure sht(Var a:shortstring);
Begin stk.sht:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure stb(const a:string);
Begin
stk.stb:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure stb1(const a:string);
Var f:string;
Begin
f:=lowercase(a);
stk.stb1:=stk.org-getvar_tstacksize;
kauff:=length(f);rr:=concat(rr,a,#13#10);
End;
Procedure stl(a:string);
Begin
stk.stl:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure sto(Var a:string);
Begin
stk.sto:=stk.org-getvar_tstacksize;
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure stor(a:string);
Begin
stk.stor:=stk.org-getvar_tstacksize;
a:=lowercase(a);
kauff:=length(a);rr:=concat(rr,a,#13#10);
End;
Procedure sts(a:pchar;len:integer);
Begin
stk.sto:=stk.org-getvar_tstacksize;
End;
Begin
rr:='';
Writeln('Compare StackOlverFlow for types');
stk.org:=getvar_tstacksize();shx(domenicomaria);
stk.org:=getvar_tstacksize();shp(domenicomaria);
stk.org:=getvar_tstacksize();sht(domenicomaria);
stk.org:=getvar_tstacksize();stb(ecobo);
stk.org:=getvar_tstacksize();stl(ecobo);
stk.org:=getvar_tstacksize();sto(ecobo);
stk.org:=getvar_tstacksize();stor('12345678901234567890');
stk.org:=getvar_tstacksize();sts(pchar(ecobo),length(ecobo));
writeln('Shx=',abs(stk.shx));windows.beep(kauff,30);
writeln('Shp=',abs(stk.shp));windows.beep(kauff,30);
writeln('Sht=',abs(stk.sht));windows.beep(kauff,30);
writeln('STb=',abs(stk.stb));windows.beep(kauff,30);
writeln('STb1=',abs(stk.stb1));windows.beep(kauff,30);
writeln('STL=',abs(stk.stl));windows.beep(kauff,30);
writeln('STO=',abs(stk.stO));windows.beep(kauff,30);
writeln('STOR=',abs(stk.stor));windows.beep(kauff,30);
writeln('STS=',abs(stk.sts));windows.beep(kauff,30);
Writeln('*BORDERX2,____ ____ . ____ ____ . ____ ____ . ____ ____ . ');
writeln('The Big"Number"s are wrongs. The lower-numbers are good');
readln;
writeln(rr);
End. |