Reference Section
_adapter_init ...
_adapter_init(); /* init adapter support by console i/o */
...
...
adapter_init(); /* init adapter support by console i/o */
...
Source file CIOADINT.ASM ASM equiv ADAPTER_INIT
_afill_eol (WHITE+(16*BLUE));/* white on blue */
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))
afill_eol();
...
Source file _CIOAFLE.ASM ASM equiv AFILL_EOL
...
_afill_line(WHITE+(16*BLUE));
...
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))
afill_line();
...
Source file _CIOAFLL.ASM ASM equiv AFILL_LINE
...
_afill_n(WHITE+(16*BLUE),10);/* WHITE on BLUE */
...
#include <inline.h>
...
mov cl,10
mov ah,(WHITE+(16*BLUE))
afill_n();
...
Source file _CIOAFLN.ASM ASM equiv AFILL_N
_afill_region(WHITE+(16*BLUE));/* white on blue */
#include <inline.h>
mov ah,(WHITE+(16*BLUE))
afill_region();
...
Source file _CIOAFLR.ASM ASM equiv AFILL_REGION
_bkbold_off();/* turn high intensity background off */
bkbold_off();/* turn high intensity background off */
Source file CIOBKBOF.ASM ASM equiv BKBOLD_OFF
_bkbold_on();/* turn high intensity background on */
_cput_str("Blink on...");
#include <inline.h>
{
char str[] = "Blink on...";
bkbold_on();
lea si,str
cput_str();
...
}
Source file CIOBKBON.ASM ASM equiv BKBOLD_ON
_blink_off();/* turn blink off */
blink_off(); /* turn blink off */
Source file CIOBLOFF.ASM ASM equiv BLINK_OFF
_blink_on(); /* turn blink on */
blink_on(); /* turn blink on */
Source file CIOBLON.ASM ASM equiv BLINK_ON
_bold_off(); /* turn bold off */
bold_off(); /* turn bold off */
Source file CIOBOFF.ASM ASM equiv BOLD_OFF
_bold_on(); /* turn bold on */
_cput_str("Bold on...");
#include <inline.h>
{
char str[] = "Bold on...";
...
bold_on();
lea si,str
cput_str(); /* display message */
...
}
Source file CIOBON.ASM ASM equiv BOLD_ON
_cput_str("Press a key to wake me up: ");
while (!_ccheck_key());
... /* wait */
_cput_str("\n\rSo soon?!");
...
#include <inline.h>
...
label_010:
ccheck_key();
jnelabel_010 /* loop while no key press ...*/
/* fall through on keypress */
...
Source file _CIOCHKY.ASM ASM equiv CCHECK_KEY
...
if (_ccheck_key());
_cflush_keys(); /* clear keyboard buffer */
else
_cput_str("No keys were waiting");
...
(C Interface Recommended)
Source file CIOFLKEY.ASM ASM equiv CFLUSH_KEYS
{
int ch, extended = 0;
ch = _cget_chr(); /* get chr from kbd */
if (!ch) /* if 0, get next chr */
extended = _cget_chr();
if (extended)
_cput_str("Extended character");
else
_cput_str("Not an extended character");
...
}
(C Interface Recommended)
Source file _CIOGCHR.ASM ASM equiv CGET_CHR
{
int chr;
...
switch (_cget_chra(&chr))/* get chr from kbd */
{
case 0:_cput_str("Normal character"); break;
case 1:_cput_str("ALT-keypad character"); break;
case -1:_cput_str("Extended character"); break;
}
...
}
#include <inline.h>
{
...
cget_chr(); /* AL reg = character */
ja do_alt_chr/* process ALT-keypad chars */
jb do_ext_chr/* go process extended chars */
to_upper(); /* AL = uppercase if alpha */
cput_chr(); /* output normal characters */
jmp short done
do_alt_chr: /* process ALT-keypad chars */
...
jmp short done
do_ext_chr: /* process extended chars */
...
done:
...
}
Source file _CIOGCHA.ASM ASM equiv CGET_CHR
{
int chr;
...
switch (_cget_chrae(&chr))/* get chr from kbd */
{
case 0:_cput_str("Normal character"); break;
case 1:_cput_str("ALT-keypad character"); break;
case -1:_cput_str("Extended character"); break;
}
...
}
#include <inline.h>
{
cget_chre(); /* AL reg = echoed character */
ja do_alt_chr/* process ALT-keypad chars */
jb do_ext_chr/* go process extended chars */
to_upper(); /* AL = uppercase if alpha */
... /* process normal characters */
jmp done
do_alt_chr: /* process ALT-keypad chars */
...
jmp done
do_ext_chr: /* process extended chars */
...
done:
...
}
Source file _CIOGCAE.ASM ASM equiv CGET_CHRE
{
int chr, extended=0;
...
chr = _cget_chre();/* get chr from kbd */
if (!chr) /* if 0, get next chr */
extended = _cget_chre();
if (extended)
_cput_str(" Extended character");
else
_cput_str(" Not an extended character");
...
}
#include <inline.h>
{
int chr;
char *str;
...
chr = cget_chre();
jnealt_chr /* is it normal? */
str = "Normal character"; /* y: set display string */
jmp short done /* go output string */
alt_chr:
jb ext_chr /* is it ALT-keypad? */
str = "ALT-keypad character";/* y: set display string */
jmp short done /* go output string */
ext_chr: /* n: must be extended */
str = "Extended character";
done:
mov si,str /* SI = offset of "string" */
cput_str(); /* display character type */
...
}
Source file _CIOGCHE.ASM ASM equiv CGET_CHRE
{
char strbuf[83], *str;
...
_cput_str ("Enter a string: ");
strbuf[0] = 81;
intbuf[4];
str = _cget_s(strbuf);/* get input from keyboard */
_put_newline();
_cput_str(str); /* display input */
_cput_str("\n_cget_s read ");
_cput_str(_i_to_dec(strbuf[1], intbuf));
_cput_str("chars.");
...
}
(Not applicable)
Source file _CIOGS.ASM ASM equiv CGET_STR
{
char strbuf[81], *sptr;
_console_init();
_cput_str("Enter a string: ");
sptr = _cget_str(strbuf, 80);
_cput_str("\n\r The string was: ");
_cput_str(sptr); /* display string */
_cput_newline();
_cput_str (strbuf); /* display string */
...
}
#include <inline.h>
{
char strbuf[20001];
char prompt[] = "Enter a string: ";
...
console_init();
lea si,prompt/* SI = offset of prompt */
cput_str(); /* display prompt */
lea si,strbuf/* DI = offset of strbuf */
mov cx,20000/* CX = max chars to read */
cget_str(); /* get input from keyboard */
cput_newline(); /* "\n\r" */
cput_str(); /* display input string */
...
}
Source file _CIOGSTR.ASM ASM equiv CGET_STR
{
int cols, rows;
char intbuf[10];
...
_cput_str("\n\rEnter number of columns to display: ");
cols = _dec_to_i(_cget_str(intbuf, 5), &strindx);
_cput_str("\n\rEnter number of rows to display: ");
rows = _dec_to_i(_cget_str(intbuf, 5), &strindx);
if(_chk_dimens(cols, rows) == -1);
_cput_str("Requested dimens are not supported by adapter.");
...
}
#include <inline.h>
{
char cols, rows;
char intbuf[10], *str;
...
str = "Enter number of columns to display: ";
mov si,str /* SI = str pointer */
cput_str();
mov cl,3 /* CL = maximum chars to get */
lea si,intbuf /* SI = offset of intbuf */
cget_str();
dec_to_c(); /* display columns selection */
mov cols,al /* save requested columns */
str = "Enter number of rows to display: ";
mov si,str
cput_str();
mov cl,3
lea si,intbuf
cget_str();
dec_to_c();
mov ah,cols
xchgal,ah /* AL = cols, AH = rows */
chk_dimens(); /* determine if dimensions are supported */
...
}
Source file _CIOCDMS.ASM
ASM equivâ
...
_cput_str("Clear this string");
_goto_left();/* goto beginning of string */
if (_cget_chr()==0)/* when ready... */
_cget_chr();
_clr_eol(); /* clear to end of line */
...
#include <inline.h>
char string[] = "Clear this string";
...
leasi,string
put_str();
goto_left(); /* goto beginning of string */
if (_cget_chr()==0)/* when ready... */
_cget_chr();
clr_eol(); /* clear to end of line */
...
Source file CIOCLRE.ASM ASM equiv CLR_EOL
...
_cput_str("Clear this line");
...
_clr_line(); /* clear entire line */
...
{
char string[] = "Clear this line";
...
lea si,string
put_str();
...
clr_line();/* clear entire line */
...
}
Source file CIOCLRL.ASM ASM equiv CLR_LINE
_cput_str(".......Clear first 7 characters of this string");
_goto_left(); /* cursor on left most margin */
_clr_n (7); /* clear ten spaces */
...
#include <inline.h>
{
char str[] = ".......Clear first 7 character of string");
...
lea si,str
_cput_str();
goto_left(); /* cursor on left most margin */
mov cl,10 /* CL = num spaces to clr */
clr_n(); /* clear up to n spaces */
...
}
Source file _CIOCLRN.ASM ASM equiv CLR_N
...
_cput_str("Since no windowing or regions are active,
clr the screen");
if (_cget_chr()==0)/* wait for user command! */
_cget_chr();
_clr_region();/* clear region */
...
{
char string[] = "Since no windowing or regions are active,\
clear the screen";
...
if (_cget_chr()==0)/* wait for user command! */
_cget_chr();
clr_region();
...
}
Source file CIOCLRR.ASM ASM equiv CLR_REGION
_console_init();/* initialize SA console I/O */
_cput_str("Console I/O initialized");
/* note: use _cput_... _cget_... functions */
{
char str[] = "Console I/O initialized";
...
console_init();
lea si,str
cput_str();
...
}
Source file CIOCINIT.ASM ASM equiv CONSOLE_INIT
_cput_attr(WHITE+(16*BLUE));/* put white on blue attr */
#include <inline.h>
mov ah,(WHITE+(16*BLUE));/* AH = white/blue attr */
cput_attr();/* put chosen attr to the display */
Source file _CIOPATR.ASM ASM equiv CPUT_ATTR
_cput_beep(); /* Sound beep */
cput_beep(); /* Sound beep */
Source file CIOPBEEP.ASM ASM equiv CPUT_BEEP
{
...
_cput_chr(177); /* display '±' */
...
}
#include <inline.h>
mov al,177 /* AL = character to display */
cput_chr(); /* display character in AL */
Source file _CIOPCHR.ASM ASM equiv CPUT_CHR
_cput_chri (0x25);/* display 0x25 character (%) */
#include <inline.h>
mov al,0x25 /* AL = character to display */
cput_chri(); /* display (%) character */
Source file _CIOPCHI.ASM ASM equiv CPUT_CHRI
_cput_linefeed(); /* advance cursor down to next line */
cput_linefeed(); /* advance cursor down to next line */
Source file CIOPLINE.ASM ASM equiv CPUT_LINEFEED
_cput_nattr (WHITE+(16*RED),10); /* put 10, WHITE/RED attrs */
#include <inline.h>
mov ah,(WHITE+(16*RED)) /* AH = WHITE on RED attr */
mov cl,10 /* CL = times to write attr */
cput_nattr(); /* put attr n times to display */
Source file _CIOPNTR.ASM ASM equiv CPUT_NATTR
_cput_nchr('±',80);/* output a line of shades */
#include <inline.h>
mov al,177/* AL = character to write */
mov cl,80/* CL = number of times to write char */
cput_nchr();/* display a line of ± characters */
Source file _CIOPNCH.ASM ASM equiv CPUT_NCHR
_cput_nchri(0x07,10); /* 10 BEEP characters w/o interpreting */
/* ... i.e., w/o beeping */
#include <inline.h>
mov al,0x07 /* AL = char to display */
mov cl,10 /* CL = num of time to display */
cput_nchri(); /* BEEP n times */
Source file _CIOPNCI.ASM ASM equiv CPUT_NCHRI
_cput_newline();
_cput_str("begin again");
#include <inline.h>
{
char str[] = "begin again";
...
cput_newline();
lea si,str
cput_str();
...
}
Source file CIOPLINE.ASM ASM equiv CPUT_NEWLINE
_cput_return();
_cput_str ("return to left-most column");
#include <inline.h>
{
char *str = "return to left-most column";
...
cput_return();
mov si,str
cput_str();
...
}
Source file CIOGLEFT.ASM ASM equiv CPUT_RETURN
_cput_str("Display this string.");
#include <inline.h>
{
char string[] = "Display this string.";
...
lea si,string/* SI = offset of string */
cput_str(); /* display string */
...
}
Source file _CIOPSTR.ASM ASM equiv CPUT_STR
_cput_strci ("Center this string w/o interpreting...",80);
#include <inline.h>
{
char string[] = "Center this string w/o interpreting...";
...
lea si,string/* SI = offset of string */
mov cl,80 /* CL = width of region */
cput_strci(); /* display centered string */
...
}
Source file _CIOPSCI.ASM ASM equiv CPUT_STRCI
#define BEEP = "\x07"
...
_cput_stri("Display this string w/o interpreting: BEEP");
#include <inline.h>
{
char string[] = "Display this string, don't interpret: \n\r";
...
lea si,string
cput_stri();/* display uninterpreted string */
...
}
Source file _CIOPSTI.ASM ASM equiv CPUT_STRI
_cput_strji("Right justify this string...",80);
#include <inline.h>
{
char string[] = "Right justify string w/o interpreting...";
...
lea si,string/* SI = offset of string */
mov cl,80 /* CL = width of region */
cput_strji(); /* display right justified str */
...
}
Source file _CIOPSJI.ASM ASM equiv CPUT_STRJI
{
_cput_str("Hide cursor ");
if (_cget_chr()==0)/* when ready... */
_cget_chr();
_cursor_off();/* ...turn cursor off */
...
}
{
char string[] = "Hide cursor";
...
if (_cget_chr()==0)/* when ready... */
_cget_chr();
cursor_off();/* ...turn cursor off */
...
}
Source file CIOCOFF.ASM ASM equiv CURSOR_OFF
{
_cput_str("Turn hardware cursor on ");
if (_cget_chr()==0) /* when ready... */
_cget_chr();
_cursor_on(); /* ...turn cursor on */
...
}
(C Interface Recommended)
Source file CIOCON.ASM ASM equiv CURSOR_ON
_del_line();
del_line();
Source file CIOINSL.ASM ASM equiv DEL_LINE
_direc_down(); /* set cursor advance to down */
_cput_str("This is down");/* This is down... */
{
char str[] = "This is down";
...
direct_down(); /* set cursor advance to down */
lea si,str
cput_str(); /* display str by rows */
...
}
Source file CIODIRD.ASM ASM equiv DIREC_DOWN
_direc_left(); /* set cursor advance to left */
_goto_x(10); /* go to tenth column */
_cput_str("Going left");/* tfel gnioG */
{
char str[] = "Going left";
...
lea si,str
direc_left();
mov al,10
goto_x();
cput_str(); /* tfel gnioG */
...
}
Source file CIODIRL.ASM ASM equiv DIREC_LEFT
_direct_right();/* set cursor direction going right */
_cput_str("Normal cursor advance direction -> ");
(Not Applicable)
Source file CIODIRR.ASM ASM equiv DIREC_RIGHT
_direc_up(); /* set cursor advance going up */
...
_cput_str("Going up"); /* Direction is vertical */
(Not Applicable)
Source file CIODIRU.ASM ASM equiv DIREC_UP
{
unsigned char chr;
chr = '±';
_fill_eol (chr, (WHITE+(16*BLUE)));
/* fill using chosen character and attribute */
...
}
#include <inline.h>
...
mov al,177 /* AL = fill character */
mov ah,(WHITE+(16*BLUE))/* AH = fill attribute */
fill_eol(); /* use '±' and white/blue attr */
...
Source file _CIOFLLE.ASM ASM equiv FILL_EOL
_fill_line('±',(WHITE+(16*BLUE)));
/* use '±' chrs and white on blue attrs */
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))/* AH = fill attribute */
mov al,177 /* AL = fill character */
fill_line();
...
Source file _CIOFILL.ASM ASM equiv FILL_LINE
_fill_n('°',(WHITE+(16*BLUE)),10);
/* use '±' chr and white on blue for next ten columns
of current line */
...
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))/* AH = fill attribute */
mov al,177 /* AL = ± fill character */
mov cl,10 /* CL = num characters to fill */
fill_n();
...
Source file _CIOFILN.ASM ASM equiv FILL_N
_fill_region ('±',(WHITE+(16*BLUE)));
/* use '±' for chr and white on blue attribute */
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))/* AH = fill attribute */
mov al,177 /* AL = fill character */
fill_region();
...
Source file _CIOFILR.ASM ASM equiv FILL_REGION
{
int adapter;
adapter = _get_adapter();
switch(adapter)
{
case MDA: _cput_str("MDA"); break;
case CGA: _cput_str("CGA"); break;
case EGA: _cput_str("EGA"); break;
case MCGA: _cput_str("MCGA"); break;
case VGA: _cput_str("VGA"); break;
default: break;
}
...
}
(C Interface Recommended)
Source file CIOGADP.ASM ASM equiv GET_ADAPTER
{
char padapter, pmonitor, sadapter, smonitor, adapter;
int i;
...
_get_adapters(&padapter, &pmonitor, &sadapter, &smonitor);
_cput_str("Primary Adapter type: ");
adapter = padapter;
for(i = 0; i < 2; i++)
{
switch(adapter)/* secondary adapter types */
{
case MDA: _cput_str("Monochrome Display Adapter");
break;
case VGA: _cput_str("Video Graphics Array"); break;
...
}
_cput_str("\n\rSecondary Adapter type: ");
adapter = sadapter;
if(padapter = -1)
break;
}
...
}
#include <inline.h>
{
char padapter, pmonitor, sadapter, smonitor;
char *str;
...
get_adapters();
str = "Primary Adapter type: ";
mov si,str
cput_str();
adapt_010:
cmp al,MDA
jneadapt_020
str = "Monochrome Display Adapter";
adapt_020:
cmp al,VGA
jneadapt_030
str = "Video Graphics Array";
adapt_030:
... /* test all types */
adapt_070:
cput_str(); /* display adapter type */
mov al,dl
inc dl /* secondary adapter present? */
jnzadapt_080/* n: type(s) determined */
str = "\n\rSecondary Adapter type: ";
cput_str();
jmp adapt_010/* y: secondary adapter */
...
adapt_080
...
}
Source file _CIOGAPS.ASM ASM equiv GET_ADAPTERS
{
saadapt adapt1_info, adapt2_info;
...
if(_get_adaptinfo(ADAPT_1, &adapt1_info))
_cput_str("Primary adapter type and state determined.");
else
_cput_str("Primary Adapter not present.");
if(_get_adaptinfo(ADAPT_2,&adapt2_info))
_cput_str("Secondary Adapter type and state determined.");
else
_cput_str("Secondary Adapter not present.");
...
}
#include <inline.h>
{
saadapt adapt1_info, adapt2_info;
char *str;
... /* initialize console i/o */
mov al,ADAPT_1
get_adaptinfo();
jc adapt_010
mov adapt1_info.vmode,al /* save adapter info */
mov adapt1_info.vpage,ah
mov adapt1_info.cols,dl
mov adapt1_info.rows,dh
mov adapt1_info.dflags,cl
mov adapt1_info.pagecnt,ch
str = "Primary adapter type and state determined.";
jmp short adapt_020
adapt_010:
str = "Primary Adapter not present.";
adapt_020:
mov si,str
cput_str(); /* display adapter 2 status */
mov al,ADAPT_2
get_adaptinfo();
jc adapt_030
mov adapt2_info.vmode,al /* save adapter info */
mov adapt2_info.vpage,ah
mov adapt2_info.cols,dl
mov adapt2_info.rows,dh
mov adapt2_info.dflags,cl
mov adapt2_info.pagecnt,ch
str = "Secondary adapter type and state determined.";
jmp short adapt_040
adapt_030:
str = "Secondary Adapter not present.";
adapt_040:
mov si,str
cput_str(); /* display adapter 1 status */
...
}
Source file _CIOGADN.ASM ASM equiv GET_ADAPTINFO
{
int attr;
attr = _get_attr();
...
}
#include <inline.h>
{
int attr;
get_attr();/* AH = current text attribute */
xor al,al
mov attr,ax
...
}
Source file _CIOGATR.ASM ASM equiv GET_ATTR
{
char attrflag;
attrflag = _get_attrflags();
switch(attrflag)
{
case BOLD: _cput_str("Bold bit enabled"); break;
case BKBOLD: _cput_str("Blink/Bkbold bit enabled"); break;
}
...
}
(C Interface Recommended)
Source file CIOGATRF.ASM ASM equiv GET_ATTRFLAGS
{
unsigned curstype;
int state;
curstype = _get_cursor(&state);
if (state == 1)
_set_cursor(curstype); /* if cursor is on, set it;
otherwise, just save shape */
...
}
#include <inline.h>
{
unsigned curstype;
...
curstype = get_cursor();/* AX = cursor type */
jnelabel_100 /* is cursor on? */
set_cursor(); /* y: set cursor type */
label_100:
...
}
Source file _CIOGCUR.ASM ASM equiv GET_CURSOR
{
int dattr;
dattr = _get_dattr(); /* get default attribute */
...
}
#include <inline.h>
{
int dattr;
...
get_dattr(); /* AH = default attribute */
xor al,al
mov dattr,ax/* load C variable */
...
}
Source file _CIOGDTR.ASM ASM equiv GET_DATTR
{
char cols, rows;
char intbuf[10];
...
_get_dimens(&cols, &rows);
_cput_str("Number of columns: ";
_cput_str(_c_to_dec(cols, intbuf));
_cput_str("Number of rows: ";
_cput_str(_c_to_dec(rows, intbuf));
...
_cput_str("Number of columns: ";
_cput_str(_c_to_dec(cols, intbuf));
_cput_str("Number of rows: ";
_cput_str(_c_to_dec(rows, intbuf));
...
}
#include <inline.h>
{
char cols, rows;
char intbuf[10], *str;
...
get_dimens(); /* AL = cols, AH = rows */
mov cols,al
mov rows,ah /* load variables */
str = "Number of columns: ";
mov si,str /* SI = str */
cput_str(); /* display string */
lea si,intbuf/* SI = offset intbuf */
mov al,cols /* AL = columns */
c_to_dec();
cput_str(); /* display number of columns */
str = "Number of rows: ";
mov si,str /* SI = str */
cput_str();
lea si,intbuf
mov al,rows /* AL = rows */
c_to_dec();
cput_str(); /* display number of rows */
...
}
Source file _CIOGDMS.ASM ASM equiv GET_DIMENS
if(_get_direction() != ADV_RIGHT)
_set_direction(ADV_RIGHT);
...
#include <inline.h>
...
get_direction();/* AX = current direction */
cmp ax,ADV_RIGHT/* is it "right"? */
jnesdrc_010/* y: continue */
mov ax,ADV_RIGHT
set_direction();/* n: set to "right" */
sdrc_010:
...
Source file CIOGDIR.ASM ASM equiv GET_DIRECTION
{
char dmode;
...
dmode = _get_dmode();
switch (dmode)
{
case MONO2:_put_str("Monochrome, blink enabled"); break;
case MONO4:_put_str("Monochrome, high intensity\
background, no blink"); break;
case BW2:_put_str("Black/white, blink enabled"); break;
case BW4:_put_str("Black/white, high intensity\
background, no blink"); break;
case COLOR8:_put_str("Color, 8 background colors, blink\
enabled"); break;
case COLOR16:_put_str("Color, 16 background colors, no\
blink"); break;
case GRAY8:_put_str("Gray scale, 8 shades, blink\
enabled"); break;
case GRAY16: _put_str("Gray scale, 16 shades, no blink");
break;
default: break;
};
...
}
(C Interface Recommended)
Source file CIOGDMOD.ASM ASM equiv GET_DMODE
{
int keyf;
char buf[5];
keyf = _get_keyflags();
_cput_str("\nKeyflags: ");
_cput_str(_uc_to_dec(keyf, buf));
...
}
(C Interface Recommended)
Source file CIOGKEYF.ASM ASM equiv GET_KEYFLAGS
{
char row,col,hght,wdth;
_get_region (&row, &col, &hght, &wdth);
row++; /* inc starting row position */
col++; /* inc starting column position */
_set_region(row,col,hght,wdth);
/* smaller region by one row and one column */
...
}
#include <inline.h>
{
char row,col,hght,wdth;
...
get_region();
mov row,dh/* row = starting row coordinate */
mov col,dl/* col = starting column coordinate */
mov hght,ah /* hght = height in rows */
mov wdth,al /* wdth = width in columns */
...
}
Source file _CIOGREG.ASM ASM equiv GET_REGION
{
...
char attrtbl[] = {0x17, 0x47}; /* white/blue, white/red */
int attr;
_set_attrtbl(attrtbl);
...
attr = _get_tblattr(0);/* find first attr in tbl */
...
}
#include <inline.h>
{
char attr;
char attrtbl[] = {0x17, 0x47}; /* white/blue, white/red */
...
lea ax,attrtbl/* AX = offset of attr tbl */
set_attrtbl();
mov ah,0 /* AH = attrtbl[0](white/blue) */
get_tblattr(); /* AH = attr code from attrtbl */
mov attr,ah /* load C variable */
...
}
Source file _CIOGTTR.ASM ASM equiv GET_TBLATTR
{
char attr, state;
attr=_get_vborder(&state); /* get video border color/state */
if (state == 1) /* is border on? */
_cput_str("Border is currently on.");
else
_cput_str("Border is currently off.");
...
}
#include <inline.h>
{
char *str;
char attr;
...
get_vborder();/* get video border color and state */
mov attr,ah/* save border attribute */
jne label_100/* is border on? */
str = "Border is currently on.";
jmp short label_200
label_100:
str = "Border is currently off.";
label_200:
mov si,str
cput_str();
...
}
Source file _CIOGVBD.ASM ASM equiv GET_VBORDER
...
switch (_get_vmode())
{
case BW40:_put_str("40X25 text mode, color burst off");
break;
case CO40:_put_str("40X25 text mode"); break;
case BW80:_put_str("80X25 text mode, color burst off");
break;
case CO80:_put_str("80X25 text mode"); break;
...
default: break;
};
...
(C Interface Recommended)
Source file CIOGVMOD.ASM ASM equiv GET_VMODE
#include<console.h>
{
char intbuf[10];
...
_cput_str("Active video page: ");
_cput_str(_i_to_dec(_get_vpagecnt(), intbuf));
...
}
#include <inline.h>
{
char intbuf[10];
char *str = "Active video page: ";
...
mov si,str /* SI = offset of str */
cput_str();
get_vpagecnt(); /* AL = active video page */
lea si,intbuf/* SI = offset of intbuf */
c_to_dec(); /* convert page to ASCII */
cput_str(); /* display page number */
...
}
Source file CIOGVPGC.ASM ASM equiv GET_VPAGECNT
{
vstat v1;
...
_get_vstate(&v1); /* save state of active display adapter */
...
}
#include <inline.h>
{
vstat v1;
...
pushss
pop es
lea di,v1 /* ES:DI -> buffer */
get_vstate(); /* save state of active display adapter */
...
}
Source file _CIOGVST.ASM ASM equiv GET_VSTATE
...
_goto_bottom();/* go to bottom of screen or
clipping region */
_goto_left();
_cput_str("<- Lower left corner");
...
(C Interface Recommended)
Source file CIOGBOT.ASM ASM equiv GOTO_BOTTOM
...
_goto_end();
_cput_str("Bottom, right, corner...");
...
(C Interface Recommended)
Source file CIOGEND.ASM ASM equiv GOTO_END
...
_goto_home();
_cput_str ("in upper left-hand corner");
...
(C Interface Recommended)
Source file CIOGHOME.ASM ASM equiv GOTO_HOME
...
_goto_left();
_cput_str ("left-most column");
...
(C Interface Recommended)
Source file CIOGLEFT.ASM ASM equiv GOTO_LEFT
...
_goto_right();
...
(C Interface Recommended)
Source file CIOGRGHT.ASM ASM equiv GOTO_RIGHT
...
_goto_top();
_cput_str("top row");
...
(C Interface Recommended)
Source file CIOGTOP.ASM ASM equiv GOTO_TOP
...
_goto_x (5); /* move cursor to column 5 */
...
#include <inline.h>
...
mov al,5 /* AL = xpos */
goto_x(); /* move cursor to column 5 */
...
Source file _CIOGX.ASM ASM equiv GOTO_X
...
_goto_xy(5,10);/* goto column 5, row 10 */
...
#include <inline.h>
...
mov al,5 /* AL = xpos */
mov ah,10 /* AH = ypos */
goto_xy(); /* got column 5, row 10 */
...
Source file _CIOGXY.ASM ASM equiv GOTO_XY
...
_goto_y (5); /* place cursor on row five */
...
#include <inline.h>
...
mov ah,5 /* AH = new ypos */
goto_y(); /* place cursor on row five */
...
Source file _CIOGY.ASM ASM equiv GOTO_Y
{
char top, left, height, width;
char *workbuf;
int nbytes, handle;
...
workbuf = (char *)malloc(260);
_lseekbof(handle);
if(_hread_textattr(handle, workbuf, 260, 0, 0,
10, 80, &nbytes) != 0)
_cput_str("Text and attrs not successfully saved!");
...
}
#include <console.h>
{
char *workbuf, *str;
int handle;
... /* open up a file for saving screen */
workbuf = (char *)malloc(4000);
mov bx,handle
mov si,workbuf
mov cx,256
lseekbof();
xor dx,dx /* origin 0,0 */
mov ah,10 /* AH = number of rows */
mov al,80 /* AL = number of cols */
hread_textattr();
je hrdtxt_010
str = "Text and attrs not successfully saved!";
mov si,str
cput_str();
hrdtxt_010:
...
}
Source file _CIOHRTX.ASM ASM equiv HREAD_TEXTATTR
{
char *workbuf;
int nbytes, handle;
...
workbuf = (char *)malloc(256);
_lseekbof(handle);
if (_hrestore_screen(handle, workbuf, 256, &nbytes) != 0)
_cput_str("Error restoring screen and video state!");
...
}
#include <inline.h>
{
char *workbuf, *str;
int handle;
... /* open up a file for saving screen */
workbuf = (char *)malloc(256);
mov bx,handle
mov si,workbuf
mov cx,256
lseekbof();
hrestore_screen();
je hrsscr_010
str = "Error restoring screen and video!";
mov si,str
cput_str();
hrsscr_010:
...
}
Source file _CIOHRSC.ASM ASM equiv HRESTORE_SCREEN
#include<console.h>
{
char *workbuf;
int nbytes, handle;
...
workbuf = (char *)malloc(256);
_lseekbof(handle);
if(_hsave_screen(handle, workbuf, 256, &nbytes) != 0)
_cput_str("Screen and video state not successfully saved!");
...
}
#include <inline.h>
{
char *workbuf, *str;
int handle;
... /* open up a file */
workbuf = (char *)malloc(256);
mov bx,handle
mov si,workbuf
mov cx,256
lseekbof();
hsave_screen();
je hsvscr_010
str = "Screen and video state not successfully saved!";
mov si,str
cput_str();
hsvscr_010:
...
}
Source file _CIOHSSC.ASM ASM equiv HSAVE_SCREEN
#include<console.h>
{
char top, left, height, width;
char *workbuf;
int nbytes, handle;
...
workbuf = (char *)malloc(260);
_lseekbof(handle);
if(_hwrite_textattr(handle, workbuf, 260, 0, 0, 10,
80, &nbytes) != 0)
_cput_str("Text and attrs not successfully\
written to display!");
...
}
#include <inline.h>
{
char *workbuf, *str;
int handle;
... /* open up a file for saving screen */
workbuf = (char *)malloc(4000);
mov bx,handle
mov si,workbuf
mov cx,256
lseekbof();
xor dx,dx /* origin 0,0 */
mov ah,10 /* AH = number of rows */
mov al,80 /* AL = number of cols */
hwrite_textattr();
je hwrtxt_010
str = "Text and attrs not written to display!";
mov si,str
cput_str();
hwrtxt_010:
...
}
Source file _CIOHWTX.ASM ASM equiv HWRITE_TEXTATTR
_ins_line();
(C Interface Recommended)
Source file CIOINSL.ASM ASM equiv INS_LINE
if (_is_cga) /* is this a CGA compatible? */
_cput_str("Adapter is CGA compatible");
else
_cput_str("Adapter is not CGA compatible");
...
#include <inline.h>
{
char yes_cga[] = "Adapter is CGA compatible";
char not_cga[] = "Adapter is not CGA compatible";
...
is_cga(); /* is adapter CGA compatible? */
jnecga_100 /* n: display "not" string */
lea si,yes_cga/* SI = offset of is_cga */
jmp short cga_200/* continue w/o exiting */
cga_100:
lea si,not_cga/* SI = offset of not_cga */
cga_200:
cput_str(); /* display message string */
...
}
Source file _CIOICGA.ASM ASM equiv IS_CGA
{
if (_is_ega)/* is adapter EGA or VGA? */
_cput_str("Adapter is EGA compatible");
else
_cput_str("Adapter is not EGA compatible");
...
}
#include <inline.h>
{
char yes_ega[] = "Adapter is EGA compatible";
char not_ega[] = "Adapter is not EGA compatible";
...
is_ega(); /* is adapter EGA or VGA? */
jnelabel_100/* n: display "not" string */
lea si,yes_ega/* SI = offset of is_ega */
cput_str(); /* display string */
jmp short label_200/* continue (compatible) */
label_100:
lea si,not_ega/* SI = offset of not_ega */
cput_str(); /* display string */
exit(0); /* exit (incompatible) */
label_200:
...
}
Source file _CIOIEGA.ASM ASM equiv IS_EGA
...
if (_is_enkbd)/* enhanced keyboard? */
_cput_str("Keyboard is an enhanced keyboard");
else
_cput_str("Keyboard is not an enhanced keyboard");
...
#include <inline.h>
{
...
is_enkbd(); /* enhanced keyboard? */
jnelabel_100/* n: normal keyboard */
/* ... enhanced keyboard routines ...*/
jmp short label_200/* when done jump to label_200 */
label_100:
/* ... normal keyboard routines ...*/
label_200:
... /* continue execution here... */
}
Source file _CIOINKB.ASM ASM equiv IS_ENKBD
if (_is_mcga())/* is adapter MCGA? */
_cput_str("Adapter is MCGA compatible");
else
_cput_str("Adapter is not MCGA compatible");
...
#include <inline.h>
{
char *str;
...
is_mcga(); /* is adapter MCGA? */
jnelabel_100/* y: display next string */
str = "Adapter is MCGA compatible";
mov si,str /* DS:SI -> str */
cput_str();
jmp short label_out/* continue (compatible) */
label_100: /* if jumped here, not MCGA? */
str = "Adapter is not MCGA compatible";
mov si,str /* DS:SI -> str */
cput_str(); /* display string */
exit(0); /* exit (incompatible) */
label_out:
...
}
Source file _CIOIMCG.ASM ASM equiv IS_MCGA
if (_is_mda) /* is adapter MDA? */
_cput_str("Adapter is MDA compatible");
else
_cput_str("Adapter is not MDA compatible");
...
#include <inline.h>
{
char *str;
...
is_mda(); /* is adapter MDA? */
jne label_100 /* n: display "not" string */
str = "Adapter is MDA compatible";
mov si,str /* DS:SI -> str */
cput_str();
jmp short label_200/* continue (compatible) */
label_100:
str = "Adapter is not MDA compatible";
mov si,str /* DS:SI -> str */
cput_str();
exit(0); /* exit (incompatible) */
label_200: /* continue execution here... */
...
}
Source file _CIOIMDA.ASM ASM equiv IS_MDA
{
...
if(textmode())
_cput_str("Display mode is in text mode.");
...
}
#include <inline.h>
{
char str[] = "Display mode is in text mode.";
...
textmode(); /* in textmode? */
jnetxtmode_010/* n: non-text mode */
leasi,str
cput_str(); /* display string */
txtmode_010:
...
}
Source file _CIOISTX.ASM ASM equiv IS_TEXTMODE
if (_is_vga)
_cput_str("Adapter is VGA compatible");
else
_cput_str("Adapter is not VGA compatible");
...
#include <inline.h>
{
char *str;
...
is_vga(); /* is adapter VGA? */
jnelabel_err/* n: exit with errmsg */
... continue with program ...
jmp label_ok/* jump to quit when finished */
label_err:
str = "Incompatible adapter, requires VGA adapter.";
mov si,str /* SI = offset of message */
cput_str(); /* display err message */
label_ok:
exit(0);
}
Source file _CIOIVGA.ASM ASM equiv IS_VGA
_console_init();/* initialize SA console I/O */
_kbd_init();
if (kbd_type == ENHANCED_KBD)
_cput_str("Enhanced keyboard present.");
else
_cput_str("Normal keyboard detected.");
...
#include <inline.h>
{
char *str;
console_init();
kbd_init();
cmp kbd_type,ENHANCED_KBD
jne
str = "Enhanced keyboard present.";
jmp label_020
label_010:
str = "Normal keyboard detected.";
label_020:
mov si,str
put_str();
...
}
Source file CIOKINIT.ASM ASM equiv KBD_INIT
{
int i;
char ch;
ch = 'a';
for(i=0; i < 26; i++)/* do alphabet in same space */
{
_cput_chr(ch);
_sleep_sec(5);/* sleep between letters */
_move_back();
_sleep_sec(100);
}
...
}
(C Interface Recommended)
Source file CIOMBACK.ASM ASM equiv MOVE_BACK
_move_down();
(C Interface Recommended)
Source file CIOMDOWN.ASM ASM equiv MOVE_DOWN
_move_left();
move_left();
Source file CIOMLEFT.ASM ASM equiv MOVE_LEFT
_move_next();
move_next();
Source file CIOMNEXT.ASM ASM equiv MOVE_NEXT
_move_right();
move_right();
Source file CIOMRGHT.ASM ASM equiv MOVE_RIGHT
_move_textattr(0,0,40,25,40,0);
/* move left half of screen to right half */
#include <inline.h>
...
mov dl,0 /* DL = srcleft */
mov dh,0 /* DH = srctop */
mov al,40 /* AL = width */
mov ah,25 /* AH = height */
mov bl,40 /* BL = dstleft */
mov bh,0 /* BH = dsttop */
move_textattr();
...
Source file _CIOMTXT.ASM ASM equiv MOVE_TEXTATTR
_move_up();
#include <inline.h>
move_up();
Source file CIOMUP.ASM ASM equiv MOVE_UP
{
void *buffer;
if ((buffer = (char *) malloc(2100)) == NULL)
exit(1);/* allocate 2*(width * height) */
_read_textattr(0,0,40,25,buffer);/* read left half of
screen to buffer */
...
}
#include <inline.h>
{
void *buffer;
...
if ((buffer = (char *) malloc(2100)) == NULL)
exit(1);
mov di,buffer/* DI = offset of dest buffer */
mov dl,0 /* DL = srcleft */
mov dh,0 /* DH = srctop */
mov al,40 /* AL = width */
mov ah,25 /* AH = height */
read_textattr();
...
}
Source file _CIORTXT.ASM ASM equiv READ_TEXTATTR
_region_off();
region_off();
Source file CIOREG.ASM ASM equiv REGION_OFF
_region_on();
region_on();
Source file CIOREG.ASM ASM equiv REGION_ON
_rel_xy(15,15); /* move cursor 15 rows and 15 cols
from current position */
#include <inline.h>
{
int xdist = ydist = 15;
...
mov al,xdist/* AL = xdist */
mov ah,ydist/* AH = ydist */
rel_xy(); /* 15 rows and 15 cols relative
to current position */
...
}
Source file _CIORXY.ASM ASM equiv REL_XY
_reset_attr();
reset_attr();
Source file CIORATR.ASM ASM equiv RESET_ATTR
{
void *buffer;
scrbuf_addr = malloc(_screen_bufsize());
_save_screen(buffer);
_restore_screen (buffer);
...
}
#include <inline.h>
{
void *scrbuf_addr; /* global near/far pointer */
...
scrbuf_addr = malloc (_screen_bufsize());
mov di,scrbuf_addr /* DI = offset of buffer */
IF __LARGE_DATA__
mov es,word ptr scrbuf_addr+2
ENDIF
save_screen():
...
IF __LARGE_DATA__
mov es,word ptr scrbuf_addr+2
ENDIF
mov di,scrbuf_addr /* DI = offset of buffer */
restore_screen();
...
}
Source file _CIOSCR.ASM ASM equiv RESTORE_SCREEN
_restore_vstate(); /* restore previously saved video state */
restore_vstate(); /* restore previously saved vstate */
Source file CIOVST.ASM ASM equiv RESTORE_VSTATE
{
void *scrbuf_addr;
scrbuf_addr = malloc(_screen_bufsize());
_save_screen(scrbuf_addr);
...
}
#include <inline.h>
{
void *scrbuf_addr;
...
scrbuf_addr = malloc(screen_bufsize());
#if __LARGE_DATA__
les di,scrbuf_addr/* ES:DI -> scr buffer */
#else
pushds
pop es /* DS=SS (for small models) */
mov di,scrbuf_addr/* DI = offset of scr buffer */
#endif
save_screen();
...
}
Source file _CIOSCR.ASM ASM equiv SAVE_SCREEN
_save_vstate();/* save video state */
save_vstate(); /* save video state */
Source file CIOVST.ASM ASM equiv SAVE_VSTATE
{
void *scrbuf_addr;
if((scrbuf_addr = malloc(_screen_bufsize())) == NULL)
_cput_str("Error allocating screen buffer heap.");
/* use heap space to save screen */
else
_save_screen (scrbuf_addr); /* save the screen */
...
}
(C Interface Recommended)
Source file CIOSCRSZ.ASM ASM equiv SCREEN_BUFSIZE
_scroll_down(10);/* scroll down 10 */
}
#include <inline.h>
mov al,10/* AL = number of lines to scroll */
scroll_down();/* scroll down 10 lines */
...
Source file _CIOSCDN.ASM ASM equiv SCROLL_DOWN
_scroll_up(10);/* scroll up ten rows */
#include <inline.h>
mov al,10/* AL = number of lines to scroll */
scroll_up();/* scroll up ten rows */
...
Source file _CIOSCUP.ASM ASM equiv SCROLL_UP
if (_set_80cols() == 0)
_cput_str("Display was already in 80 column text mode");
else
_cput_str("Display was changed to 80 column text mode");
...
#include <inline.h>
{
char *str;
...
set_80cols(); /* ensure 80 col text mode */
je label_100/* necessary to change modes? */
/* y: display this string */
str = "Display was changed to 80 column text mode";
mov si,str /* SI = offset of str */
cput_str(); /* display message */
label_100:
...
}
Source file _CIOS80.ASM ASM equiv SET_80COLS
...
if(_set_adapter(ADAPT_2) == -1)
_cput_str("\n\rUnable to select secondary adapter.");
...
#include <inline.h>
{
char str[] = "\n\rUnable to select secondary adapter.";
...
mov al,ADAPT_2
set_adapter();
jncadapt_010
lea si,str
cput_str();
adapt_010:
...
}
Source file _CIOSADP.ASM ASM equiv SET_ADAPTER
_set_attr(WHITE+(16*BLUE));/* use WHITE on BLUE attr */
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE))
set_attr(); /* select white/blue attr */
...
Source file _CIOSATR.ASM ASM equiv SET_ATTR
_set_attrflags (BLINK);/* blinking text */
_cput_str("Blinking bit set");
...
#include <inline.h>
{
char str[] = "Bold bit set";
...
mov al,BOLD /* AL = BOLD(def in console.h) */
set_attrflags();/* set current attr flags */
lea si,str /* SI = offset of str */
cput_str(); /* display str */
...
}
Source file _CIOSATF.ASM ASM equiv SET_ATTRFLAGS
{
char table[] = {0x17, 0x47, 0};
/* white/blue, white/red, blue/white */
_set_attrtbl(table);
_set_attr(0);/* select white/blue attr */
_cput_str("White on Blue characters ");
...
_set_attrtbl((char *)-1);/* discard this attr table */
...
}
#include <inline.h>
{
char *str;
char table[] = {0x17, 0x47, 0x31};/* white/blue, white/red,
blue/white */
...
#if __LARGE_DATA__
mov dx,ss
#endif
lea ax,table /* AX = offset of attr table */
set_attrtbl(); /* set custom attr table */
mov ah,1 /* AH = attr code (table[1]) */
set_attr(); /* set attr using table */
str = "White on Red characters";
mov si,str /* SI = offset of str */
put_str(); /* display string */
mov ax,-1
set_attrtbl(); /* discard custom attr table */
...
}
Source file _CIOSATB.ASM ASM equiv SET_ATTRTBL
_set_biosvideo();/* use BIOS for display */
set_biosvideo();/* use BIOS for display */
Source file CIOSBVID.ASM ASM equiv SET_BIOSVIDEO
_set_bkboldmode();
set_bkboldmode();
Source file CIOSBKB.ASM ASM equiv SET_BKBOLDMODE
_set_bkcolor(BLUE);/* set background color to BLUE */
_set_fgcolor(WHITE);/* output now white/blue */
...
#include <inline.h>
...
mov ah,BLUE /* AH = background color */
set_bkcolor();
mov ah,WHITE/* AH = foreground color */
set_fgcolor(); /* output now white/blue */
...
}
Source file _CIOSBKC.ASM ASM equiv SET_BKCOLOR
_set_blinkmode();/* support blinking characters */
set_blinkmode();/* support blinking characters */
Source file CIOSBLNK.ASM ASM equiv SET_BLINKMODE
_set_cursor(BLOCK_CURSOR);/* BLOCK CURSOR */
...
#include <inline.h>
...
mov ax,BLOCK_CURSOR /* BLOCK CURSOR */
set_cursor(); /* set cursor shape */
...
Source file _CIOSCUR.ASM ASM equiv SET_CURSOR
_set_dattr(WHITE+(16*BLUE)); /* white/blue */
...
#include <inline.h>
...
mov ah,(WHITE+(16*BLUE));/* AX = default attr */
set_dattr(); /* set to white/blue */
...
Source file _CIOSDTR.ASM ASM equiv SET_DATTR
{
int cols, rows;
char intbuf[10], *strindx;
...
_cput_str("\n\rEnter number of columns to display: ");
cols = _dec_to_i(_cget_str(intbuf, 5), &strindx);
_cput_str("\n\rEnter number of rows to display: ");
rows = _dec_to_i(_cget_str(intbuf, 5), &strindx);
if(_set_dimens(cols, rows) == -1);
_cput_str("Requested dimensions are not\
supported by adapter.");
...
}
#include <inline.h>
{
char cols, rows;
char intbuf[10], *str;
...
str = "Enter number of columns to display: ";
mov si,str
cput_str();
mov cl,3
lea si,intbuf
cget_str();
dec_to_c();
mov cols,al
str = "Enter number of rows to display: ";
mov si,str
cput_str();
mov cl,3
lea si,intbuf
get_str();
dec_to_c();
mov ah,cols
xchgal,ah /* AL = cols, AH = rows */
set_dimens();
...
}
Source file _CIOSDMS.ASM ASM equiv SET_DIMENS
_set_direction (ADV_RIGHT);/* direction to the right */
...
#include <inline.h>
...
mov ax,ADV_LEFT/* AX=direction */
set_direction(); /* set cursor advance direction */
...
Source file _CIOSDIR.ASM ASM equiv SET_DIRECTION
{
...
if (_set_directvideo() == 0)
_cput_str("Direct video output was selected.");
else
_cput_str("Direct video access could not be selected.");
...
}
#include <inline.h>
{
set_directvideo();/* use direct video? */
jnclabel_ok/* y: continue */
set_biosvideo();/* n: use bios */
label_ok:
...
}
Source file _CIOSDVD.ASM ASM equiv SET_DIRECTVIDEO
_set_fgcolor (BLUE); /* use BLUE as foreground color */
...
#include <inline.h>
...
mov ah,LTMAGENTA/* AH = color for foreground */
set_fgcolor(); /* set foreground color */
...
Source file _CIOSFGC.ASM ASM equiv SET_FGCOLOR
_set_region (0,0,5,10); /* five rows and ten cols */
...
#include <inline.h>
...
mov dh,0 /* DH = row */
mov dl,0 /* DL = col */
mov ah,5 /* AH = hght */
mov al,10 /* AL = wdth */
set_region(); /* set new clipping region */
...
Source file _CIOSREG.ASM ASM equiv SET_REGION
_set_vbordattr(BLUE);/* set video border attr */
...
#include <inline.h>
...
mov ah,RED /* AH = attribute code */
set_vbordattr();/* set video border color */
...
Source file _CIOSVBA.ASM ASM equiv SET_VBORDATTR
_set_vborder(BLUE);
...
#include <inline.h>
...
mov ah,RED /* AH = video border color */
set_vborder(); /* set video border color */
...
Source file _CIOSVBR.ASM ASM equiv SET_VBORDER
_set_vmode (CO40);/* 40x25 text mode */
...
#include <inline.h>
...
mov al,CG320X200X256/* AL = new video mode */
set_vmode(); /* set the video mode */
...
Source file _CIOSVMD.ASM ASM equiv SET_VMODE
{
int vp;
...
vp = _get_vpage();/* get current video page */
vp++; /* adjust page identifier */
_set_vpage(vp);/* select next page */
...
}
#include <inline.h>
{
...
get_vpage(); /* get current video page */
inc al /* adjust page */
set_vpage(); /* select next page */
...
}
Source file _CIOSVP.ASM ASM equiv SET_VPAGE
{
vstat v1;
.../* set up structure for adapter */
if(_set_vstate(&v1) == -1)
_put_str("Specified video state could not be set.");
...
}
#include <inline.h>
{
vstat v1;
char *str;
... /* set up structure buffer for adapter */
pushss
pop es
lea di,v1/* ES:DI -> v1 */
set_vstate();/* save state of active display adapter*/
jnclabel_010
str = "Specified video state could not be set.";
mov si,str
put_str();/* display error message */
label_010:
...
}
Source file _CIOSVST.ASM ASM equiv SET_VSTATE
...
_vborder_off();/* turn video border off */
...
#include <inline.h>
...
vborder_off();
...
Source file CIOVBOFF.ASM ASM equiv VBORDER_OFF
...
_vborder_on();/* turn video border on */
...
#include <inline.h>
...
vborder_on();
...
Source file CIOVBON.ASM ASM equiv VBORDER_ON
{
...
_video_off();/* disable video refresh */
...
}
{
...
video_off();/* disable video refresh */
...
}
Source file CIOVID.ASM ASM equiv VIDEO_OFF
{
...
_video_on();/* enable video refresh */
...
}
#include <inline.h>
{
...
video_on();/* enable video refresh */
...
}
Source file CIOVID.ASM
ASM equivâ
{
int xpos;
xpos = _where_x();
goto_xy (xpos+5,0); /* get current x pos, add five more */
...
}
...
where_x();
add al,5
goto_xy();
...
Source file _CIOWX.ASM ASM equiv WHERE_X
{
int xpos, ypos;
_where_y(&xpos, &ypos);
...
}
{
#include <inline.h>
{
int xpos, ypos;
where_xy();
mov xpos,al
mov ypos,ah
...
}
Source file _CIOWXY.ASM ASM equiv WHERE_XY
{
int ypos;
ypos = _where_y();
...
}
{
int ypos;
where_xy();
mov ypos,ah
...
}
Source file _CIOWY.ASM ASM equiv WHERE_Y
{
void *txtbuf;
txtbuf = malloc(1010);
_read_textattr(0,0,40,25,txtbuf);/* read half scr */
_write_textattr(0,0,40,25,txtbuf);/* replace scr half */
...
}
#include <inline.h>
{
void *txtbuf;
if ((txtbuf = malloc(2100)) == NULL)
exit(1);
...
mov di,txtbuf/* DI = offset of dest buffer */
mov dl,0 /* DL = srcleft */
mov dh,0 /* DH = srctop */
mov al,40 /* AL = width */
mov ah,25 /* AH = height */
read_textattr();/* read text */
...
write_textattr();/* write text */
...
}
Source file _CIOWTXT.ASM ASM equiv WRITE_TEXTATTR