c_plm01.plm

来自「在伟福环境下实现C51调用PLM51范例」· PLM 代码 · 共 67 行

PLM
67
字号

C_PLM01: do;

declare P1 byte at (90h) register;


GetXY: procedure word;
  declare x word;
  x = 1234;
  return(x);
  
end GetXY;


GotoXY: procedure(x, y);
  declare x byte;
  declare y byte;
  
end GotoXY;


WriteChar: procedure(B);
  declare B byte;
  
  
end WriteChar;


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;
    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 C_PLM01;

⌨️ 快捷键说明

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