Разработка комплекса программ для автоматизации экспериментальных исследований тангенциального точения на станке с ЧПУ 6Р13Ф3, страница 11

       mov key1,ah

     end;

       D.detector:=a;

               {чтение n каналов в массив Data}

               asm

                  mov ax,Dseg

                  mov es,ax

                  mov si,Doffs

                  add si,MaxChn*2+2

                  mov cx,MaxChn

                  mov di,ChnToShow                        {2}

                  mov dx,et1222adr

                  mov ax,cx

                  dec ax

                  shl ax,6

                  out dx,ax

                  add dx,4

                  out dx,ax

                  inc cx

             rep2:

                  dec cx

                  sub dx,4

                  in ax,dx

{$ifdef DEBUGMODEADC}

                  mov ax,cntr{+$800        {заглушка}

{$endif}

                  and ax,$0fff

                  dec si

                  dec si

                  mov es:[si],ax;

                  mov ax,cx

                  dec ax

                  mov bx,ax

                  dec ax

                  shl ax,6

                  out dx,ax

                  add dx,4

                  out dx,ax

                  push cx

                  cmp di,cx                               {2}

                  jnz notShow                             {13|3}

                  {подготовка данных для вывода на экран}

                  push dx

                  inc di                                  {2}

                  mov ax,es:[si]                          {5}

                  inc ax                                  {2}

                  shr ax,7                                {3}

                  sub ax,16                               {2}

                  mov bx,ax               {запомнить ax}   {2}

                  cwd                     {abs ax}         {2}

                  xor ax,dx                                {2}

                  sub ax,dx                                {2}

                  mov ValueToShow,ax                       {4}

                  {определение смещения}

{                  mov ax,17                                {2}

                  inc ax

                  and bx,$8000                             {2}

                  shr bx,15                                {3}

                  mul bl                                {9|14}

                  shl ax,1                                 {2}

                  mov bx,ax                                {2}

                  {вычисление адреса вывода на экран}

                  mov ax,160                               {2}

                  mul cl                                 {9|14}

                  mov cx,ax                                {2}

                  mov ax,StartAddrChn                      {2}

                  sub ax,bx                                {2}

                  add ax,cx                                {2}

                  mov TmpAddr,ax                           {4}

                  mov ax,StartAddrChnClr                   {2}

                  add ax,cx                                {2}

                  mov ClrAddr,ax                           {4}

                  pop dx

                  mov cx,8                                 {2}

                  jmp rep1                                 {13}

          notShow:

                  mov cx,13  {было 14}                     {2}

             rep1:

                  loop rep1                                {16}

                  pop cx

                  inc cx

                  loop rep2

                 {сохранить счетчик каналов для вывода на экран}

                  and di,$07                               {2}

                  mov ChnToShow,di                         {4}

               end;

             {конец чтения каналов}

               if FirstTime then begin tms10:=0; FirstTime:=false; end

               else tms10:=tms10+Period;

               D.STime:=tms10;

               if (d.d[8] and $8000)<>0 then break;

               XS^.Write(D,sz);

               l:=(XS^.Position+DSize)>MaxMemSize;

             {вывод времени}

               asm

                      mov ax,SEG tms10

                      mov es,ax

                      mov bx,OFFSET tms10;

                      mov ax,es:[bx+2];

                      shr ax,2     {деление на 2^20 - определяет}

                                   {максимальное время 1c - 1 звездочка}

                                                {+умножение на 2}

                      cmp ax,12                 {вышло ли время}

                      jg  tmout

                      shl ax,1

                      mov bx,ax

                      mov ax,VideoSeg

                      mov es,ax

                      {Отображение времени}

                      mov al,'¦'

                      mov di,StartAddr

         rep:

                      and bx,bx

                      jz  contV

                      mov es:[di+bx],al

                      dec bx

                      dec bx

                      jmp rep

         contV:

                      {Очистка места}

                      mov al,' '               {2}

                      mov di,ClrAddr           {2}

                      mov bx,16                {2}

         repC:

                      and bx,bx                {2}

                      jz  contC                 {3|13}

                      mov es:[di],al        {9}

                      dec bx

                      dec di                   {2}

                      dec di                   {2}

                      jmp repC                  {13}

         contC:

                      dec di                   {2}

                      dec di                   {2}

                      mov bx,16                {2}

         repC1:

                      and bx,bx                {2}

                      jz  contC1               {3|13}

                      mov es:[di],al        {9}

                      dec bx

                      dec di                   {2}