Reference Section
_ctbl_to_iptr {
int array[5] = {10,20,30,40};
int near *pointer;
struct {
int near *array;
int entries;
char tbl[6];
} table = {NULL, 5, "123"};
table.array = (int near *)array;
...
pointer = _ctbl_to_iptr (table.tbl, '3');
...
}
#include <inline.h>
{
int array[5] = {10,20,30,40,50};
struct {
int near *array;
int entries;
char tbl[6];
} table = {NULL, 5, "12345"};
...
table.array = (int near *)array;
lea bx,table.tbl/* DS:BX -> table */
mov al,'3' /* AL = reference char */
ctbl_to_iptr ();/* was char found? */
jc c_to_iptr_010/* n: go continue */
... /* y: handle "not found" */
c_to_iptr_010:
...
}
Source file _TBPTRCI.ASM ASM equiv BTBL_TO_WPTR
{
long int array[5] = {10,20,30,40};
long int near *pointer;
struct {
long int near *array;
int entries;
char tbl[6];
} table = {(long int near *)NULL, 5, "123"};
table.array = (long int near *)array;
...
pointer = _ctbl_to_lptr (table.tbl, '3');
...
}
#include <inline.h>
{
long int array[5] = {10,20,30,40,50};
struct {
long int near *array;
int entries;
char table[6];
} table = {NULL, 5, "12345"};
...
table.array = (long int near *)array;
lea bx,table.table/* DS:BX -> table */
mov al,'3' /* AL = reference char */
ctbl_to_lptr ();/* was char found? */
jc c_to_lptr_010/* n: go continue */
... /* y: handle "not found" */
c_to_lptr_010:
...
}
Source file _TBPTRCL.ASM ASM equiv BTBL_TO_DPTR
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array[5];
struct filestru near *pointer;
struct {
struct filestru near *array;
int entries;
char tbl[6];
} table = {NULL, 5, "123"};
table.array = (struct filestru near *)array;
...
pointer = (struct filestru*)_ctbl_to_ptr (table.tbl, '3',
sizeof (struct filestru));
...
}
#include <inline.h>
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array[5];
int size = sizeof (struct filestru);
struct {
struct filestru near *array;
int entries;
char table[6];
} table = {NULL, 5, "12345"};
...
table.array = (struct filestru near *)array;
lea bx,table.table/* DS:BX -> table */
mov al,'3' /* AL = reference char */
mov cx,size /* CX = element size */
ctbl_to_ptr (); /* was char found? */
jc c_to_ptr_010/* n: go continue */
... /* y: handle "not found" */
c_to_ptr_010:
...
}
Source file _TBPTRC.ASM ASM equiv BTBL_TO_PTR
{
char index;
struct {
int start;
int entries;
char tbl[5];
} table = {'a', 4, "ab"};
...
index = _index_char (table.tbl, 'a');
...
}
#include <inline.h>
{
struct {
int start;
int entries;
char table[5];
} table = {'a', 4, "abcd"};
...
lea bx,table.table/* DS:BX -> table */
mov al,'a' /* AL = char to locate */
index_char (); /* was char found? */
jc dx_char_010/* n: go continue */
... /* y: "not found" condition */
dx_char_010:
...
}
Source file _TBINDC.ASM ASM equiv INDEX_BYTE
{
int index;
struct {
int start;
int entries;
int tbl[5];
} table = {10, 4, 10, 20, 3};
...
index = _index_int (table.tbl, 10);
...
}
#include <inline.h>
{
struct {
int start;
int entries;
int table[5];
} table = {10, 4, {10, 20, 30, 40}};
...
lea bx,table.table/* DS:BX -> table */
mov ax,10 /* AX = int to locate */
index_int (); /* was int found? */
jncdx_int_010/* y: go continue */
... /* n: "not found" */
dx_int_010:
...
}
Source file _TBINDI.ASM ASM equiv INDEX_WORD
{
struct {
int start;
int entries;
char tbl[5];
} table = {'a', 4, "ab"};
if (_is_inctbl (table.tbl, 'a'))
{
...
} else
{
...
}
}
#include <inline.h>
{
struct {
int start;
int entries;
char table[5];
} table = {'a', 4, "abcd"};
...
lea bx,table.table/* DS:BX -> table */
mov al,'a' /* AL = char to locate */
is_inctbl (); /* was char found? */
jc is_inc_010/* n: continue */
... /* y: character located */
is_inc_010:
...
}
Source file _TBCHKC.ASM ASM equiv IS_INBTBL
{
struct {
int start;
int entries;
int tbl[5];
} table = {0,5,10,20,30};
if (_is_initbl (table.tbl, 10))
{
...
} else
{
...
}
}
#include <inline.h>
{
struct {
int start;
int entries;
int table[5];
} table = {0, 5, {10,20,30,40,50}};
...
lea bx,table.table/* DS:BX -> table */
mov ax,10 /* AX = int to locate */
is_initbl (); /* was int found? */
jc is_ini_010/* n: continue */
... /* y: character located */
is_ini_010:
...
}
Source file _TBCHKI.ASM ASM equiv IS_INWTBL
{
struct {
char near *next;
int start;
int entries;
char tbl[5];
} table2 = {(char near *)-1, 'a', 4, "ab"},
table1 = {NULL,'A', 4,"AB"};
table1.next = (char near *)table2.tbl;
if (_is_inxctbl (table1.tbl, 'a'))
{
...
} else
{
...
}
}
#include <inline.h>
{
struct tbl{
char near *next;
int start;
int entries;
char table[5];
};
struct tbl table2 = {(char near *)-1, 'a', 4, "abcd"};
struct tbl table1 = {NULL,'A', 4,"ABCD"};
...
table1.next = (char near *)table2.table;
lea bx,table1.table/* DS:BX -> table */
mov al,'a' /* AL = char to locate */
is_inxctbl (); /* was char found? */
jc is_inxc_010/* n: continue */
... /* y: character located */
is_inxc_010:
...
}
Source file _TBXCHKC.ASM ASM equiv IS_INXBTBL
{
struct table {
int near *next;
int start;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, 0, 5, 10,20,30,};
struct table table1 = {NULL, 0, 5, 11,21,31,};
table1.next = (int near *)table2.tbl;
if (_is_inxitbl (table1.tbl, 10))
{
...
} else
{
...
}
}
#include <inline.h>
{
struct tbl {
int near *next;
int start;
int entries;
int table[5];
};
struct tbl table2 = {(int near *)-1, 0, 5, {10,20,30,40,50}};
struct tbl table1 = {NULL, 0, 5, {11,21,31,41,51}};
...
table1.next = (int near *)table2.table;
lea bx,table1.table/* DS:BX -> table */
mov ax,10 /* AX = int to locate */
is_inxitbl (); /* was int found? */
jc is_inxi_010/* n: continue */
... /* y: character located */
is_inxi_010:
...
}
Source file _TBXCHKI.ASM ASM equiv IS_INXWTBL
{
int array[5] = {10,20,30,40};
int near *pointer;
struct {
int near *array;
int entries;
int tbl[5];
} table = {NULL, 5, {11,12,13,};
table.array = (int near *)array;
...
pointer = _itbl_to_iptr (table.tbl, 11);
...
}
#include <inline.h>
{
int array[5] = {10,20,30,40,50};
struct {
int near *array;
int entries;
int table[5];
} table = {NULL, 5, {11,12,13,14,15}};
...
table.array = (int near *)array;
lea bx,table.table/* DS:BX -> table */
mov ax,11 /* AX = reference int */
itbl_to_iptr ();/* was int found? */
jc i_to_iptr_010/* n: continue */
... /* y: character located */
i_to_iptr_010:
...
}
Source file _TBPTRII.ASM ASM equiv WTBL_TO_WPTR
{
long int array[5] = {10,20,30,40};
long int near *pointer;
struct {
long int near *array;
int entries;
int tbl[5];
} table = {NULL, 5, {11,12,13,};
table.array = (long int near *)array;
...
pointer = _itbl_to_lptr (table.tbl, 11);
...
}
#include <inline.h>
{
long int array[5] = {10,20,30,40,50};
struct {
long int near *array;
int entries;
int table[5];
} table = {NULL, 5, {11,12,13,14,15}};
...
table.array = (long int near *)array;
lea bx,table.table/* DS:BX -> table */
mov ax,11 /* AX = reference int */
itbl_to_lptr ();/* was int found? */
jc i_to_lptr_010/* n: continue */
... /* y: character located */
i_to_lptr_010:
...
}
Source file _TBPTRIL.ASM ASM equiv WTBL_TO_DPTR
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array[5];
struct filestru near *pointer;
struct {
struct filestru near *array;
int entries;
int tbl[5];
} table = {NULL, 5, {11,12,13,}};
table.array = (struct filestru near *) array;
...
pointer = (struct filestru*)_itbl_to_ptr (table.tbl, 11,
sizeof (struct filestru));
...
}
#include <inline.h>
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array[5];
int size = sizeof (struct filestru);
struct {
struct filestru near *array;
int entries;
int table[5];
} table = {NULL, 5, {11,12,13,14,15}};
...
table.array = (struct filestru near *)array;
lea bx,table.table/* DS:BX -> table */
mov ax,11 /* AX = reference int */
mov cx,size /* CX = element size */
itbl_to_ptr (); /* was int found? */
jc i_to_ptr_010/* n: continue */
... /* y: character located */
i_to_ptr_010:
...
}
Source file _TBPTRI.ASM ASM equiv WTBL_TO_PTR
{
int array1[5] = {10,20,30,40}, array2[5] = {10,20,40,60};
int near *pointer;
struct table{
char near *next;
int near *array;
int entries;
char tbl[6];
};
struct table table2 = {(char near *)-1, NULL, 5, "123};
struct table table1 = {NULL, NULL ,5,"ABC};
table1.next = (char near *)table2.tbl;
table2.array = (int near *)array2;
table1.array = (int near *)array1;
...
pointer = _xctbl_to_iptr (table1.tbl, '3');
...
}
#include <inline.h>
{
int array1[5]={10,20,30,40,50}, array2[5]={10,20,40,60,70};
struct tbl{
char near *next;
int near *array;
int entries;
char table[6];
};
struct tbl table2 = {(char near *)-1, NULL, 5, "12345"};
struct tbl table1 = {NULL , NULL, 5, "ABCDE"};
table1.next = (char near *)table2.table;
table2.array = (int near *)array2;
table1.array = (int near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov al,'3' /* AL = reference char */
xctbl_to_iptr ();/* was char found? */
jc xc_to_iptr_010/* n: go continue */
... /* y: char not found */
xc_to_iptr_010:
...
}
Source file _TBPTXCI.ASM ASM equiv XBTBL_TO_WPTR
{
long int array1[5] = {10,20,30,40}, array2[5] = {10,20,40,60};
long int near *pointer;
struct table{
char near *next;
long int near *array;
int entries;
char tbl[6];
};
struct table table2 = {(char near *)-1, NULL, 5, "123};
struct table table1 = {NULL, NULL,5,"ABC};
table1.next = (char near *)table2.tbl;
table2.array = (long int near *)array2;
table1.array = (long int near *)array1;
...
pointer = _xctbl_to_lptr (table1.tbl, '3');
...
}
#include <inline.h>
{
long int array1[5]={10,20,30,40,50};
long int array2[5]={10,20,40,60,70};
struct tbl{
char near *next;
long int near *array;
int entries;
char table[6];
};
struct tbl table2 = {(char near *)-1, NULL, 5, "12345"};
struct tbl table1 = {NULL, NULL, 5, "ABCDE"};
table1.next = (char near *)table2.table;
table2.array = (long int near *)array2;
table1.array = (long int near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov al,'3' /* AL = reference char */
xctbl_to_lptr ();/* was char found? */
jc xc_to_lptr_010/* n: go continue */
... /* y: char not found */
xc_to_lptr_010:
...
}
Source file _TBPTXCL.ASM ASM equiv XBTBL_TO_DPTR
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array1[5], array2[5];
struct filestru near *pointer;
struct table{
char near *next;
struct filestru near *array;
int entries;
char tbl[6];
};
struct table table2 = {(char near *)-1, NULL, 5, "123};
struct table table1 = {NULL,NULL,5,"ABC};
table1.next = (char near *)table2.tbl;
table2.array = (struct filestru near *)array2;
table1.array = (struct filestru near *)array1;
...
pointer = (struct filestru*)_xctbl_to_ptr (table1.tbl, '3',
sizeof (struct filestru));
...
}
#include <inline.h>
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array1[5], array2[5];
int size = sizeof (struct filestru);
struct tbl{
char near *next;
struct filestru near *array;
int entries;
char table[6];
};
struct tbl table2 = {(char near *)-1, NULL, 5, "12345"},
table1 = {NULL, NULL, 5,"ABCDE"};
table1.next = (char near *)table2.table;
table2.array = (struct filestru near *)array2;
table1.array = (struct filestru near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov al,'3' /* AL = reference char */
mov cx,size /* CX = element size */
xctbl_to_ptr ();/* was char found? */
jc xc_to_ptr_010/* n: go continue */
... /* y: char not found */
xc_to_ptr_010:
...
}
Source file _TBPTXC.ASM ASM equiv XBTBL_TO_PTR
{
char index;
struct table{
char near *next;
int start;
int entries;
char tbl[5];
};
struct table table2 = {(char near *)-1, 'a', 4, "ab};
struct table table1 = {NULL, 'A', 4, "AB};
table1.next = (char near *)table2.tbl;
...
index = _xindex_char (table1.tbl, 'a');
...
}
#include <inline.h>
{
struct tbl{
char near *next;
int start;
int entries;
char table[5];
};
struct tbl table2 = {(char near *)-1, 'a', 4, "abcd"};
struct tbl table1 = {NULL, 'A', 4, "ABCD"};
table1.next = (char near *)table2.table;
...
lea bx,table1.table/* DS:BX -> table */
mov al,'a' /* AL = char to locate */
xindex_char (); /* was char found? */
jc xdx_char_010/* n: go continue */
... /* y: char not found */
xdx_char_010:
...
}
Source file _TBXINDC.ASM ASM equiv XINDEX_BYTE
{
int index;
struct table{
int near *next;
int start;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, 10, 4, {10, 20, 3};
struct table table1 = {NULL, 11, 4, {11, 12, 1};
table1.next = (int near *)table2.tbl;
...
index = _xindex_int (table1.tbl, 10);
...
}
#include <inline.h>
{
struct tbl{
int near *next;
int start;
int entries;
int table[5];
};
struct tbl table2 = {(int near *)-1, 10, 4, {10, 20, 30, 40}};
struct tbl table1 = {NULL, 11, 4, {11, 12, 13, 14}};
table1.next = (int near *)table2.table;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,10 /* AX = int to locate */
xindex_int (); /* was int found? */
jc xdx_int_010/* n: go continue */
... /* y: int not found */
xdx_int_010:
...
}
Source file _TBXINDI.ASM ASM equiv XINDEX_WORD
{
int array1[5] = {10,20,30,40}, array2[5] = {10,20,40,60};
int near *pointer;
struct table{
int near *next;
int near *array;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, NULL, 5, {1,2,};
struct table table1 = {NULL,NULL,5,{6,7,8};
table1.next = (int near *)table2.tbl;
table2.array = (int near *)array2;
table1.array = (int near *)array1;
...
pointer = _xitbl_to_iptr (table1.tbl, 3);
...
}
#include <inline.h>
{
int array1[5]={10,20,30,40,50}, array2[5]={10,20,40,60,70};
struct tbl {
int near *next;
int near *array;
int entries;
int table[5];
} table2 = {(int near *)-1, NULL, 5, {1,2,3,4,5}},
table1 = {NULL, NULL, 5, {6,7,8,9,10}};
table1.next = (int near *)table2.table;
table2.array = (int near *)array2;
table1.array = (int near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,3 /* AX = reference int */
xitbl_to_iptr ();/* was int found? */
jc xi_to_iptr_010/* n: go continue */
... /* y: int not found */
xi_to_iptr_010:
...
}
Source file _TBPTXII.ASM ASM equiv XWTBL_TO_WPTR
{
long int array1[5] = {10,20,30,40}, array2[5] = {10,20,40,60};
long int near *pointer;
struct table{
int near *next;
long int near *array;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, NULL, 5, {1,2,};
struct table table1 = {NULL,NULL,5,{6,7,8};
table1.next = (int near *)table2.tbl;
table2.array = (long int near *)array2;
table1.array = (long int near *)array1;
...
pointer = _xitbl_to_lptr (table1.tbl, 3);
...
}
#include <inline.h>
{
long int array1[5] = {10,20,30,40,50};
long int array2[5] = {10,20,40,60,70};
struct {
int near *next;
int near *array;
int entries;
int table[5];
} table2 = {(int near *)-1, NULL, 5, {1,2,3,4,5}},
table1 = {NULL,NULL,5,{6,7,8,9,10}};
table1.next = (int near *)table2.table;
table2.array = (long int near *)array2;
table1.array = (long int near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,3 /* AX = reference int */
xitbl_to_lptr ();/* was int found? */
jc xi_to_lptr_010/* n: go continue */
... /* y: int not found */
xi_to_lptr_010:
...
}
Source file _TBPTXIL.ASM ASM equiv XWTBL_TO_DPTR
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array1[5], array2[5];
struct filestru near *pointer;
struct table{
int near *next;
struct filestru near *array;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, NULL, 5, {1,2,};
struct table table1 = {NULL, NULL ,5,{6,7,8};
table1.next = (int near *)table2.tbl;
table2.array = (struct filestru near *)array2;
table1.array = (struct filestru near *)array1;
...
pointer = (struct filestru*)_xitbl_to_ptr (table1.tbl, 3,
sizeof (struct filestru));
...
}
#include <inline.h>
{
struct filestru {
char filename[13];
int date;
long int size;
int attr;
};
struct filestru array1[5], array2[5];
int size = sizeof (struct filestru);
struct {
int near *next;
struct filestru near *array;
int entries;
int table[5];
} table2 = {(int near *)-1, NULL, 5, {1,2,3,4,5}},
table1 = {NULL,NULL,5,{6,7,8,9,10}};
table1.next = (int near *)table2.table;
table2.array = (struct filestru near *)array2;
table1.array = (struct filestru near *)array1;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,3 /* AX = reference int */
mov cx,size /* CX = element size */
xitbl_to_ptr ();/* was int found? */
jc xi_to_ptr_010/* n: go continue */
... /* y: int not found */
xi_to_ptr_010:
...
}
Source file _TBPTXI.ASM ASM equiv XWTBL_TO_PTR
{
int chr;
struct {
int start;
int entries;
char tbl[5];
} table = {'a', 4, "abcd"};
...
chr = _xlat_char (table.tbl, 'a');
if (chr == -1)
{
/* "index" was not found */
}
...
}
#include <inline.h>
{
struct {
int start;
int entries;
char table[5];
} table = {'a', 4, "abcd"};
...
lea bx,table.table/* DS:BX -> table */
mov ax,2 /* AX=index of char to retrieve */
xlat_char (); /* was index present in table? */
jc xlat_char_010/* n: go continue */
... /* y: index not present */
xlat_char_010:
...
}
Source file _TBXLATC.ASM ASM equiv XLAT_BYTE
{
int num;
struct {
int start;
int entries;
int tbl[5];
} table = {1, 4, {1,2,3,4,5};
...
num = _xlat_int (table.tbl, 1);
{
/* "index" was not found */
}
...
}
#include <inline.h>
{
int num;
struct {
int start;
int entries;
int table[5];
} table = {1, 4, {1,2,3,4,5}};
...
lea bx,table.table/* DS:BX -> table */
mov ax,1 /* AX=index of int to retrieve */
xlat_int (); /* was index present in table? */
jc xlat_int_010/* n: go continue */
... /* y: index not preset */
xlat_int_010:
...
}
Source file _TBXLATI.ASM ASM equiv XLAT_WORD
{
int chr;
struct table{
char near *next;
int start;
int entries;
char tbl[5];
};
struct table table2 = {(char near *)-1, 'a', 4, "abcd"};
struct table table1 = {NULL, 'A', 4, "AB};
table1.next = (char near *)table2.tbl;
...
chr = _xxlat_char (table1.tbl, 'a');
if (chr == -1)
{
/* "index" was not found */
}
...
}
#include <inline.h>
{
char chr;
struct {
char near *next;
int start;
int entries;
char table[5];
} table2 = {(char near *)-1, 'a', 4, "abcd"},
table1 = {NULL, 'A', 4, "ABCD"};
table1.next = (char near *)table2.table;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,2 /* AX = index not present */
xxlat_char (); /* was index present in table? */
jc xxlat_char_010/* n: go continue */
... /* y: index not found */
xxlat_char_010:
...
}
Source file _TBXXLTC.ASM ASM equiv XXLAT_BYTE
{
int num;
struct table{
int near *next;
int start;
int entries;
int tbl[5];
};
struct table table2 = {(int near *)-1, 1, 4, {1,2,3,4,5};
struct table table1 = {NULL, 10, 4, {10,20,30,};
table1.next = (int near *)table2.tbl;
...
num = _xxlat_int (table1.tbl, 1);
{
/* "index" was not found */
}
...
}
#include <inline.h>
{
int num;
struct {
int near *next;
int start;
int entries;
int table[5];
} table2 = {(int near *)-1, 1, 4, {1,2,3,4,5}},
table1 = {NULL, 10, 4, {10,20,30,40,50}};
table1.next = (int near *)table2.table;
...
lea bx,table1.table/* DS:BX -> table */
mov ax,1 /* AX=index of int to retrieve */
xxlat_int (); /* was index present in table? */
jc xxlat_int_010/* n: go continue */
... /* y: index not found */
xxlat_int_010:
...
_xxlat_int (table1.table, 1, &num);
...
}
Source file _TBXXLTI.ASM ASM equiv XXLAT_WORD