Mail Archives: djgpp/2002/03/01/22:45:26
Hello,
I have abandoned "segread" and int86 and have gone thru section 18.2 to
understand what is going on so I can migrate my program to DJGPP. The example
in 18.2 shows how to get data FROM a DOS interrupt, but how do you pass data TO
a DOS interrrupt? Section 18.2 states that the "transfer buffer" is what all
data must pass thru.
I looked at the doc for the TSR I am using and here is a brief overview of
how to interface with it....
AX ===> usual interrupt setup stuff
CX ===> number of chars to send
DS:DX ===> address of data to send (transfer buffer?)
Here is the portion of my code that configures the interrupt and sets how many
chars to send, that I understand.
inregs.x.ax = 0x0101; /* setup int */
inregs.x.cx = length; /* number of bytes to send */
So here some the questions.......
1.) How do I get the data to send into the "transfer buffer" which points to
DS:DX. My program has the data to send contained in a char pointer.
inregs.x.ds = __tb >>4;
inregs.x.dx = __tb & 0X0f;
2.) The data segment (DS) appears to be the transfer buffer shifted to the
right by four bits. Is this true forever?
3.) The offset (DX) appears to be the transfer buffer "anded" with 0X0F. Is
this also true forever?
Thanks for your help!
- Raw text -