crane@fortune.UUCP (12/06/83)
It's been awhile since I've worked on the PC, but I remember that the IBM
technical reference manual has some assembly language listing in the back
that do all kinds of I/O-type stuff provided you load the registers right
and send the routine the right interrupt code. Anyway, I wrote a program
to test these capabilities and decided to keep the listing, part of
which I'm going to include here. I'm just going to show one routine --
cursor positioning-- but you should get the idea of how the rest might work.
See the tech ref manual for details on how to call the other functions.
/* define register structures as full registers and half registers */
struct regval{int ax,bx,cx,dx,si,di,ds,es;};
struct regvalb{char al,ah,bl,bh,cl,ch,dl,dh,sl,sh,dl,dh,dsl,dsh,esl,esh;};
main()
{
...
}
/*
** routine to position the cursor at row/column (0,0) = home
*/
poscur(page,row,col)
int page,row,col;
{
struct regval srv,rrv; /* sending/receiving reg values */
srv.ah = 2; /* position cursor */
srv.bh = page; /* page number */
srv.dh = --row; /* row rumber */
srv.dl = --col; /* column number */
sysint(0x10,&srv,&rrv); /* call interrupt 0x10 */
}
It is not necessary to use receiving registers. You could use the
sending ones. This should give a person enough to go on. If not, ask
again, I'll give some more examples.
John Crane
Fortune Systems
Redwood City, CA