home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / INCLUDE / PAL.INC < prev    next >
Encoding:
Text File  |  1995-06-10  |  5.9 KB  |  196 lines

  1. ;****************************************************************************
  2. ; Filename: PAL.INC
  3. ;  Version:
  4. ;   Author: Peter Andersson
  5. ;  Created: 1995.03.12
  6. ;  Updated: -
  7. ;****************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;****************************************************************************
  11.  
  12. MACRO    PALfunction   FUNC
  13. Global NoLanguage @&FUNC:Near
  14. Global C           FUNC :Near
  15. ENDM     PALfunction
  16.  
  17.  
  18. ;****************************************************************************
  19. ; STARTUP
  20. ;****************************************************************************
  21.  
  22.  
  23.  
  24. Global C main:Near
  25. Global dos32version:Dword        ; version of DOS32 (in bcd)
  26. Global dos32system:Byte         ; system type - RAW,XMS,VCPI or DPMI
  27. Global exesize:Dword            ; size in bytes
  28. Global exename:Dword            ; PSZ to executable name and path
  29. Global _psp:Dword            ; program segment prefix pointer
  30. Global _environ:Dword            ; environment pointer
  31. Global _envsize:Dword            ; number of entries in environment table
  32. Global environ:Dword            ; environment table pointer
  33. Global _zero:Dword            ; zero pointer
  34. Global _zero_sel:Dword            ; zero selector
  35.  
  36. Global DMA_addr:Dword            ; DMA near pointer address
  37. Global DMA_size:Dword            ; DMA size in bytes
  38. Global DMA_phys:Dword            ; DMA physical address
  39.  
  40. Global DOS_addr:Dword            ; DOS near pointer address
  41. Global DOS_size:Dword            ; Size of DOS buffer in bytes
  42. Global DOS_seg:Dword            ; DOS real buffer ptr segment:offset
  43.  
  44. Global _environ:Dword            ; Environment table pointer
  45. Global _envsize:Dword            ; Environment size in bytes
  46.  
  47. ;****************************************************************************
  48. ; CONIO - console I/O
  49. ;****************************************************************************
  50.  
  51. STDIN  = 0        ; Standard input handle
  52. STDOUT = 1        ; Standard output handle
  53. STDERR = 2        ; Standard error handle
  54.  
  55. Global C printf:Near
  56. Global C kbhit:Near
  57.  
  58. ;****************************************************************************
  59. ; FILEIO - file I/O
  60. ;****************************************************************************
  61. Global errno:Dword                ; System error code
  62.  
  63. EOF = -1                        ; End of file error constant
  64. NUL = 0                         ;
  65.  
  66. PALfunction        open          ; Open file
  67. PALfunction        close        ; Close file
  68. PALfunction        unlink        ; Delete file
  69. PALfunction        read            ; Read data from file
  70. PALfunction        write        ; Write data to file
  71. PALfunction        filelength    ; File length in bytes
  72. PALfunction        lseek        ; Seek new file position
  73. PALfunction        rmdir        ; Removes a directory
  74. PALfunction        chdir        ; Changes to a directory
  75. PALfunction        mkdir        ; Creates a directory
  76. PALfunction        creat        ; Creat a new file
  77.  
  78.  
  79.  
  80.  
  81. O_RDONLY = 0            ; Read only
  82. O_WRONLY = 1            ; Write only
  83. O_RDWR   = 2            ; Read and write
  84. O_APPEND = 4            ; File pointer will be set to the end of file
  85. O_CREAT  = 8            ; Creates the file if it doesn't exist
  86. O_TRUNC  = 16            ; Truncate the file when open
  87. O_EXCL   = 32            ; Returns an error if file exists (O_CREAT)
  88.  
  89. SEEK_SET = 0            ; Seek from file beginning
  90. SEEK_CUR = 1            ; Seek from current file position
  91. SEEK_END = 2            ; Seek from end of file
  92.  
  93. ;****************************************************************************
  94. ; MATH - math functions
  95. ;****************************************************************************
  96. PALfunction        min
  97. PALfunction        max
  98. PALfunction        min3
  99. PALfunction        max3
  100. PALfunction        atoi
  101.  
  102.  
  103. ;****************************************************************************
  104. ; MALLOC - memory allocation
  105. ;****************************************************************************
  106. PALfunction        setmem
  107. PALfunction        malloc
  108. PALfunction        free
  109. PALfunction        resize
  110. PALfunction        realloc
  111. PALfunction        calloc
  112. Global C memavail:Near
  113. Global C maxavail:Near
  114.  
  115.  
  116. ;****************************************************************************
  117. ; STRINGS - various string I/O
  118. ;****************************************************************************
  119. PALfunction        strcpy
  120. PALfunction        stpcpy
  121. PALfunction        strcat
  122. PALfunction        strchr
  123. PALfunction        strchrn
  124. PALfunction        strcmp
  125. PALfunction        stricmp
  126. PALfunction        strdup
  127. PALfunction        strlen
  128. PALfunction        strupr
  129. PALfunction        strlwr
  130. PALfunction        strncpy
  131. PALfunction        strpbrk
  132. PALfunction        otoa
  133. PALfunction        btoa
  134. PALfunction        xtoa
  135. PALfunction        ltoa
  136. PALfunction        ultoa
  137. PALfunction        btoa
  138. PALfunction        xtoa
  139. PALfunction        otoa
  140. PALfunction        ptos
  141. PALfunction        isdigit
  142. PALfunction        isxdigit
  143. PALfunction        isalpha
  144. PALfunction        islower
  145. PALfunction        isupper
  146. PALfunction        isalnum
  147. PALfunction        isascii
  148. PALfunction        iscntrl
  149. PALfunction        ispunct
  150. PALfunction        isspace
  151. PALfunction        isprint
  152. PALfunction        toupper
  153. PALfunction        tolower
  154. Global C sprintf:Near
  155.  
  156.  
  157. ;****************************************************************************
  158. ; VARIOUS - various functions
  159. ;****************************************************************************
  160. Struc   IRQVECT
  161.     Union
  162. farvect Df  ?
  163.     Struc
  164. vectofs Dd  ?
  165. vectseg Dw  ?
  166.     Ends
  167.     Ends
  168. Ends    IRQVECT
  169.  
  170. PALfunction        _exit
  171. PALfunction        exit
  172. PALfunction        vprintf
  173. PALfunction        atexit
  174. PALfunction        memcpy
  175. PALfunction        memset
  176. PALfunction        memmove              ; move with overlap
  177. PALfunction        getvect
  178. PALfunction        setvect
  179. PALfunction        MK_FAR
  180. PALfunction        MK_FP
  181. PALfunction        getenv
  182. PALfunction        outp
  183. PALfunction        outpw
  184. PALfunction        inp
  185. PALfunction        inpw
  186.  
  187. Global C _cexit:Near
  188. Global C abort:Near
  189.  
  190.  
  191.  
  192. include "pal_new.inc"
  193.  
  194.  
  195.  
  196.