Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
pSIMPLETRON 1.2 - LMS.pas

LMS.pas

Caricato da: NOVA99
Scarica il programma completo

  1. (*
  2. *       pSIMPLETRON 1.2
  3. *
  4. *   COMPLETATO IL 14/09/2014
  5. *
  6. *          BY NOVA99
  7. *)
  8.  
  9. unit LMS;
  10.  
  11. interface
  12.  
  13. uses crt;
  14.  
  15. var (*MEMORIE DI SISTEMA*)
  16.       InstructionReg:Array[0..100] of integer; //MEMORIA DEL PROGRAMMA
  17.       InstructionMem:Array[0..100] of integer; //CRONOLOGIA DELLE ISTRUZIONI ESEGUITE
  18.       Memory:Array[0..100] of real; //MEMORIA VARIABILI
  19.  
  20.  
  21.     (*REGISTRI*)
  22.       numI:byte; //CONTATORE ISTRUZIONI
  23.       operationCode:integer; //IDENTIFICATORE DELL'OPERAZIONE DA ESEGUIRE
  24.       operand:integer; //IDENTIFICATORE DELLA POSZIONE DELLA VARIABILE IN USO
  25.       accumulator:real; //ACCUMULATORE ARITMETICO
  26.       aux_accumulator:real; //ACCUMULATORE ARITMETICO AUSILIARIO (USATO PER ISTRUZIONI 47, 48 E 49)
  27.       exit_correct:string[12]='SUCCESSFUL'; //REGISTRO DEL TIPO DI USCITA
  28.    
  29.       cont:byte=00; //VARIABILE DI SERVIZIO
  30.  
  31. const (*OPERAZIONI DI I/O*)
  32.       CIN        = 10; //INPUT
  33.       COUT       = 11; //OUTPUT
  34.      
  35.       (*OPERAZIONI DI GESTIONE DELLA MEMORIA (x = Memory[ x ]) *)
  36.       LOAD       = 20; //CARICA NELL'ACCUMULATORE
  37.       STORE      = 21; //SALVA IN x
  38.       DELETE     = 22; //RESETTA x
  39.       RESET      = 23; //RESETTA LA MEMORIA
  40.       RESETINSTR = 24; //RESETTA LA CRONOLOGIA DELLE ISTRUZIONI
  41.       LOADAUX    = 25; //CARICA x NELL'ACCUMULATORE AUSILIARIO
  42.       RANDR      = 26; //SALVA IN x UN NUMERO REALE CASUALE TR 0 E 1
  43.       RANDINT    = 27; //  "    " "  "   "    INTERO CASUALE TRA 0 E [ACCUMULATORE]
  44.      
  45.       (*OPERAZIONI MATEMATICHE FONDAMENTALI (x = Memory[ x ]) *)
  46.       ADD        = 30; //AGGIUNGE x ALL'ACCUMULATORE
  47.       SUBTR      = 31; //SOTTRAE  x  "      "
  48.       DIVIS      = 32; //DIVIDE   L'ACCUMULATORE PER x
  49.       MULT       = 33; //MOLTIPLICA   L'ACCUMULATORE PER x
  50.       QUOZ       = 34; //QUOTA    L'ACCUMULATORE PER x
  51.       RES        = 35; //CALCOLA IL RESTO DELL'OP. PRECEDENTE
  52.       ROOF       = 36; //ARROTONDA x ALL'INTERO MINORE PIU' VICINO
  53.       CEIL       = 37; //    "     "  "    "  MAGGIORE PIU' VICINO
  54.       FROUND     = 38; //ARROTONDA x
  55.       FABS       = 39; //CALCOLA IL VALORE ASSOLUTO DI x
  56.          
  57.       (*OPERAZIONI DI CONTROLLO (x = Memory[ x ], y = InstructionReg[ y ]) *)
  58.       BRANCH     = 40; //SALTA A y
  59.       BRANCHNEG  = 41; //  "    "      "      " SE L'ACCUMULATORE E' NEGATIVO
  60.       BRANCHZERO = 42; //  "    "      "      "  "        "       "  ZERO
  61.       BRANCHPOS  = 43; //  "    "      "      "  "        "       "  POSITIVO
  62.       HALT       = 44; //INTERROMPE L'ESECUZIONE
  63.       PAUSE      = 45; //METTE IN PAUSA L'ESECUZIONE E CHIEDE UN INPUT PER CONTINUARE
  64.       RETARD     = 46; //RITARDA L'ESECUZIONE PER x SECONDI
  65.       BRANCHMORE = 47; //SALTA A y SE ACCUMULATORE > ACCUMULATORE_AUSLIARIO
  66.       BRANCHEQL  = 48; //  "   " "  "     "        =            "  
  67.       BRANCHLESS = 49; //  "   " "  "     "        <            "
  68.      
  69.       (*OPERAZIONI MATEMATICHE AVANZATE (x = Memory[ x ]) *)
  70.       FSQRT      = 50; //CALCOLA LA RADICE DI x
  71.       FSQR       = 51; //   "    IL QUADRATO DI x
  72.       FEXP       = 52; //   "    L'ESPONENZIALE DI x
  73.       FLOG       = 53; //   "    IL LOGARITMO DECIMALE DI x
  74.       FLN        = 54; //   "     "    "      NATURALE "  "
  75.       POW        = 55; //   "    ACCUMULATORE ^ x
  76.       ROOT       = 56; //   "    x-esima RADICE DELL'ACCUMULATORE
  77.       FSIN       = 57; //   "    IL SENO DI x
  78.       FCOS       = 58; //   "     " COSENO DI x  
  79.       FTAN       = 59; //   "    LA TANGENTE DI x
  80.      
  81.       (*OPERAZIONE AUSILIARIA*)
  82.       STOPLOAD   = 9999; //INTERROMPE L'INSERIMENTO DEL PROGRAMMA
  83.      
  84.       CodeMem : SET OF byte = [CIN, COUT, LOAD..RANDINT, ADD..FABS, BRANCH..BRANCHLESS, FSQRT..FTAN, 99]; //MEMORIA DELLE FUNZIONI UTILIZZABILI
  85.      
  86. procedure Caption; //VISUALIZZA A VIDEO L'INTESTAZIONE
  87. procedure GetInstr; //ACQUISISCE LE ISTRUZIONI
  88. function InstrOK:boolean; //CONTROLLA IL CODICE INSERITO
  89. procedure ExeInstr; //ESEGUE IL PROGRAMMA
  90. procedure ViewDump; //VISUALIZZA IL DUMP DI MEMORIA
  91.  
  92. implementation
  93.  
  94. procedure Caption;
  95. begin
  96.  
  97.      clrscr;
  98.      
  99.      writeln('*** WELCOME TO SIMPLETRON! ***');
  100.      writeln('*** PLEASE ENTER YOUR PROGRAM ONE INSTRUCTION ***');
  101.      writeln('*** (OR DATA WORD) AT A TIME. I WILL TYPE THE ***');
  102.      writeln('*** LOCATION NUMBER AND A QUESTION MARK (?).  ***');
  103.      writeln('*** YOU THEN TYPE THE WORD FOR THAT LOCATION. ***');
  104.      writeln('*** TYPE THE SENTINEL 9999 TO STOP ENTERING   ***');
  105.      writeln('*** YOUR PROGRAM ***');
  106.      writeln;writeln;
  107.  
  108. end;
  109.  
  110. procedure GetInstr;
  111. begin
  112.  
  113.      numI:=0;
  114.      
  115.      repeat
  116.      begin
  117.  
  118.        write(numI, ' ? ');
  119.        readln( InstructionReg[ numI ] );
  120.        numI += 1;
  121.  
  122.      end;
  123.      until InstructionReg[ numI-1 ] = STOPLOAD;
  124.  
  125.      writeln;writeln;
  126.      write('*** PROGRAM LOADING COMPLETE ***');
  127.      writeln;writeln;
  128.      write('*** START PROGRAM CONTROL... ***');
  129.      writeln;writeln;
  130.  
  131. end;
  132.  
  133. function InstrOK:boolean;
  134.  
  135. var err_num:byte = 0;
  136.     warn_num:byte = 0;
  137.     halt_flag:boolean=false;
  138.  
  139. begin
  140.  
  141.      numI:=00;
  142.      
  143.      if (InstructionReg[ 0 ] = 9999) then //SE L'UNICA ISTRUZIONE PRESENTE E' STOPLOAD IL PROGRAMMA NON PUO' (OVVIAMENTE) ESSERE ESEGUITO
  144.      begin
  145.      
  146.                writeln;
  147.                writeln('*** ERROR FOUND IN LINE N°0: ***');
  148.                writeln('*** NO INSTRUCTION BEFORE STOPLOAD (9999)  ***');
  149.                writeln;
  150.            
  151.                err_num:=1;
  152.      end
  153.      else
  154.      begin
  155.          repeat
  156.                
  157.                //CONTROLLA SE L'ISTRUZIONE NON E' COMPRESA TRA STOPLOAD (9999) E SE NON E' TRA LA TANGENTE DELLA VARIABILE 99 (5999) E L'INPUT ALLA VARIABILE 0 (1000)
  158.                 if  NOT( InstructionReg[ numI ] = STOPLOAD) AND NOT( (InstructionReg[ numI ] < 6000) AND (InstructionReg[ numI ] > 999) ) then
  159.                 begin
  160.  
  161.                     err_num+=1;
  162.                
  163.                     writeln;
  164.                     writeln('*** ERROR FOUND IN LINE N°', numI, ': ***');
  165.                     writeln('*** INSTRUCTION ''', InstructionReg[ numI ], ''' IS OUT OF THE ALLOWED RANGE  ***');
  166.                     writeln;
  167.  
  168.                 end;
  169.            
  170.                 operationCode:=InstructionReg[ numI ] div 100;
  171.                 operand:=InstructionReg[ numI ] mod 100;    
  172.        
  173.                 //CONTROLLA CHE IL CODICE DELL'OPERAZIONE ESISTA IN MEMORIA
  174.                 if NOT(  operationCode in CodeMem ) then
  175.                 begin
  176.  
  177.                     err_num+=1;
  178.  
  179.                     writeln;
  180.                     writeln('*** ERROR FOUND IN LINE N°', numI:2, ':  ***');
  181.                     writeln('*** INSTRUCTION CODE ''', operationCode, ''' NOT FOUND ***');
  182.                     writeln;
  183.  
  184.                 end
  185.                 else
  186.                 begin
  187.          
  188.                      if ( operand > 1) AND ( operationCode = PAUSE) then //LA FUNZIONE PAUSE ACCETTA COME ARGOMENTI  0 O 1
  189.                      begin
  190.        
  191.                           err_num+=1;
  192.  
  193.                           writeln;
  194.                           writeln('*** ERROR FOUND IN LINE N°', numI:2, ':  ***');
  195.                           writeln('*** INVALID ARGUMENT (''', operand ,''') FOR PAUSE FUNCTION ***');
  196.                           writeln;
  197.        
  198.                      end;
  199.                      
  200.                      //LE FUNZIONI RESET, RESETINSTR E HALT NON RICHIEDONO ARGOMENTI. SE QUESTI VENGONO INSERITI SONO IGNORATI
  201.                      if ((operationCode = RESET) OR (operationCode = RESETINSTR) OR (operationCode = HALT)) AND (operand > 0) then
  202.                      begin
  203.            
  204.                           writeln;
  205.                           writeln('*** WARNING IN LINE N°', numI:2, ':  ***');
  206.                           writeln('*** THIS FUNCTION DOESN''T USE AN ARGUMENT. ***');
  207.                           writeln('*** YOUR ARGUMENT (''', operand ,''') WILL BE IGNORED  ***');
  208.                           writeln;
  209.                        
  210.                           warn_num+=1;  
  211.        
  212.                      end;
  213.  
  214.            
  215.                 end;                
  216.                
  217.                 numI+=1;
  218.        
  219.                 if operationCode=HALT then halt_flag:=true; //CONTROLLA CHE VI SIA UNA ISTRUZIONE HALT
  220.  
  221.           until InstructionReg[ numI-1 ] = STOPLOAD;
  222.      
  223.       end;
  224.      
  225.      
  226.       if err_num>0 then
  227.       begin
  228.  
  229.            writeln;
  230.            writeln('*** ', err_num, ' ERROR(S) FOUND ***');
  231.            if warn_num>0 then writeln('*** ', warn_num:2, ' WARNING(S) GENERATED ***');
  232.            writeln('*** PROGRAM CAN''T BE EXECUTED ***');
  233.            writeln;
  234.  
  235.            InstrOK:=false;
  236.  
  237.       end
  238.       else
  239.       begin
  240.  
  241.            //SE NON VI SONO HALT IL PROGRAMMA POTREBBE COMPORTARSI IN MODO IMPREVEDIBILE
  242.            if halt_flag=false then
  243.            begin
  244.        
  245.                 writeln;
  246.                 writeln('*** WARNING: NO HALT FUNCTIONS FOUND ***');
  247.                 writeln('*** EXECUTION WON''T STOP TILL A STOPLOAD  ***');
  248.                 writeln('*** PROGRAM''S BEAHVIOR COULD BE UNDEFINED ***');
  249.                 writeln;
  250.        
  251.                 warn_num+=1;
  252.        
  253.            end;
  254.                  
  255.            writeln;
  256.            writeln('*** NO ERRORS FOUND ***');
  257.            if warn_num>0 then writeln('*** ', warn_num:2, ' WARNING(S) GENERATED ***');
  258.            writeln('*** PROGRAM CAN BE EXECUTED ***');
  259.            writeln;
  260.  
  261.            InstrOK:=true;
  262.  
  263.       end;
  264.  
  265. end;
  266.  
  267. procedure ExeInstr;
  268.  
  269. var cont2, cont3:byte;
  270.     instruction:integer;
  271.     delay_factor:integer;
  272.     rand_max:integer;
  273.  
  274. begin
  275.  
  276.      cont3:=00;
  277.      numI:=0;
  278.      
  279.      randomize;
  280.        
  281.      repeat
  282.      begin
  283.  
  284.             instruction:=InstructionReg[ numI ];
  285.  
  286.             operationCode:=instruction div 100;
  287.             operand      :=instruction mod 100;
  288.            
  289.             //SE LA FUNZIONE ATTUALE PRODUCE UN OUTPUT A VIDEO, SI SCRIVE L'INIZIO DI UNA NUOVA RIGA A VIDEO
  290.             if ( operationCode = CIN ) OR ( operationCode = COUT ) then
  291.             begin
  292.        
  293.                 write(cont, ' > ');
  294.        
  295.             end;
  296.            
  297.             case operationCode of
  298.  
  299.                 CIN:  readln(Memory[ operand ]);
  300.                 COUT: writeln(Memory[ operand ]:6:4);
  301.  
  302.                 LOAD:       accumulator:=Memory[ operand ];
  303.                 STORE:      Memory[ operand ]:=accumulator;
  304.                 DELETE:     Memory[ operand ]:=0;
  305.                 RESET:      for cont2:=0 to 100 do Memory[ cont2 ]:=0;
  306.                 RESETINSTR: begin
  307.                                 for cont2:=0 to 100 do InstructionMem[ cont2 ]:=0;
  308.                                 cont3:=0;
  309.                             end;
  310.                 LOADAUX:    aux_accumulator:=Memory[ operand ];
  311.                 RANDR:      Memory[ operand ]:=random;
  312.                 RANDINT:    begin
  313.                                 rand_max:=trunc(accumulator);
  314.                                 Memory[ operand ]:=random( rand_max +1);
  315.                             end;
  316.  
  317.                 ADD:    accumulator+=Memory[ operand ];
  318.                 SUBTR:  accumulator-=Memory[ operand ];
  319.                 DIVIS:  begin
  320.  
  321.                              //SE SI STA TENTANDO DI DIVIDERE 0/0 O <NUMERO NATURALE>/0 SI PRODUCE UN ERRORE
  322.                              if ( ( Memory[ operand ]= 0)AND(accumulator = 0) ) OR ( ( Memory[ operand ]= 0)AND(accumulator <> 0) ) then
  323.                              begin
  324.                                
  325.                                  writeln;
  326.                                
  327.                                  if ( Memory[ operand ]= 0)AND(accumulator = 0) then
  328.                                  begin
  329.                                          writeln('*** ATTEMPT TO DIVIDE 0 BY 0. UNDEFINED RESULT ***');
  330.                                          writeln('*** SIMPLETRON EXECUTON ABNORMALLY TERMINATED ***');
  331.                                  end
  332.                                  else
  333.                                  begin
  334.                                         if ( Memory[ operand ]= 0)AND(accumulator <> 0) then writeln('*** ATTEMPT TO DIVIDE BY 0. IMPOSSIBLE OPERATION ***');
  335.                                         writeln('*** SIMPLETRON EXECUTION ABNORMALLY TERMINATED   ***');
  336.                                  end;
  337.                                
  338.                                  exit_correct:='FAILURE';
  339.                                  break;
  340.                
  341.                              end
  342.                              else accumulator /= Memory[ operand ];
  343.                
  344.                         end;
  345.                 MULT:   accumulator *= Memory[ operand ];
  346.                 QUOZ:   accumulator := trunc(accumulator) div trunc( Memory[ operand ] );
  347.                 RES:    accumulator := trunc(accumulator) mod trunc( Memory[ operand ] );
  348.                 ROOF:   Memory[ operand ] := trunc(Memory[ operand ]);
  349.                 CEIL:   Memory[ operand ] := trunc(Memory[ operand ]) + 1;
  350.                 FROUND: Memory[ operand ] := round(Memory[ operand ]);
  351.                 FABS:   Memory[ operand ] := abs(Memory[ operand ]);
  352.  
  353.                 BRANCH:     numI:=operand;
  354.                 BRANCHNEG:  if(accumulator<0)then numI:=operand else numI+=1;
  355.                 BRANCHZERO: if(accumulator=0)then numI:=operand else numI+=1;
  356.                 BRANCHPOS:  if(accumulator>0)then numI:=operand else numI+=1;
  357.                 HALT:       begin
  358.                                 writeln;
  359.                                 writeln('*** SIMPLETRON EXECUTION TERMINATED ***');
  360.                                 break;
  361.                             end;
  362.                 PAUSE:      begin
  363.                                 if operand=1 then write('  *** PRESS A KEY TO PROCEED... ***');
  364.                                 readkey;
  365.                                 gotoXY( 1, WhereY);
  366.                                 ClrEOL;
  367.                             end;
  368.                 RETARD:     begin
  369.                                 write('*** DELAYING EXECUTION... ***');
  370.                                 delay_factor := trunc(Memory[ operand ] * 1000);
  371.                                 delay(delay_factor);
  372.                                 gotoXY( 1, WhereY);
  373.                                 ClrEOL;
  374.                             end;
  375.                 BRANCHMORE:if(accumulator>aux_accumulator)then numI:=operand else numI+=1;
  376.                 BRANCHEQL: if(accumulator=aux_accumulator)then numI:=operand else numI+=1;
  377.                 BRANCHLESS:if(accumulator<aux_accumulator)then numI:=operand else numI+=1;
  378.                                
  379.                        //COM'E' NOTO, CALCOLARE UNA RADICE PARI DI UN NUMERO NEGATIVO PRODUCE UN ERRORE
  380.                 FSQRT: if (Memory[ operand ]>=0) then accumulator := SQRT(Memory[ operand ])
  381.                        else
  382.                        begin
  383.                
  384.                             writeln;
  385.                             writeln('*** ATTEMPT TO CALCULATE THE SQUARE ROOT OF A NEGATIVE NUMBER ***');
  386.                             writeln('*** SIMPLETRON EXECUTION ABNORMALLY TERMINATED ***');
  387.                             exit_correct:='FAILURE';
  388.                             break;
  389.                
  390.                         end;
  391.                 FSQR : Memory[ operand ] := SQR(Memory[ operand ]);
  392.                 FEXP : Memory[ operand ] := EXP(Memory[ operand ]);
  393.                 FLOG : Memory[ operand ] := LN(Memory[ operand ]) / LN(10);
  394.                 FLN  : Memory[ operand ] := LN(Memory[ operand ]);
  395.                 POW  : accumulator := EXP( LN(accumulator) * Memory[ operand ] );
  396.                 ROOT : begin
  397.        
  398.                            if (accumulator>=0) then accumulator := EXP( LN(accumulator) / Memory[ operand ] )
  399.                            else
  400.                            begin
  401.                                 if ( trunc(Memory[ operand ]) mod 2 ) <> 0 then
  402.                                 begin
  403.                    
  404.                                     writeln;
  405.                                     writeln('*** ATTEMPT TO CALCULATE AN EVEN ROOT OF A NEGATIVE NUMBER ***');
  406.                                     writeln('*** SIMPLETRON EXECUTION ABNORMALLY TERMINATED ***');
  407.                                     exit_correct:='FAILURE';
  408.                                     break;
  409.                                    
  410.                                  end
  411.                                  else accumulator := EXP( LN(accumulator) / Memory[ operand ] );
  412.                      
  413.                             end;
  414.                
  415.                         end;
  416.                 FSIN : Memory[ operand ] := SIN(Memory[ operand ]);
  417.                 FCOS : Memory[ operand ] := COS(Memory[ operand ]);
  418.                 FTAN : Memory[ operand ] := SIN(Memory[ operand ])/COS(Memory[ operand ]);
  419.  
  420.            end;
  421.  
  422.            InstructionMem[ cont3 ]:=instruction;
  423.            cont3+=1;
  424.            
  425.            
  426.            //SE NON SONO STATI ESEGUITI SALTI IL CONTATORE VIENE INCREMENTATO NORMALMENTE
  427.            if NOT( (operationCode>=BRANCH) AND (operationCode<=BRANCHPOS) ) then
  428.            begin
  429.  
  430.                 numI+=1;
  431.  
  432.            end;
  433.        
  434.            if ( operationCode = CIN ) OR ( operationCode = COUT ) then cont+=1;
  435.        
  436.      end;
  437.      until (instruction=HALT) OR (instruction=STOPLOAD); //NORMALMENTE
  438.      
  439.      ViewDump;
  440.  
  441. end;
  442.  
  443. procedure ViewDump;
  444.  
  445. var sn:char;
  446.     cont2:byte=00;
  447.  
  448. begin
  449.  
  450.     writeln;writeln;writeln;
  451.     writeln('*** PRESS ''1'' TO SEE THE MEMORY DUMP ***');
  452.    
  453.     sn:=readkey;
  454.    
  455.     gotoXY( 1, WhereY-1);
  456.     ClrEOL;
  457.    
  458.     cont := 0;
  459.    
  460.     if sn='1' then
  461.     begin
  462.    
  463.         writeln('******** SYSTEM REGISTERS:');
  464.         writeln('*');
  465.         writeln('*  ACCUMULATOR          = ', accumulator:5:2);
  466.         writeln('*');
  467.         writeln('*  AUXILIAR ACCUMULATOR = ', aux_accumulator:5:2);
  468.         writeln('*');
  469.         writeln('*  OPERATION CODE       = ', operationCode);
  470.         writeln('*');
  471.         writeln('*  OPERAND              = ', operand);
  472.         writeln('*');
  473.         writeln('*  INSTRUCTION COUNTER  = ', numI);
  474.         writeln('*');
  475.         writeln('*  EXIT TYPE            = ', exit_correct );
  476.         writeln('*');
  477.    
  478.         writeln;writeln;
  479.    
  480.         writeln('******** VARIABLES MEMORY');
  481.         writeln('*');
  482.         writeln('*       0      1      2      3      4      5      6      7      8      9');
  483.         writeln('*');
  484.         write('* ', cont,'   ');
  485.    
  486.         while (cont<100) do
  487.         begin
  488.            
  489.             for cont2:=0 to 9 do write(Memory[ cont + cont2 ]:5:2,'  ');
  490.  
  491.             if (cont<100) then writeln;writeln('*');
  492.  
  493.             cont+=10;
  494.  
  495.             if (cont<100) then write('* ', cont,'  ');
  496.  
  497.         end;
  498.    
  499.         cont:=00;
  500.    
  501.         writeln;writeln;
  502.    
  503.         //LA CRONOLOGIA DELLE ISTRUZIONI VIENE VISUALIZZATA (E REGISTRATA) PER RENDERE CONTO DI COME E' STATO ESEGUITO IL PROGRAMMA
  504.         writeln('******** INSTRUCTIONS TIMELINE:');
  505.         writeln('*');
  506.         writeln('*        0     1     2     3     4     5     6     7     8     9');
  507.         writeln('*');
  508.         write('* ', cont,'   ');
  509.    
  510.         while (cont<100) do
  511.         begin
  512.            
  513.             for cont2:=0 to 9 do write(InstructionMem[ cont + cont2 ]:4,'  ');
  514.  
  515.             if (cont<100) then writeln;writeln('*');
  516.  
  517.             cont+=10;
  518.  
  519.             if (cont<100) then write('* ', cont,'  ');
  520.  
  521.         end;
  522.    
  523.     end;
  524.  
  525. end;
  526.  
  527. end.