Skip to content

Instantly share code, notes, and snippets.

@tomaes
Created April 14, 2020 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaes/d75852970a231054b87cb1d474de3614 to your computer and use it in GitHub Desktop.
Save tomaes/d75852970a231054b87cb1d474de3614 to your computer and use it in GitHub Desktop.
Testing the limits of recursion in Turbo Pascal 7.0 (1992)
(*
TP 7.0 recursion limit test: 3965 - stack:16384 (def)
16249 - stack:65520 (max)
*)
program rec_test;
{$M 65520, 0, 655360} (* stack, heapmin, heapmax *)
uses crt;
const R = 16249;
var i: integer;
procedure jump;
begin
inc(i);
{$IFDEF output}
writeln('Rec Nr.: ',i);
{$ENDIF}
if i < R then jump;
end;
begin
jump;
writeln(i, ' recursions done. Press Key.');
repeat until keypressed;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment