скачать рефераты
  RSS    

Меню

Быстрый поиск

скачать рефераты

скачать рефератыРеферат: Взаимодействие основных частей ЭВМ при выполнении программы

end; {Page_4_3}

{-------------------}

procedure Page_4_4;

begin

  SetViewPort(X, Y, GetMaxX - X, YS - 10, ClipOn);

  SetColor(TxtCol);

  MyText(0, 48, '- АЛУ выполняет эту операцию (сложение) над двумя ' +

                'операндами и возвращает');

  MyText(0, 56, '  результат в ОЗУ.');

  SetViewPort(0, 0, GetMaxX, GetMaxY, ClipOn)

end; {Page_4_4}

{-------------------}

procedure Page_4_5;

begin

  SetViewPort(X, Y, GetMaxX - X, YS - 10, ClipOn);

  SetColor(TxtCol);

  MyText(0, 64, '- УУ собщает ОЗУ третий адрес (адрес результата),');

  SetViewPort(0, 0, GetMaxX, GetMaxY, ClipOn)

end; {Page_4_5}

{-------------------}

procedure Page_4_6;

begin

  SetViewPort(X, Y, GetMaxX - X, YS - 10, ClipOn);

  SetColor(TxtCol);

  MyText(0, 72, '- ОЗУ помещает полученный результат в ячейку памяти.');

  SetViewPort(0, 0, GetMaxX, GetMaxY, ClipOn)

end; {Page_4_6}

{-------------------}

procedure Page_4_7;

begin

  SetViewPort(X, Y, GetMaxX - X, YS - 10, ClipOn);

  SetColor(TxtCol);

  MyText(0, 80, 'На этом выполнение первой машинной команды ' +

                'заканчивается, происходит');
КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

10
 

  MyText(0, 88, 'переход к следующей по порядку машинной команде. ' +

                'Содержимое ячейки ОЗУ с');

  MyText(0, 96, 'адресом, следующим за стартовым, пересылается в УУ ' +

                'и все повторяется.');

  SetViewPort(0, 0, GetMaxX, GetMaxY, ClipOn)

end; {Page_4_6}

{-------------------}

{+------------------+}

{                    }

{ Процедуры анимации }

{                    }

{+------------------+}

procedure Move_1;

begin

  BLink(150, 285, 'kurs.exe');

end; {Move_1}

{-------------------}

procedure Move_2;

begin

  SetColor(Green);

  Animation(150, 285, -125, 2, ' █ █', True)

end; {Move_2}

{-------------------}

procedure Move_3;

begin

  SetColor(GetBkColor);

  SetColor(Green);

  Animation(100, 168, -70, 1, ' 1 2 +', True)

end; {Move_3}

{-------------------}

procedure Move_4_1;

begin

  SetColor(GetBkColor);

  OutTextXY(30, 176, ' 1 2');

  SetColor(Green);

  Animation(47, 198, 63, 1, ' 1 2', False);

  SetColor(GetBkColor);

  OutTextXY(150, 168, ' █ █');

  SetColor(Green);

  OutTextXY(150, 168, ' a b')

end; {Move_4_1}

{-------------------}

procedure Move_4_2;

begin

  SetColor(Green);

  Animation(150, 160, -95, 2, ' a b', True)

end; {Move_4_2}

{-------------------}

procedure Move_4_3;

begin

  setcolor(getbkcolor);

  OutTextXY(30, 176, '     +');

  SetColor(Green);

  Animation(52, 160, -94, 2, '+', False)

end; {Move_4_3}

{-------------------}

procedure Move_4_4;

КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

11
 


begin

  SetColor(Green);

  Animation(52, 66, 115, 1, '+', True);

  OutTextXY(183, 73, '=c')

end; {Move_4_4}

{-------------------}

procedure Move_4_5;

begin

  SetColor(GetBkColor);

  SetColor(Green);

  Animation(47, 198, 63, 1, '3', False);

end; {Move_4_1}

{-------------------}

procedure Move_4_6;

begin

  SetColor(Green);

  Animation(191, 66, 94, 2, 'c', True)

end; {Move_4_5}

{-------------------}

procedure Help;  {Помощь}

const

  XH: Integer = 70;

  YH: Integer = 70;

begin

  ClearDevice;

  SetColor(BRDCol);

  Rectangle(0, 0, GetMaxX, GetMaxY);

  SetColor(LightCyan);

  SetTextJustify(1, 0);

  OutTextXY(GetMaxX div 2, YH + 10,'Помощь:');

  SetTextJustify(0, 0);

  OutTextXY(XH + 10, YH + 20,'Адрес  :');

  OutTextXY(XH + 10, YH + 30,'УУ     :');

  OutTextXY(XH + 10, YH + 40,'АЛУ    :');

  OutTextXY(XH + 10, YH + 50,'АЛУ+УУ :');

  OutTextXY(XH + 10, YH + 60,'ВЗУ    :');

  OutTextXY(XH + 10, YH + 70,'ОЗУ    :');

  OutTextXY(XH + 10, YH + 80,'УВвода :');

  OutTextXY(XH + 10, YH + 90,'УВывода:');

  SetColor(Cyan);

  OutTextXY(XH + 90, YH + 20,'номер ячейки памяти');

  OutTextXY(XH + 90, YH + 30,'устройство управления');

  OutTextXY(XH + 90, YH + 40,'арифметико-логическое устройство');

  OutTextXY(XH + 90, YH + 50,'процессор');

  OutTextXY(XH + 90, YH + 60,'внешнее запоминающее устройство (hdd, fdd и др.)');

  OutTextXY(XH + 90, YH + 70,'оперативное запоминающее устройство');

  OutTextXY(XH + 90, YH + 80,'устройство ввода');

  OutTextXY(XH + 90, YH + 90,'устройство вывода');

  _Pause

end; {Help}

{-------------------}

procedure MainWin;

begin

  ClearDevice;

  BildWin;

  BildContext;

  BildFuncKey

end; {MainWin}

{-------------------}

КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

12
 


procedure Play;

 {-------------}

procedure SelectPage(N: Byte);

begin

  case N of

 1: begin

      FuncKeyWindow[2].Put(XS, YS);

      Page_1;

      Move_1

    end;

 2: begin

      FuncKeyWindow[1].Put(XS, YS);

      Page_2;

      Move_2

    end;

 3: begin

      FuncKeyWindow[1].Put(XS, YS);

      Page_3;

      Move_3

    end;

 4: begin

      FuncKeyWindow[3].Put(XS, YS);

      Page_4_1;

      Move_4_1;

      Delay(Time_3 * 20);

      Page_4_2;

      Delay(Time_3 * 20);

      Move_4_2;

      Delay(Time_3 * 20);

      Page_4_3;

      Delay(Time_3 * 20);

      Move_4_3;

      Move_4_4;

      Page_4_4;

      Delay(Time_3 * 20);

      Page_4_5;

      Delay(Time_3 * 20);

      Move_4_5;

      Delay(Time_3 * 20);

      Page_4_6;

      Delay(Time_3 * 20);

      Move_4_6;

      Delay(Time_3 * 20);

      Page_4_7

    end

  end

end; {SelectPage}

 {-------------}

const

  Back = #75;

  Next = #77;

  F1   = #59;

  Esc  = #27;

var

  ArrowsAndEsc: set of Char;

  ExtentedKey: Boolean;

  Flag: Boolean;

  CH: Char;

  N: Byte;

begin

  ClearDevice;

  MainWin;

  N := 0;
КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

13
 

  ArrowsAndEsc := [Back, Next, F1, Esc];

  repeat

    ExtentedKey := False;

    Flag := False;

    CH := ReadKey;

    if CH = Esc then

      Flag := True;

    if CH = #0 then

      begin

        CH := ReadKey;

        ExtentedKey := True

      end;

    if ExtentedKey then

    case CH of

 Back: begin

         Dec(N);

         SelectPage(N);

         if N < 1 then N := 1

       end;

 Next: begin

         Inc(N);

         SelectPage(N);

         if N > 4 then N := 4

       end;

 F1:   begin

         Temp[1].Get(X0, Y0, X0 + 380, Y0 + 300);

         Temp[2].Get(X0, Y0 + 305, GetMaxX - X0, YS - 5);

         Help;

         MainWin;

         Temp[1].Put(X0, Y0);

         Temp[2].Put(X0, Y0 + 305);

         if N <= 1 then

          FuncKeyWindow[2].Put(XS, YS);

         if N = 4 then

          FuncKeyWindow[3].Put(XS, YS)

       end

    end  {Case}

  until Flag;

  ClearDevice

end; {Play}

{-------------------}

procedure TextT(Col: TColor; S: TText);

begin

  SetTextJustify(1, 1);

  for I := 1 to 4 do

    begin

      SetColor(Col[I]);

      OutTextXY(GetMaxX div 2, GetMaxY div 2 + I * 10 - 40, S[I])

    end;

  SetTextJustify(0, 0)

end; {TextT}

{-------------------}

procedure TestMode;

{-----------------}

function Quastion(N: Byte;  var CH: Char): Byte;

var

  I: Byte;

  C: Char;

  CHEAt: string[1];

  Code: Integer;

  StrN: string[3];

  Res: Byte;

Begin
КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

14
 

  CH := #0;

  SetColor(BRDCol);

  Rectangle(0, 0, GetMaxX, GetMaxY);

  SetColor(White);

  MyText(XT, YT, 'Вопрос #' + QuastionS[N]);

  SetColor(Yellow);

  for I := 1 to 3 do

    begin

      if I = Ok[N] then

        Cheat := V

      else

        Cheat := '';

      MyText(XT, YT + 10 * I, Answer[N, I] + Cheat)

    end;

  repeat

    C := ReadKey;

    if C = #27 then

      begin

        SetTextJustify(1, 0);

        SetViewPort(1, GetMaxY - 100, GetMaxX - 1, GetMaxY - 1, ClipOn);

        SetColor(Red);

        OutTextXY(GetMaxX div 2, 10, 'Вы действительно хотите выйти?');

        SetColor(Green);

        OutTextXY(GetMaxX div 2, 30, 'Да(Y), Нет(N)');

        SetTextJustify(0, 0);

        C := ReadKey;

        if C = 'y' then

          C := #27

        else

          begin

            C := #0;

            ClearViewPort

          end;

        SetViewPort(0, 0, GetMaxX, GetMaxY, ClipOn)

      end

  until C in ['1', '2', '3', #27];

  if C <> #27 then

    begin

      Val(C, Res, Code);

      if Res = Ok[N] then

        begin

          Quastion := 1;

          SetColor(Green);

          MyText(GetMaxX div 2 - 20, GetMaxY - 200, 'ВЕРНО')

        end

      else

        begin

          Quastion := 0;

          SetColor(Red);

          MyText(GetMaxX div 2 - 28, GetMaxY - 200, 'НЕВЕРНО')

        end;

      Delay(Time_2)

    end

  else

    CH := C;

  ClearDevice

end; {Quastion}

{-----------------}

function Mark(Res: Byte): Char;

begin

  case Res of

    1: Mark := '1';

    2: Mark := '2';
КР. 991096.00.00.00 ПЗ Лист
——–

Изм.

Лист

№ докум.

Подп.

Дата

15

Страницы: 1, 2, 3, 4


Новости

Быстрый поиск

Группа вКонтакте: новости

Пока нет

Новости в Twitter и Facebook

  скачать рефераты              скачать рефераты

Новости

скачать рефераты

© 2010.