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);
}
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);
}


