#A›_ORIGIN EQU $4000›#››PROGRAM FRACTAL(INPUT,OUTPUT);››CONST›  sm = 7680;››TYPE›  Parameter = RECORD›   xmin,xmax,ymin,ymax:REAL;›   tmax               :INTEGER›  END;›  String = ARRAY[1..15] OF CHAR;›  Screen = ARRAY[1..sm] OF CHAR;››VAR›  werte                    :Parameter;›  xm,ym,cm,s,gramod,scradr :INTEGER;›  grahold                  :Screen;›  graphic                  :^Screen;››procedure Use_Graphics;›begin›#A› lda #<_origin› sta $6a›#›end;››procedure Use_Text;›begin›#A› lda #$c0› sta $6a›#›end;››PROCEDURE Poke(loc,val:Integer);››BEGIN›#A› LDY #$07› LDA (_SP),Y› STA _T› INY› LDA (_SP),Y› STA _T+1› LDY #$00› STA (_T),Y›#›END;››FUNCTION Peek(loc:Integer):Integer;››BEGIN›  Peek:=0;›#A› LDY #$07› LDA (_SP),Y› STA _T› INY› LDA (_SP),Y› STA _T+1› LDY #$00› LDA (_T),Y› LDY #$05› STA (_SP),Y› INY› LDA #$00› STA (_SP),Y›#›END;››#I GRAPHICS.I›#I POSITION.I›#I PLOT.I››PROCEDURE Gr(modus:INTEGER);› BEGIN›  CASE modus OF›  3: BEGIN ›      xm:= 39; ym:= 23; cm:= 3; s:=434›     END; ›  5: BEGIN›      xm:= 79; ym:= 47; cm:= 3; s:=1176›     END;›  7: BEGIN›      xm:=159; ym:= 95; cm:= 3; s:=4200›     END;›  9: BEGIN›      xm:= 79; ym:=191; cm:=15; s:=7680›     END;› 11: BEGIN›      xm:= 79; ym:=191; cm:=15; s:=7680›     END;› 15: BEGIN›      xm:=159; ym:=191; cm:= 3; s:=7680›     END;› END;› Graphics(modus+16)›END;››PROCEDURE Berechne(› hilfswerte          :Parameter);› VAR›  x,y,ti             :INTEGER;›  dx,dy,cx,cy        :REAL;›› FUNCTION FARBE(x,y  :REAL;›                t    :INTEGER):INTEGER;›  VAR›   xb,yb,x2,y2       :REAL;›   c                 :INTEGER;››  BEGIN›   c:=0; xb:=0.0; yb:=0.0;›         x2:=0.0; y2:=0.0;› ›   WHILE (c<t) AND ((x2+y2)<8) DO›    BEGIN›     yb:=2*xb*yb-y; xb:=x2-y2-x;›     x2:=SQR(xb);   y2:=SQR(yb);›     c:=c+1›    END; (* WHILE *)›   FARBE:=c›  END;               (* FARBE *)›› BEGIN›  WITH hilfswerte DO BEGIN›   dx:=(xmax-xmin)/xm; cx:=xmin;›   dy:=(ymax-ymin)/ym; cy:=ymax;›   FOR y:=0 TO ym DO BEGIN›    FOR x:=0 TO xm DO BEGIN›     ti:=FARBE(cx,cy,tmax);›     IF ti=tmax THEN›      Plot(x,y,0)›     ELSE›      Plot(x,y,(ti MOD cm)+1);›     cx:=cx+dx›    END;              (* X       *)›    cx:=xmin; cy:=cy-dy›   END                (* Y        *)›  END (* WITH *)› END;                (* Berechne   *)››PROCEDURE Warte_auf_taste;›› BEGIN››#A›   LDA #$FF›   STA $2FC›WL CMP $2FC›   BEQ WL›   STA $2FC›#› END;›PROCEDURE INFO;›› BEGIN›  Graphics(0); Poke(752,1);›  WRITELN; WRITELN;›  WRITELN('PROGRAMM INFO':26);›  WRITELN('-------------':26);›  WRITELN; WRITELN; WRITELN;›  WRITELN('Das Programm wurde in':30);›  WRITELN('KYAN-PASCAL V2.01 als':30);›  WRITELN('Programmbeispiel ge- ':30);›  WRITELN('schrieben .          ':30);›  WRITELN; WRITELN;›  WRITELN('(c) COMPY CHOP':23);›  Warte_auf_taste› END;››PROCEDURE Hole(› VAR werte              :Parameter;› VAR gramod             :INTEGER);› BEGIN›  Graphics(0);›  Position(9,3);›  WRITELN('PARAMETER EINGEBEN');›  Position(9,4);›  WRITELN('------------------');›  WITH werte DO BEGIN›   Position(3,7);›   WRITE('Linker  Rand =');›   READLN(xmin);›   Position(3,9);›   WRITE('Rechter Rand =');›   READLN(xmax);›   Position(3,11);›   WRITE('Unterer Rand =');›   READLN(ymax);›   Position(3,13);›   WRITE('Oberer  Rand ='); ›   READLN(ymin);›   Position(3,15);›   WRITE('Tiefe        ='); ›   READLN(tmax);›   Position(3,17);›   WRITE('Graphicmodus ='); ›   READLN(gramod)›  END› END; ››PROCEDURE Zeige(› hilfswerte:Parameter;› modus     :INTEGER   );› BEGIN›  Graphics(0); Poke(752,1);›  Position(9,3);›  WRITELN('PARAMETER ANZEIGEN');›  Position(9,4);›  WRITELN('------------------');›  WITH hilfswerte DO BEGIN›   Position(3,7);›   WRITELN('Linker  Rand =',xmin:6:4);›   Position(3,9);›   WRITELN('Rechter Rand =',xmax:6:4);›   Position(3,11);›   WRITELN('Oberer  Rand =',ymax:6:4);›   Position(3,13);›   WRITELN('Unterer Rand =',ymin:6:4);›   Position(3,15);›   WRITELN('Tiefe        =',tmax:6);›  END; (* WITH *)›  Position(3,17);›  WRITELN('Graphicmodus =',modus:6);›  Warte_auf_taste› END;››FUNCTION Auswahlmenu:INTEGER;›› VAR taste:INTEGER;›› BEGIN›  Graphics(0);›  Position(9,1);›  WRITELN('HAUPTMENU');›  Position(9,2);›  WRITELN('---------');›  Position(3,5);›  WRITELN('[0]   Programm INFO'); ›  Position(3,7);›  WRITELN('[1]   Parametereingabe');›  Position(3,9);›  WRITELN('[2]   Bild ansehen');›  Position(3,11);›  WRITELN('[3]   Bild speichern');›  Position(3,13);›  WRITELN('[4]   Bild laden');›  Position(3,15);›  WRITELN('[5]   Directory');›  Position(3,17);›  WRITELN('[6]   Parameter anzeigen');›  Position(3,19);›  WRITELN('[7]   Fractal berechnen');›  REPEAT›   Position(3,21);›   WRITE('NUMMER>':10); READLN(taste);›  UNTIL taste IN [0,1,2,3,4,5,6,7];›  Auswahlmenu:=taste› END;››BEGIN (* MAIN PROGRAM *)› USE_GRAPHICS; Graphics(31);› scradr:=Peek(88)+Peek(89)*256;› graphic:=POINTER(scradr);› WITH werte do begin›  xmin:=-0.7; xmax:=2.3;›  ymin:=-1.0; ymax:=1.0; tmax:=50› END; (* WITH *)› GRAMOD:=15; GRAPHICS(0);› REPEAT›  CASE Auswahlmenu OF›   0: Info;›   1: Hole(werte,gramod); ›   2: BEGIN›       Gr(gramod);›       graphic^:=grahold;›       Warte_auf_taste›      END;›   3: (* BILD SPEICHERN   *);›   4: (* BILD LADEN       *);›   5: (* DIRECTORITY      *);›   6: Zeige(werte,gramod);›   7: BEGIN›       Gr(gramod);›       Berechne(werte);›       grahold:=graphic^;›       Warte_auf_taste›      END;›  END; (* CASE *)› UNTIL 1=2›END.  (* END MAIN     *) 