为什么不用TComDrv,分析要实现的功能,改用高级语言编程

解决方案 »

  1.   

    Would you let me know how to find the TComDrv ?
      

  2.   

    急!急! 此系收费顾客显示屏的主要部份,谁可帮我将下面C++程式中的
    init_port和send_port改成汇编。多谢!#include <stdio.h>
    #include <ctype.h>
    #include <conio.h>
    #include <dos.h>
    #include <bios.h>void init_port(code)
    unsigned char code;
    {
      union REGS r;
      
      r.x.dx = 0; /* com1 */  
      r.h.ah = 0; 
      r.h.al = code;
      int86(0x14,&r,&r);
    }void send_port(c)
    char c;
    {
      union REGS r;  r.x.dx = 0; /* com1 */
      r.h.al = c;
      r.h.ah = 1;
      int86(0x14,&r,&r);
      if (r.h.ah & 128) {
        printf("send error !\n");
        exit(-1);
      }
    }
      

  3.   

     呵呵,没人拿分?我来拿!80分也不少啊?
     修改如下:
    //Init_port 对应 Init_port;
    //send_port 对应 send_port;
    //呵呵,声明一下,因为对汇编忘记的差不多了,手头没有资料,你自己看着办调试一下,看看有注释的地方对不对。要不请哪为高手更正一下!
    procedure init_port(ch:char);
    begin
    asm
      mov dx,0;
      mov ah,0;
      mov al,ch;
      int $14;
    end;    
    end;function send_port(ch:char):string;
    label exit;
    var
     str:string;
    begin
    asm
      mov dx,0;
      mov al,ch;
      mov ah,1;
      int 14;
      and ah,128;     // <--注意一下这个地方
      cmp ah,0;       // <--还有这儿!
      jnz exit;
      mov str,'send error!';
    exit:  
    end;  
    result:=str;
    end;
      

  4.   

    急!急! 请指教? 你会帮个忙吗!谁会在 ComPort Library 中输出小数点到顾客显示屏. C++ 程式如下:void setpoint(k,n)
    int k,n; /* n=1 On, n=0 Off 1=<k<=11 */
    {
      send_port(27);
      send_port(46);
      send_port(k);
      send_port(n);
    }
    例子调用如下:
      for (i=1;i<13;i++) {
        setpoint(i,1);
        delay(1500);
        setpoint(i,0);
      }
    或参考上述部份 /************** CPortLib ****************/
    +----------------------------------------+
    | ComPort Library version 2.61           |
    | for Delphi 3, 4, 5                     |
    | and C++ Builder 3, 4, 5                |
    |                                        |
    | by Dejan Crnila                        |
    | 1998-2000                              |
    | C++ Builder support by Paul Doland     |
    +----------------------------------------+