dos

Accessing the mouse via assembly x86

我是研究僧i 提交于 2019-12-31 02:55:25
问题 I am using assembly-x86 on a DOS emulator (dosbox). I want to use the graphic mouse on video mode but I can't find a way to access it, in order to find its position and react to clicks. I have found several examples of using int 33h but they did not have a proper explanation with the code. What interrupt or port can I use to access it, and where can I find a documentation of all of its functions? 回答1: But without using a mouse driver: For a PS2-mouse (and additional for an USB-mouse with USB

dos命令dir查找文件的用法及实例

为君一笑 提交于 2019-12-30 10:05:59
功能:显示目录命令 格式:dir[盘符][路径][/W][/P][/L][/O:排序][/A:属性][/S] 参数介绍: /W -- 以宽行排列方式显示。 /P -- 每显示满一屏停顿一下,待用户击任一键后再继续显示下一屏。 /L--用小写字母显示。 /O--显示时按O参数表中指定的方式对文件名排序。 /A--仅显示A参数表中指定的文件。 /S--显示指定目录及所有子目录中文件 二、DIR命令实例 常规实例 假设要显示某一目录下的所有文件和目录,包括隐藏文件和系统文件,可使用下面命令: dir /a 如果显示当前驱动器下所有目录,并依次列表,同时对于每个目录列表按横显格式,并按字母顺序排序,而且一次屏,则可在根目录下使用下面命令: dir /s/w/o/p DIR列出了根目录名,根目录下子目录名,以及根目下的所有文件名,然后以目录树的形式列出了子目录名和子目录下所有文件名。可改变上一例子,使得DIR显示文件名和扩展名,但忽略目录名,命令如下: </P> dir /s/w/o/p/a:-d 为打印目录列表,可在任何DIR命令之后,给出重定向符和PRN,例如: dir >prn 当在DIR命令行指明了PRN,则目录列表被送到连接在端口LPT1的打印机上。如果打印机所连接的是其它的端口,你必须用该端口名称来替代PRN。 亦可重新定向输出到一文件,只须用一文件名替代PRN。

Displaying characters with DOS or BIOS

人盡茶涼 提交于 2019-12-30 09:55:11
问题 Looking through Ralph Brown's interrupt list, I discovered that there are many different ways to output text characters to the screen. The ROM BIOS API offers these functions: AH=09h – Write Character and Attribute at Cursor Position AH=0Ah – Write Character Only at Cursor Position AH=0Eh – Teletype Output AH=13h – Write String The DOS API offers the following functions: AH=02h – Write Character to Standard Output AH=06h – Direct Console Output AH=09h – Write String to Standard Output What do

How can i get the first line of the output for given command in dos

时光毁灭记忆、已成空白 提交于 2019-12-30 09:39:15
问题 I need to get the very first line of the command line output not all line, For example if i give C:\Temp> dir I need display the Very first line only like, 11/15/2012 06:58 PM <DIR> . How can i get this ? Thanks in advance. 回答1: One approach to get the first line of output for a given command is to execute the command in a FOR loop, then break out of the loop after the first line. @ECHO OFF SET COMMAND=dir FOR /F "delims=" %%A IN ('%COMMAND%') DO ( SET TEMPVAR=%%A GOTO :Print ) :Print ECHO

Return value of SQLCMD

*爱你&永不变心* 提交于 2019-12-30 05:59:49
问题 I need to check the exit status (success/failure) of a query run through SQLCMD utility. For example, the server I am connecting doesn't have a database name EastWind . Then, the command below fails with the message ... > "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S ZEPHIR -E -Q "USE WestWind" Changed database context to 'WestWind'. > echo %errorlevel% 0 > "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S ZEPHIR -E -Q "USE EastWind" Database

In Batch: Read only the filename from a variable with path and filename

匆匆过客 提交于 2019-12-30 03:17:08
问题 I am currently looking for a way to take a variable in batch and only parse out the filename. For example, I pass my batch file a -s parameter from another application which is subsequently set to my source variable. The source file variable typically contains something like: C:\Program Files\myapp\Instance.1\Data\filetomove.ext. I assume to read from the end of the variable until the first "\" and set the result to a new variable filename but I have not been able to use the "for /f" commmand

什么是SDK?

笑着哭i 提交于 2019-12-29 22:38:42
百科名片 基本信息    SDK,Software Development Kit 的缩写,中文即“软件开发工具包”。广义上指辅助开发某一类软件的相关文档、范例和工具的集合。   SDK是一些被软件工程师用于为特定的软件包、软件框架、硬件平台、操作系统等创建应用软件的开发工具的集合,一般而言SDK即开发 Windows 平台下的应用程序所使用的SDK。它可以简单的为某个程序设计语言提供应用程序接口 API 的一些文件,但也可能包括能与某种嵌入式系统通讯的复杂的硬件。一般的工具包括用于调试和其他用途的实用工具。SDK 还经常包括示例代码、支持性的技术注解或者其他的为基本参考资料澄清疑点的支持文档。   为了鼓励开发者使用其系统或者语言,许多 SDK 是免费提供的。软件工程师通常从目标系统开发者那里获得软件开发包,也可以直接从互联网下载,有时也被作为营销手段。例如,营销公司会免费提供构件SDK 以鼓励人们使用它,从而会吸引更多人由于能免费为其编程而购买其构件。   SDK 可能附带了使其不能在不兼容的许可证下开发软件的许可证。例如产品供应商提供一个专有的SDK可能与自由软件开发抵触。 GPL 能使SDK与专有软件开发近乎不兼容。LGPL下的SDK则没有这个问题。 相关背景 API   API(Application Programming Interface

How can I clear the screen without having to fill it

北城以北 提交于 2019-12-29 06:19:49
问题 Does an interrupt service routine exist to help me clear the screen of the terminal? Will it work on windows? 回答1: Setting a graphics mode through BIOS (int 10h with AH=0) will clear the screen. Scrolling the screen up or down through BIOS (int 10h with AH=6 or 7) can clear the screen as well. This will only work where you can invoke BIOS service functions. MSDOS is where this will always work. In Windows this will work only in DOS applications and if Windows can actually run them. 64-bit

Writing to 0xb8000000 yields output on screen without any print statements such as `printf`

喜夏-厌秋 提交于 2019-12-29 04:57:28
问题 #include <stdio.h> #include <conio.h> void main() { char far *v = (char far*)0xb8000000; clrscr(); *v = 'w'; v += 2; *v = 'e'; getch(); } Output is: we I don't get how the output is getting printed without any printf or other print statements. 回答1: This is a x86 real-mode IBM PC program that assumes CGA/EGA/VGA compatible graphics adapter in color text mode mapped at the default memory location (B800:0000); it is basically from the era of MS-DOS (1980s/1990s). In any case it's very old school

Recursive directory listing in DOS

删除回忆录丶 提交于 2019-12-29 02:24:06
问题 How do we achieve a recursive directory listing in DOS? I'm looking for a command or a script in DOS which can give me the recursive directory listing similar to ls -R command in Unix. 回答1: You can use: dir /s If you need the list without all the header/footer information try this: dir /s /b (For sure this will work for DOS 6 and later; might have worked prior to that, but I can't recall.) 回答2: dir /s /b /a:d>output.txt will port it to a text file 回答3: You can get the parameters you are