Program Insert; Uses Crt,Dos; {$s-} Const Pocet = 10000; Type TPole = Array[1..Pocet] of Word; cas = record h, m, s, ms : word;Cas:Real; End; Var Pole:TPole; i:Word; cs:Cas; Vysl,Vysl2:Real; {********************************************************************} {**********procedury pro pocitani doby razeni*******************} procedure cas_start(var sc : cas); {odecte startovni cas} begin gettime(sc.h, sc.m, sc.s, sc.ms); writeln('Start: ',sc.h,':',sc.m,':',sc.s,'.',sc.ms); end; function cas_stop(sc : cas): real; {vraci pocet milisekund - real} var kc : cas; {koncovy cas} begin gettime(kc.h, kc.m, kc.s, kc.ms); writeln('Konec: ',kc.h,':',kc.m,':',kc.s,'.',kc.ms); if kc.ms < sc.ms then begin kc.ms := kc.ms + 100; sc.s := sc.s + 1; end; if kc.s < sc.s then begin kc.s := kc.s + 60; sc.m := sc.m + 1; end; if kc.m < sc.m then begin kc.m := kc.m + 60; sc.h := sc.h + 1; end; cas_stop := (kc.h-sc.h)*3600000+(kc.m-sc.m)*60000+(kc.s-sc.s)*1000+(kc.ms-sc.ms)*10; end; {procedury pro nastaveni casovace pro odecteni doby razeni} procedure timer_start; begin asm in al, 61h {0. bit 61h = GATE casovace 42h} mov ah, 0feh {nastavit 0. bit = reset citace} and al, ah out 61h, al {zapis na port} mov al, 10110110b {ridici slovo} out 43h, al mov al, 0 out 42h, al mov al, 0 out 42h, al in al, 61h {cteni portu 61h} mov ah, 01h {nulovat 0. bit - spusteni citace} or al, ah out 61h, al {zapis na port} end; end; function timer_stop:real; {vraci pocet miliseknud} var lsb, msb : byte; begin asm mov al, 10110110b {ridici slovo - 2. casovac, 3. mod, dva byty} out 43h, al in al, 42h mov lsb, al in al, 42h mov msb, al end; timer_stop := (65535-(256*msb+lsb))/(18.2*655.35); end; {********************************************************************} Procedure InsertSort(Var Pole:TPole); Var Start,Poloha,i:word; Min:Word; Zaloha:TPole; begin For Start:=1 to Pocet do Begin Min:=MaxInt; For i:=Start to Pocet do IF Pole[i]