智能DOS C编译器打印到USB打印机 - 使用DOS中断? [英] Outsmarting DOS C compiler to print to USB printer -- use DOS interrupt?

查看:71
本文介绍了智能DOS C编译器打印到USB打印机 - 使用DOS中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Borland Turbo C ++编译器(虽然我从不使用plus-plus

部分),版权1990.我使用这个编译器来编写简单的程序,

其中一个我非常依赖。


一个月前,我的并口输出打印机死了,我有一个三星

从USB端口获取信息的打印机。每次我进入DOS

模式并尝试向该打印机发送内容,无论是来自命令

line(" dir> prn"),还是来自其中一个我的程序,我收到一条错误信息。


如果我从我的DOS程序中调用了一个中断,那么我发现这是我的方式可以将字符发送到我的USB打印机。这可能,

我会用什么中断?举个例子,中断17h,

函数00h是(不再有用的)中断,它将字符

发送到并行端口。

I have a Borland Turbo C++ compiler (though I never use the "plus-plus"
part), copyright 1990. I use this compiler to write simple programs,
one of which I am quite dependent on.

A month ago, my parallel-port-output printer died, and I got a Samsung
printer that takes info from the USB port. Every time I go into DOS
mode and try to send something to that printer, whether from a command
line ("dir>prn"), or from one of my programs, I get an error message.

It occured to me that if I called an interrupt from my DOS program,
that''s how I could send characters to my USB printer. Is this possible,
and what interrupt do I use? To give an example, Interrupt 17h,
Function 00h is the (no longer useful) interrupt that sends a character
to the parallel port.

推荐答案

tomhr说:
tomhr said:
如果我从DOS程序中调用了一个中断,那么我发现了这就是我可以将字符发送到USB打印机的方法。这是可能的吗?
我会用什么中断?举个例子,中断17h,
函数00h是(不再有用的)中断,它将一个字符发送到并行端口。
It occured to me that if I called an interrupt from my DOS program,
that''s how I could send characters to my USB printer. Is this possible,
and what interrupt do I use? To give an example, Interrupt 17h,
Function 00h is the (no longer useful) interrupt that sends a character
to the parallel port.




这很有可能,但你最好找出来的结果将在

comp.os.msdos.programmer中结束 - 他们专注于这类事情。

-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)



It may well be possible, but your best bet of finding out would be over in
comp.os.msdos.programmer - where they specialise in this kind of thing.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


它应该(实际上我很确定它是可以获得USB

在DOS下运行,但根据我对USB(和dos)的经验我很高兴怀疑它会像调用一样简单一个中断。

的问题是你需要一个用于dos的USB驱动程序,而且

驱动程序需要知道如何处理你所使用的设备类型。 >
尝试与之沟通。


如果您有冒险精神,可以访问位于中的USB

主机控制器PC然后你可以为

写一个驱动程序。我也相信有人(我忘了是谁)为DOS编写了一个USB驱动程序

,这可能满足你的需求。我偶然发现了这个USB驱动程序的参考资料

但我从未下载过它。

It should (actually I am very certain that it is) possible to get USB
to function under dos, but based on my experience with USB (and dos) I
highly doubt that it will be as simple as calling an interrupt. The
problem is that you need a USB driver for dos and on top of that the
driver needs to know how to handle the type of device that you are
trying to communicate with.

If you are feeling adventurous, it may be possible to access the USB
host controller that is in the PC and you could then write a driver for
it. I also believe that someone (I forget who) did write a USB driver
for DOS, which may serve your needs. I stumbled across references to
this USB driver but I never downloaded it.




tomhr写道:

tomhr wrote:
我有一个Borland Turbo C ++编译器(虽然我从未使用过plus-plus
部分),1990版权所有。我使用这个编译器来编写简单的程序,
一个月前,我的并行端口输出打印机坏了,我有一台三星
打印机从USB端口获取信息。每当我进入DOS
模式并尝试向该打印机发送内容时,无论是从命令
行(dir> prn),还是从我的某个程序中,我都会收到错误消息。

对我来说,如果我从DOS程序中调用了一个中断,那就是我可以将字符发送到USB打印机的方式。这是可能的吗?
我会用什么中断?举个例子,中断17h,
函数00h是(不再有用的)中断,它将一个字符发送到并行端口。
I have a Borland Turbo C++ compiler (though I never use the "plus-plus"
part), copyright 1990. I use this compiler to write simple programs,
one of which I am quite dependent on.

A month ago, my parallel-port-output printer died, and I got a Samsung
printer that takes info from the USB port. Every time I go into DOS
mode and try to send something to that printer, whether from a command
line ("dir>prn"), or from one of my programs, I get an error message.

It occured to me that if I called an interrupt from my DOS program,
that''s how I could send characters to my USB printer. Is this possible,
and what interrupt do I use? To give an example, Interrupt 17h,
Function 00h is the (no longer useful) interrupt that sends a character
to the parallel port.




我假设是从dos模式开始。和usb您正在运行Windows。

我还假设你有一个用于usb打印机的Windows驱动程序。


试试这个。


为打印机创建一个共享名。


[控制面板/打印机/右击/属性/共享]


启动dos命令窗口。


C:/> net use \\mypc\printersharename LPT1:


(你可以与自己分享自己的资源。)


这将设置dos lpt1:打印机挂钩到windows usb驱动程序。



I assume from "dos mode" and "usb" that you''re running Windows.
I also assume that you have a Windows driver for the usb printer.

Try this.

Create a sharename for the printer.

[control panel/printers/right click/properties/sharing]

Start a dos command window.

C:/>net use \\mypc\printersharename LPT1:

(You can share your own resources with yourself.)

That will set the dos lpt1: printer hook to the windows usb driver.


这篇关于智能DOS C编译器打印到USB打印机 - 使用DOS中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆