home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / masm / masm6 / demos / demo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-04  |  6.0 KB  |  135 lines

  1. /* Constants */
  2. #define CR 13                           /* ASCII code for Return  */
  3. #define ESCAPE 27                       /* ASCII code for Esc key */
  4. #define MDA 0                           /* Adapter constants      */
  5. #define CGA 1
  6. #define MCGA 2
  7. #define EGA 3
  8. #define VGA 4
  9. #define MONO 0                          /* Display constants      */
  10. #define COLOR 1
  11. #define clear_scrn( Attr, Row1, Row2 ) ClearBox( Attr, Row1, 0, Row2, 79 )
  12.  
  13. /* Structure members at 1-byte boundaries */
  14. #pragma pack( 1 )
  15.  
  16. /* Video configuration structure */
  17. struct VIDCONFIG
  18. {
  19.     unsigned char mode;         /* Current mode                   */
  20.     unsigned char dpage;        /* Current display page           */
  21.     unsigned char rows;         /* Number of display rows - 1     */
  22.     unsigned char cols;         /* Number of display columns      */
  23.     unsigned char display;      /* Either MONO or COLOR           */
  24.     unsigned char adapter;      /* Adapter code                   */
  25.     unsigned sgmnt;             /* Video segment with page offset */
  26. };
  27. struct VIDCONFIG pascal vconfig;  /* Structure for video configuration */
  28.  
  29. /* File information returned from FindFirst procedure  */
  30. struct FILEINFO
  31. {
  32.     char pad[21];               /* pad to 43 bytes     */
  33.     char attrib;                /* file attribute      */
  34.     unsigned time;              /* file time           */
  35.     unsigned date;              /* file date           */
  36.     long size;                  /* file size           */
  37.     char filename[13];          /* file name           */
  38. };
  39.  
  40. /* Disk statistics returned from GetDiskSize procedure */
  41. struct DISKSTAT
  42. {
  43.     unsigned total;             /* total clusters      */
  44.     unsigned avail;             /* available clusters  */
  45.     unsigned sects;             /* sectors per cluster */
  46.     unsigned bytes;             /* bytes per sector    */
  47. };
  48.  
  49. struct PARMBLK
  50. {
  51.     unsigned env;               /* segment of environment block         */
  52.     char _far *taddr;           /* segment:offset address of tail       */
  53.     char _far *fcb1;            /* segment:offset address of 1st FCB    */
  54.     char _far *fcb2;            /* segment:offset address of 2nd FCB    */
  55. };
  56.  
  57. /* Procedure prototypes from COMMON.ASM */
  58. short _pascal GetVer( void );
  59. void  _pascal GetVidConfig( void );
  60. void  _pascal StrWrite( unsigned Row, unsigned Col, char *Sptr );
  61. void  _pascal ClearBox( unsigned Attr, unsigned Row1, unsigned Col1,
  62.                         unsigned Row2, unsigned Col2 );
  63. void  _pascal DisableCga( void );
  64. void  _pascal EnableCga( void );
  65. void  _pascal SetCurPos( unsigned Row, unsigned Col );
  66. short _pascal GetCurPos( void );
  67. short _pascal StrInput( unsigned Row, unsigned Col,
  68.                         unsigned Max, char *Sptr );
  69.  
  70. /* Procedure prototypes from MISC.ASM */
  71. short    _pascal WinOpen( unsigned Row1, unsigned Col1,
  72.                           unsigned Row2, unsigned Col2, unsigned Attr );
  73. void     _pascal WinClose( unsigned Addr );
  74. void     _pascal SetCurSize( unsigned Scan1, unsigned Scan2 );
  75. unsigned _pascal GetCurSize( void );
  76. unsigned long _pascal GetShift( void );
  77. unsigned long _pascal GetMem( void );
  78. short    _pascal GetKeyClock( unsigned Row, unsigned Col );
  79. short    _pascal VeriAnsi( void );
  80. short    _pascal VeriPrint( void );
  81. short    _pascal VeriCop( void );
  82. short    _pascal SetLineMode( unsigned Line );
  83. void     _pascal Pause( unsigned Duration );
  84. void     _pascal Sound( unsigned Freq, unsigned Duration );
  85. void     _pascal WriteTTY( char *Sptr, unsigned icolor );
  86. void     _pascal Colors( unsigned Logic, unsigned Attr, unsigned Row1,
  87.                          unsigned Col1, unsigned Row2, unsigned Col2 );
  88. short    _pascal Exec( char *Spec, struct PARMBLK *Block,
  89.                        void *CtrBrk, void *CtrlC, void *Criterr );
  90. void     _pascal BinToHex( unsigned Num, char *Sptr );
  91.  
  92. /* Procedure prototypes from MATH.ASM */
  93. long     _pascal AddLong(  long Long1, long Long2 );
  94. long     _pascal SubLong(  long Long1, long Long2 );
  95. long     _pascal ImulLong( long Long1, long Long2 );
  96. unsigned long *_pascal MulLong( unsigned long Long1, unsigned long Long2 );
  97. short    _pascal IdivLong( long Long1, short Short2, short *Remn );
  98. unsigned _pascal DivLong(  unsigned long Long1,
  99.                            unsigned Short2, unsigned *Remn );
  100. short    _pascal Quadratic( float a, float b, float c,
  101.                             float *R1, float *R2 );
  102.  
  103. /* Procedure prototypes from FILE.ASM */
  104. void   _pascal ChangeDrive( unsigned Drive );
  105. void   _pascal GetDiskSize( unsigned Drive, struct DISKSTAT *Disk );
  106. void   _pascal SetDta( char far *Dta );
  107. void   _pascal GetDta( char far *Dta );
  108. short  _pascal ReadCharAttr( unsigned *Attr );
  109. short  _pascal GetCurDir( char *Spec );
  110. short  _pascal GetCurDrive( void );
  111. short  _pascal CopyFile( unsigned Imode, char *Fspec1, char *Fspec2 );
  112. short  _pascal DelFile( char *Fspec );
  113. short  _pascal MakeDir( char *Pspec );
  114. short  _pascal RemoveDir( char *Pspec );
  115. short  _pascal ChangeDir( char *Pspec );
  116. short  _pascal GetAttribute( char *Fspec );
  117. short  _pascal SetAttribute( unsigned Attr, char *Fspec );
  118. short  _pascal RenameFile( char *Fspec1, char *Fspec2 );
  119. short  _pascal GetFileTime( unsigned Handle, char *Sptr );
  120. short  _pascal FindFirst( unsigned Attr, char *Fspec,
  121.                           struct FILEINFO *Finfo );
  122. short  _pascal FindNext( struct FILEINFO *Finfo );
  123. short  _pascal UniqueFile( unsigned Attr, char *Pspec );
  124. short  _pascal OpenFile( unsigned Access, char *Fspec );
  125. void   _pascal CloseFile( unsigned Handle );
  126. short  _pascal CreateFile( unsigned Attr, char *Fspec );
  127. short  _pascal CreateNewFile( unsigned Attr, char *Fspec );
  128. short  _pascal ReadFile( unsigned Handle, unsigned Len, char *Pbuff );
  129. short  _pascal WriteFile( unsigned Handle, char *Sptr );
  130. void   _pascal Rewind( unsigned Handle );
  131. unsigned long _pascal GetFileSize( unsigned Handle );
  132. short  _pascal GetStr( char *Strbuf, unsigned Maxlen );
  133. char  *_pascal StrCompare( char *Sptr1, char *Sptr2, unsigned Len );
  134. char  *_pascal StrFindChar( char Ichar, char *Sptr, unsigned Direct );
  135.