// Effectus auto-generated Mad Pascal source code listing
program callosPrg;

uses
  Crt, StringUtils, SySutils, CIO;

var
  strBuffer : string;
var
  eff_loop_var : byte;
  eff_cnt : byte;
  eff_string : string;
// Effectus example:
// Calling OS routines by using PROC
// memory assignment

procedure TEXTProc;
begin
  eff_string := '';
  Write('Press two keys to scroll up!');  // Print 1
  Writeln;
end;

// Scroll screen
procedure SCROLLProc;
begin
  asm
    jsr $F7F7
    rts
  end;
end;
// Keyclick sound
procedure CLICKProc;
begin
  asm
    jsr $F983
    rts
  end;
end;
// Read key
procedure KBGETProc;
begin
  asm
    jsr $F302
    rts
  end;
end;
// Cassette-beep sound
procedure BEEPWAITProc(times : byte);
begin
  asm
    jsr $FDFC
    rts
  end;
end;
procedure MAINProc;
var
  N : byte;  // N_byte_array
  key : byte;  // key_byte_array
begin
  Write(Chr(125));
  GotoXY(2 + 1,  18 + 1);
  TEXTProc;
  BEEPWAITProc(1);
  KBGETProc;
 FOR N:=1 TO 20 do begin
  CLICKProc;
  SCROLLProc;
  end;
  key := Get(7);
  ReadKey;
end;

begin
  MAINProc;
end.
