Программирование видеоадаптеров CGA, EGA и VGA



         

Включаемый файл "SYSP.H"


/* SYSP.H - include-файл для примеров, приведенных в книге */

/** *.Name FP_MAKE * *.Title Макро для составления FAR-указателя * *.Descr Макро составляет FAR-указатель, пользуясь * значениями сегмента и смещения * *.Params FP_MAKE(seg,off) * seg - сегмент; * off - смещение * *.Return FAR-указатель seg:off **/

#define FP_MAKE(seg,off) ((void far *) \ ((((unsigned long) (unsigned)(seg)) << 16L) | \ ((unsigned long) (unsigned) (off))))

/* Структура векторной таблицы связи DOS */

#pragma pack(1)

typedef struct _CVT_ { unsigned mcb_seg; void far *dev_cb; void far *file_tab; void far *clock_dr; void far *con_dr; unsigned max_btbl; void far *disk_buf; void far *drv_info; void far *fcb_tabl; unsigned fcb_size; unsigned char num_bdev; unsigned char lastdriv; } CVT;

/* Блок управления памятью MCB */

typedef struct _MCB_ { unsigned char type; unsigned owner; unsigned size; char reserve[11]; } MCB;

/* Префикс программного сегмента PSP */

typedef struct _PSP_ { unsigned char int20h[2]; unsigned mem_top; unsigned char reserv1; unsigned char call_dsp[5]; void far *term_adr; void far *cbrk_adr; void far *crit_err; unsigned parn_psp; unsigned char file_tab[20]; unsigned env_seg; void far *ss_sp; unsigned max_open; void far *file_tba; unsigned char reserv2[24]; unsigned char disp[3]; unsigned char reserv3[9]; unsigned char fcb1[16]; unsigned char fcb2[20]; unsigned char p_size; unsigned char parm[127]; } PSP;

/* Блок управления устройством DOS */

typedef struct _DDCB_ { unsigned char drv_num; unsigned char drv_numd; unsigned sec_size; unsigned char clu_size; unsigned char clu_base; unsigned boot_siz; unsigned char fat_num; unsigned max_dir; unsigned data_sec; unsigned hi_clust; unsigned char fat_size; char reserv1; unsigned root_sec; void far *drv_addr; unsigned char media; unsigned char acc_flag; struct _DDCB_ far *next; unsigned reserv2; unsigned built; } DDCB;

/* Управляющий блок DOS для файлов */

typedef struct _DFCB_ { unsigned handl_num; unsigned char access_mode; unsigned reserv1; unsigned dev_info; void far *driver; unsigned first_clu; unsigned time; unsigned date; unsigned long fl_size; unsigned long offset; unsigned reserv2; unsigned reserv7; unsigned reserv3; char reserv4; char filename[11]; char reserv5[6]; unsigned ownr_psp; unsigned reserv6; unsigned last_clu; char reserv8[4]; } DFCB;




Содержание  Назад  Вперед