home *** CD-ROM | disk | FTP | other *** search
- program s5;
-
- (*$M 4096,0,65535 *)
-
- uses
- crt,dos,extend;
-
- const
- copyright = '|Peter Sieg 24-Dez-1990 Version 1.0; Alle Rechte vorbehalten|';
-
-
- (*$I s5.var *)
- (*$I s5.inc *)
- (*$I s5.sim *)
- (*$I s5.lst *)
-
-
- procedure einlesen;
-
- begin
- anzaw := 0;
- klammern := 0;
- status := 0;
- lastaw := '';
- while ((status >= 0) and not eof(infile)) do
- begin
- readln (infile,aw);
- repeat
- gotoxy ( 1, 4);
- clreol;
- anzaw := succ(anzaw);
- write (' [',anzaw:4,'] ',aw);
- syntax_check(aw);
- if (lastaw = aw) and not (aw = ')') then
- status := -1;
- if (pos('(',lastaw) > 0) and (aw = ')') then
- status := -1;
- if (klammern > deep) then
- status := -2;
- if (status = 0) and sende then
- if (klammern <> 0) then
- status := -2;
- if (status = 0) then
- lastaw := aw;
- if (status < 0) then
- fehlerbehandlung;
- until (status <> 2);
- end;
- if (status <> 1) then
- begin
- if (status = 0) then
- write (' Unerwartetes Ende der Datei...')
- else
- write (' Funktion abgebrochen...');
- getkey;
- end;
- end;
-
-
- procedure get_awl;
-
- begin
- status := 0;
- korrektur := false;
- mask := '*.AWL';
- askmask := true;
- filename := dirwin;
- if filename <> '<ESC>' then
- begin
- fenster(8,6,60,10);
- writeln(' Einlesen von ',filename,'...');
- assign (infile,filename);
- reset (infile);
- einlesen;
- textattr := normalattr;
- window(1,1,80,25);
- close (infile);
- if (status = 1) then
- begin
- if korrektur then
- begin
- rewrite(infile);
- for i := 1 to anzaw do
- begin
- with awl[i] do
- begin
- write (infile,operation);
- write (infile,operand);
- if (baustein = -1) then
- writeln(infile)
- else
- begin
- write (infile,baustein);
- if (bitnr = -1) then
- writeln(infile)
- else
- writeln(infile,'.',bitnr);
- end;
- end;
- end;
- close (infile);
- end;
- message(mess[1]);
- end
- else
- message(mess[8]);
- end
- else
- message(mess[7]);
- end;
-
-
- begin
- clrscr;
- init_screen(4);
- mono := exist('MONO');
- normalattr := $30;
- if (computer = $FC) then
- delay := delay * 4;
- status := -1;
-
- if exist('logo.scr') then
- begin
- cursor_aus;
- ja := load_screen(2,'logo.scr');
- if mono then
- screen_attr(2,1,80,1,25,$0F);
- restore_screen(2);
- wait(2);
- cursor_ein;
- end;
- ja := load_screen(2,'s5.scr');
- if not ja then halt;
- ja := load_screen(3,'s5sim.scr');
- if not ja then halt;
-
- if mono then
- begin
- screen_attr(2,1,80,1,25,$0F);
- screen_attr(3,1,80,1,25,$0F);
- normalattr := $0F;
- end;
-
- repeat
- cursor_aus;
- restore_screen(2);
- getkey;
- case upcase(key) of
- 'E' : get_awl;
- 'S' : begin
- if (status <> 1) then
- get_awl;
- if (status = 1) then
- simulation;
- end;
- 'G' : begin
- if (status <> 1) then
- get_awl;
- if (status = 1) then
- if ((diskfree(0) div 1024) > 20) then
- dokumentation
- else
- message(mess[10]);
- end;
- 'L' : begin
- filename := dirwin;
- if (filename <> '<ESC>') then
- begin
- exec('list.exe',filename);
- case doserror of
- 2,3 : message(mess[6]);
- 8 : message(mess[9]);
- 0 : message(mess[4]);
- else
- message(mess[11]);
- end;
- end
- else
- message(mess[7]);
- end;
- 'T' : begin
- filename := dirwin;
- if (filename <> '<ESC>') then
- begin
- exec('edit.exe',filename);
- case doserror of
- 2,3 : message(mess[6]);
- 8 : message(mess[9]);
- 0 : message(mess[5]);
- else
- message(mess[11]);
- end;
- end
- else
- message(mess[7]);
- end;
- end;
- until (upcase(key) = 'V');
- normvideo;
- clrscr;
- cursor_ein;
- end.