program Tutorial1;
@use "system/z80cpm"
@use "system/system"

var
	msg: string = ("TRSE compiles code for TIM-011 !!!");
	i, ch: integer;


@addemulatorparam "-nothrottle"

begin
	// Startup code for CP/M programs
	Z80CPM::Startup();
	
	// print newline
	Z80CPM::PutCharLF(ASCII::CR);

	for i:= 0 to 10 do begin
		// print message
		Z80CPM::PutString(#msg);
		// print space
		Z80CPM::PutChar(ASCII::SPACE);
	end;

	Z80CPM::PutString("\n\rPress any key...");
	
	// wait for keypress and read key
	ch := Z80CPM::GetCharEcho();

	// print pressed key	
	Z80CPM::PutString("\n\rYou pressed: ");
	Z80CPM::PutChar(ch);

	Z80CPM::PutCharLF(ASCII::CR);

	// Exit code for CP/M programs
	Z80CPM::Exit();
end.
