Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
6.0 KiB

  1. ; PAGE 80,132
  2. .xall
  3. ; Revision History:
  4. ;
  5. ; M003 - added A20OFF_FLAG for MS PASCAL 3.2 compatibility support
  6. ; for DOS5.X running in HMA.
  7. ;
  8. ; M004 - added bit definition SETSSSP for DOS_FLAG for supporting
  9. ; exe files without stack segment.
  10. ; This is no longer needed as we modify SP only. Removing
  11. ; this equate. 9/26/90
  12. ;
  13. ; M009 - addded comments relating to mace mkeyrate ver 1.0 support
  14. ; with DOS in HMA.
  15. ;
  16. ; M025 - Added SWITCHES=/W for suppressing mandatory loading
  17. ; of WINA20.386
  18. ;
  19. ; M027 - Support for copy protected apps. Defined bit 2 of DOS_FLAG
  20. ;
  21. TRUE EQU 0FFFFh
  22. FALSE EQU 0
  23. Installed = TRUE
  24. IFNDEF DEBUG
  25. DEBUG = FALSE
  26. ENDIF
  27. include dbcs.sw
  28. include dosmac.INC
  29. include VERSIONA.INC
  30. include VERSION.INC
  31. BREAK <Control character definitions>
  32. c_DEL EQU 7Fh ; ASCII rubout or delete previous char
  33. c_BS EQU 08h ; ^H ASCII backspace
  34. c_CR EQU 0Dh ; ^M ASCII carriage return
  35. c_LF EQU 0Ah ; ^J ASCII linefeed
  36. c_ETB EQU 17h ; ^W ASCII end of transmission
  37. c_NAK EQU 15h ; ^U ASCII negative acknowledge
  38. c_ETX EQU 03h ; ^C ASCII end of text
  39. c_HT EQU 09h ; ^I ASCII tab
  40. BREAK <Read This and Weep>
  41. include buffer.INC
  42. BREAK <User stack inside of system call and SysVars>
  43. ; Location of user registers relative user stack pointer
  44. user_environ STRUC
  45. user_AX DW ? ; 00 hex offsets to
  46. user_BX DW ? ; 02 facilitate debugging
  47. user_CX DW ? ; 04
  48. user_DX DW ? ; 06
  49. user_SI DW ? ; 08
  50. user_DI DW ? ; 0A
  51. user_BP DW ? ; 0C
  52. user_DS DW ? ; 0E
  53. user_ES DW ? ; 10
  54. user_IP DW ? ; 12
  55. user_CS DW ? ; 14
  56. user_F DW ? ; 16
  57. user_environ ENDS
  58. BREAK <Disk map>
  59. ; MSDOS partitions the disk into 4 sections:
  60. ;
  61. ; phys sector 0: +-------------------+
  62. ; | | boot/reserved |
  63. ; | +-------------------+
  64. ; | | File allocation |
  65. ; v | table(s) |
  66. ; | (multiple copies |
  67. ; | are kept) |
  68. ; +-------------------+
  69. ; | Directory |
  70. ; +-------------------+
  71. ; | File space |
  72. ; +-------------------+
  73. ; | Unaddressable |
  74. ; | (to end of disk) |
  75. ; +-------------------+
  76. ;
  77. ; All partition boundaries are sector boundaries. The size of the FAT is
  78. ; adjusted to maximize the file space addressable.
  79. include dirent.INC
  80. BREAK <File allocation Table information>
  81. ;
  82. ; The File Allocation Table uses a 12-bit entry for each allocation unit on
  83. ; the disk. These entries are packed, two for every three bytes. The contents
  84. ; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
  85. ; to the base address of the Allocation Table; 3) fetching the 16-bit word
  86. ; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
  87. ; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
  88. ; number zero is used as an end-of-file trap in the OS and is passed to the
  89. ; BIOS to help determine disk format. Entry 1 is reserved for future use.
  90. ; The first available allocation unit is assigned entry number two, and even
  91. ; though it is the first, is called cluster 2. Entries greater than 0FF8H
  92. ; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
  93. ; are unallocated. Otherwise, the contents of a FAT entry is the number of
  94. ; the next cluster in the file.
  95. ;
  96. ; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
  97. ; do because these clusters show as allocated, but are not part of any
  98. ; allocation chain and thus will never be allocated to a file. A particular
  99. ; number is selected so that disk checking programs know what to do (ie. a
  100. ; cluster with entry FF7H which is not in a chain is not an error).
  101. ;** Character Type Flags
  102. ;
  103. ; These flags are used in a lookup table indexed by the character code.
  104. ; They're used to quickly classify characters when parsing paths.
  105. ; I think that these are only used to parse FCBs - jgl
  106. FCHK equ 1 ; I think this means "normal name char, no chks needed" -jgl
  107. FDELIM equ 2 ; is a delimiter
  108. FSPCHK equ 4 ; set if character is not a space or equivalent
  109. FFCB equ 8 ; is valid in an FCB
  110. include error.INC
  111. ;** Bit definitions for DOS_FLAG
  112. ;
  113. ; Bit 0 - this is set when a $open call is made from $exec. This is used in
  114. ; $open to indicate to the redirector that this open is being made
  115. ; by an exec call.
  116. ;
  117. ; Bit 2
  118. ;
  119. ; M003, M027:
  120. ;
  121. ; The start up code of MS PASCAL 3.2 programs depend on the 1M address wrap
  122. ; if they load below 64K. This is a likely possiblity in DOS 5.x with DOS in
  123. ; the HMA. By default DOS will turn A20 OFF before Xferring control to the
  124. ; user program in the case of an Exec call. The next call to DOS will turn
  125. ; A20 line ON. It has been observed that MS PASCAL 3.2 start up does an int
  126. ; 21 ah=25h call before executing the faulty code. This will turn A20 On.
  127. ; In order to support this we will set Bit 2 of this flag in the DOS exec
  128. ; call (msproc.asm) if DOS is running in the HMA. In $set_interrupt_vector in
  129. ; getset.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
  130. ; by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
  131. ; is non zero then A20 will be turned OFF before returning to the user.
  132. ; Bit 2 will be unconditionally cleared here.
  133. ;
  134. ; M009, M027:
  135. ;
  136. ; Mace utilities MKEYRATE.COM version 1.0 copyright 1987 is an execpacked
  137. ; program converted to a com file. Therefore if DOS is loaded high and if
  138. ; this program is loaded below 64K it will blurt out "packed file is corrupt".
  139. ; This program does an int 21 ah=49h before executing the buggy execpacked
  140. ; code. This int21 call turns a20 on and hence the problem. In $dealloc
  141. ; alloc.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
  142. ; by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
  143. ; is non zero then A20 will be turned OFF before returning to the user.
  144. ; Bit 2 will be unconditionally cleared here.
  145. ;
  146. ;
  147. ;
  148. EXECOPEN EQU 00000001b ; bit 0 of DOS_FLAG
  149. SUPPRESS_WINA20 EQU 00000010b ; M025
  150. EXECA20OFF EQU 00000100b ; bit 2 of DOS_FLAG
  151. 
  152.