有一款打印机无驱动程序(本身就是如此),使用它的方法是直接写并口(好处是打印速度快)。现遇到一个麻烦,就是当打印机无纸时,它会使计算机死机。请问高手,怎么获得无纸信息,或者有其它什么办法解决!!

解决方案 »

  1.   

    无纸时应该有IRQ吧,具体也没做过。
      

  2.   

    当打印机无纸时,它会使计算机死机。
    首先要確定是不是你的程序有問題,可能性比較大
    用另的軟件(word)打印測試一下
      

  3.   

    procedure Out32(portadresse: Word; wert: Byte); 
    var 
      val: Byte; 
    begin 
      val := Byte(wert); 
      asm 
        push dx 
        mov dx,portadresse 
        mov al,val 
        out dx,al 
        pop dx 
      end; 
    end; function Inp32(portadresse: Word): Byte; 
    var 
      val: Byte; 
    begin 
      asm 
        push dx 
        mov dx,portadresse 
        in al,dx 
        mov val,al 
        pop dx 
      end; 
      Inp32 := Byte(val) and $00ff; 
    end; 
    // Example/Beispiel:   Out32($378, 0)  {= Dataport all 8 Bit Low} 
      Out32($378, (Inp32($378) or 1); {Dataport Bit 1 High} 
      Out32($378, (Inp32($378) and 254);  {Datap. Bit 1, Low}