ptrap.plm

来自「用单片机实现的总线比较的2取2功能的安全计算机」· PLM 代码 · 共 46 行

PLM
46
字号

PTRAP: do;

$include(PTRAP.DCL)

declare P1 byte at (90h) register;

Writeln: procedure(Ptr) public;
  declare Ptr word;
  declare B based Ptr byte auxiliary;
  declare I byte;

  do while (B <> 0);
    if B = 0ah then do;
      call GotoXY(1, low(GetXY)+1);
    end; else call WriteChar(B);
    Ptr = Ptr+1;
  end;
end Writeln;

Readln: procedure(Ptr) public;
  declare Ptr word;
  declare B based Ptr byte auxiliary;
  declare Enter bit;
  declare I word;

  Enter = 0;
  I = 0;

  do while not Enter;
    P1 = P1 + 1;
    I = I+1;
    B = ReadKey;
    if B = 0dh then do;
      B = 0;
      Enter = 1;
    end;
    if B = 0 then do;
      call GotoXY(1, low(GetXY)+1);
    end; else call WriteChar(B);
    if I < 20 then Ptr = Ptr+1;
  end;
end Readln;

end PTRAP;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?