home *** CD-ROM | disk | FTP | other *** search
-
- static char buf[128];
- extern unsigned long old_vector;
- int portnum;
- main(argc,argv)
- char **argv;
- {
- #ifdef DEBUG
- here: goto here;
- #endif
- if (argc == 1)
- {
- write(2,"async : usage async [0|1]\r\n",27);
- exit(1);
- }
- portnum = atoi(argv[1]);
- async_init(portnum);
- setup_int14();
- terminate();
- }
-
- c_handler(ax,bx,cx,dx,si,di,ds,es)
- unsigned ax,bx,cx,dx,si,di,ds,es;
- {
- /* if not our port, call the rom to find the stuff out */
- if (portnum != dx)
- {
- ax = call_rom(ax,dx);
- return;
- }
- switch(ax >> 8) /* pick up function number */
- {
- case 0: /* setup */
- async_restore(); /* they don't work properly if you change parms */
- call_rom(ax,dx); /* do setup */
- async_init(portnum);
- break;
- case 1:
- async_putc(ax & 0xFF);
- break;
- case 2:
- ax = (unsigned)(async_getc() & 0xFF);
- break;
- case 3:
- ax = call_rom(ax,dx);
- if (async_status())
- ax |= 0x0100;
- else
- ax &= 0xFEFF;
- break;
- }
- }