中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 10:50
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » How do I write a DOS32 keyboard simulated input program with WATCOM C++
Printable Version  1,151 / 4
Floor1 linzhixiao Posted 2004-01-06 00:00
初级用户 Posts 15 Credits 160
The following is a DOS 16-bit keyboard simulated input routine, but because DOS32 does not support the pokeb and peek memory functions. Right now I need functions under DOS32 that also have this capability, but I can't convert it to functions supported by WATCOM DOS32. (Note: not WATCOM DOS16)
Experts who understand WATCOM c/c++, please help me out, many thanks.

void keyboard(int choice,char key)
{
int offset,i;
offset=peek(0x40,0x1c);
for(i=0;key!='\x0';i++)
{
if(choice==0)
{
pokeb(0x40,offset,0x00);
pokeb(0x40,offset,key);
}
if(choice!=0)

{
pokeb(0x40,offset,key);
pokeb(0x40,offset+1,0x00);
}
offset=offset+2;
if(offset==0x3e)offset=0x1e;
}
pokeb(0x40,0x1c,offset);
}
Floor2 linzhixiao Posted 2004-01-09 00:00
初级用户 Posts 15 Credits 160
Could it be that no expert has shown up yet?
Floor3 szxxbb Posted 2004-01-10 00:00
初级用户 Posts 8 Credits 133
Use assembly to directly drive the speaker port
Floor4 songjian Posted 2004-02-04 00:00
初级用户 Posts 18 Credits 140
Under the Watcom directory there is an example directory provided by Watcom, and inside it there is a Sample that is exactly what you need. Why didn't you look for it yourself? Strange??
Floor5 linzhixiao Posted 2004-02-07 00:00
初级用户 Posts 15 Credits 160
How do I write a DOS32 keyboard simulated input program with WATCOM C++
The following is a DOS 16-bit keyboard simulated input routine, but because DOS32 does not support the pokeb and peek memory functions. Right now I need functions under DOS32 that also have this capability, but I can't convert it to functions supported by WATCOM DOS32. (Note: not WATCOM DOS16)
Experts who understand WATCOM c/c++, please help me out, many thanks.

void keyboard(int choice,char key)
{
int offset,i;
offset=peek(0x40,0x1c);
for(i=0;key!='\x0';i++)
{
if(choice==0)
{
pokeb(0x40,offset,0x00);
pokeb(0x40,offset,key);
}
if(choice!=0)

{
pokeb(0x40,offset,key);
pokeb(0x40,offset+1,0x00);
}
offset=offset+2;
if(offset==0x3e)offset=0x1e;
}
pokeb(0x40,0x1c,offset);
}
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023