        page    ,132
        title   DOSTAB -

;
; Message file for Internationalized messages.  There is
; only one message here available for translation.
;
;
;    Revision history
;   Revisions:
;
;Local  DCR/
;Tag    PTM(R)  Who     When
;A000
;                   version 4.00  Jan. 1988
;               danno   07-Dec-1988
;                   Modified from dosmes.asm for MVDM
;

.xlist
include v86seg.inc
.xcref
include basemaca.inc
include osmaca.inc
include demmac.inc
include dossymc.inc
include demver.inc
include demdbcs.inc
include switch.inc
include doscntry.inc
include struc30.inc
include dirent.inc
include fastopen.inc
include devsym.inc
include exe.inc
include error.inc
.cref
.list

        EXTRN       $Std_Con_Input_No_Echo:NEAR


;---------------------------------------
V86LoL  SEGMENT
        EXTRN   ContPos: word
        EXTRN   SysInitVar: word
        EXTRN   Bcon: Dword
        EXTRN   UmbFlag: byte
        EXTRN   Umb_head: word
V86LoL  ENDS
;---------------------------------------
V86CONST SEGMENT
        EXTRN   CarPos: byte
        EXTRN   CharCo: byte
        EXTRN   CritPatch: word
V86CONST ENDS
;---------------------------------------
V86SDA  SEGMENT
        EXTRN   SaveDS: word
        EXTRN   SaveBX: word
        EXTRN   INDOS: byte
        EXTRN   User_id: word
V86SDA  ENDS
;---------------------------------------
V86TABLE SEGMENT
        EXTRN   COUNTRY_CDPG:byte
V86TABLE ENDS
;---------------------------------------
V86DATA SEGMENT

public  $_cp20_DosTab
$_cp20_DosTab label byte

; THE FOLLOWING BYTE MUST BE HERE, IMMEDIATELY FOLLOWING SWAP_END. IT CANNOT
;   BE USED. If the size of the swap data area is ODD, it will be rounded up
;   to include this byte.
        DB      ?

        PUBLIC  UCASE_TAB,FILE_UCASE_TAB,FILE_CHAR_TAB,COLLATE_TAB
;
; upper case table
;
UCASE_TAB    label   byte
                    dw  128
                    db  128,154,069,065,142,065,143,128
                    db  069,069,069,073,073,073,142,143
                    db  144,146,146,079,153,079,085,085
                    db  089,153,154,155,156,157,158,159
                    db  065,073,079,085,165,165,166,167
                    db  168,169,170,171,172,173,174,175
                    db  176,177,178,179,180,181,182,183
                    db  184,185,186,187,188,189,190,191
                    db  192,193,194,195,196,197,198,199
                    db  200,201,202,203,204,205,206,207
                    db  208,209,210,211,212,213,214,215
                    db  216,217,218,219,220,221,222,223
                    db  224,225,226,227,228,229,230,231
                    db  232,233,234,235,236,237,238,239
                    db  240,241,242,243,244,245,246,247
                    db  248,249,250,251,252,253,254,255

;
; file upper case table
;
FILE_UCASE_TAB  label  byte
                    dw  128
                    db  128,154,069,065,142,065,143,128
                    db  069,069,069,073,073,073,142,143
                    db  144,146,146,079,153,079,085,085
                    db  089,153,154,155,156,157,158,159
                    db  065,073,079,085,165,165,166,167
                    db  168,169,170,171,172,173,174,175
                    db  176,177,178,179,180,181,182,183
                    db  184,185,186,187,188,189,190,191
                    db  192,193,194,195,196,197,198,199
                    db  200,201,202,203,204,205,206,207
                    db  208,209,210,211,212,213,214,215
                    db  216,217,218,219,220,221,222,223
                    db  224,225,226,227,228,229,230,231
                    db  232,233,234,235,236,237,238,239
                    db  240,241,242,243,244,245,246,247
                    db  248,249,250,251,252,253,254,255

;
; file char list
;
FILE_CHAR_TAB  label  byte
                dw      22                              ; length
                db      1,0,255                         ; include all
                db      0,0,20h                         ; exclude 0 - 20h
                db      2,14,'."/\[]:|<>+=;,'           ; exclude 14 special
                db      24 dup (?)                      ; reserved
;
; collate table
;
COLLATE_TAB    label   byte
        dw      256
        db      0,1,2,3,4,5,6,7
        db      8,9,10,11,12,13,14,15
        db      16,17,18,19,20,21,22,23
        db      24,25,26,27,28,29,30,31
        db      " ","!",'"',"#","$","%","&","'"
        db      "(",")","*","+",",","-",".","/"
        db      "0","1","2","3","4","5","6","7"
        db      "8","9",":",";","<","=",">","?"
        db      "@","A","B","C","D","E","F","G"
        db      "H","I","J","K","L","M","N","O"
        db      "P","Q","R","S","T","U","V","W"
        db      "X","Y","Z","[","\","]","^","_"
        db      "`","A","B","C","D","E","F","G"
        db      "H","I","J","K","L","M","N","O"
        db      "P","Q","R","S","T","U","V","W"
        db      "X","Y","Z","{","|","}","~",127
        db      "C","U","E","A","A","A","A","C"
        db      "E","E","E","I","I","I","A","A"
        db      "E","A","A","O","O","O","U","U"
        db      "Y","O","U","$","$","$","$","$"
        db      "A","I","O","U","N","N",166,167
        db      "?",169,170,171,172,"!",'"','"'
        db      176,177,178,179,180,181,182,183
        db      184,185,186,187,188,189,190,191
        db      192,193,194,195,196,197,198,199
        db      200,201,202,203,204,205,206,207
        db      208,209,210,211,212,213,214,215
        db      216,217,218,219,220,221,222,223
        db      224,"S"
        db      226,227,228,229,230,231
        db      232,233,234,235,236,237,238,239
        db      240,241,242,243,244,245,246,247
        db      248,249,250,251,252,253,254,255
;
; dbcs is not supported in DOS 3.3
;                  DBCS_TAB         CC_DBCS <>
;
; DBCS for DOS 4.00                        2/12/KK
   PUBLIC    DBCS_TAB
DBCS_TAB        label byte              ;AN000;  2/12/KK
                dw      2               ;AN000;  2/12/KK      max number
                db      16 dup(0)       ;AN000;  2/12/KK


ASSUME  CS:V86GROUP,DS:NOTHING,ES:NOTHING

;CASE MAPPER ROUTINE FOR 80H-FFH character range, DOS 3.3
;     ENTRY: AL = Character to map
;     EXIT:  AL = The converted character
; Alters no registers except AL and flags.
; The routine should do nothing to chars below 80H.
;
; Example:

public MAP_CASE
MAP_CASE proc   far
        .if     <AL b 80h>              ;Map no chars below 80h ever
          ret
        .endif

        sub     al,80h                  ;Turn into index value
        push    ds
        push    bx
        mov     bx,offset V86GROUP:UCASE_TAB + 2
        push    cs              ;Move to DS
        pop     ds
        xlat                    ;Get upper case character
        pop     bx
        pop     ds
        ret
MAP_CASE endp


;---------------------------------------Start of Korean support  2/11/KK
;
; The varialbes for ECS version are moved here for the same data alignments
; as IBM-DOS and MS-DOS.
;
        PUBLIC  InterChar
InterChar       db      ?               ; Interim character flag ( 1= interim)  ;AN000;
                                                                                ;AN000;
;------- NOTE: NEXT TWO BYTES SOMETIMES USED AS A WORD !! ---------------------
DUMMY   LABEL   WORD                                                            ;AN000;
        PUBLIC  InterCon                ; Console in Interim mode ( 1= interim) ;AN000;
InterCon        db      0                                                       ;AN000;
        PUBLIC  SaveCurFlg              ; Print, do not advance cursor flag     ;AN000;
SaveCurFlg      db      0                                                       ;AN000;
;-----------------------------------------End of Korean support  2/11/KK



public  TEMPSEG
TEMPSEG         dw      ?               ;hkn; used to store ds.

public  redir_patch
redir_patch     db      0

public Mark1
        Mark1 label byte



;###########################################################################
        DB      5 dup (?)               ;Some DOS 5 hack needs this alignment
;###########################################################################



PUBLIC  MSVERSION
MSVERSION       LABEL BYTE              ;MS-DOS version in hex for $GET_VERSION
        DB      MAJOR_VERSION
        DB      MINOR_VERSION

; YRTAB & MONTAB moved from TABLE segment in ms_table.asm

PUBLIC  YRTAB,MONTAB
YRTAB   db      200,166,200,165,200,165,200,165
MONTAB  db      31,28,31,30,31,30,31,31,30,31,30,31


;----------------THE FOLL. BLOCK MOVED FROM TABLE SEG IN MS_TABLE.ASM-------

; SYS init extended table,   DOS 3.3   F.C. 5/29/86
;
       PUBLIC   SysInitTable
SysInitTable    label   byte
                dw      OFFSET V86GROUP:SYSINITVAR    ; pointer to sysinit var
                dw      0                             ; segment
                dw      OFFSET V86GROUP:COUNTRY_CDPG  ; pointer to country
                dw      0                             ; table segment of pointer


; DOS 3.3 F.C. 6/12/86
; FASTOPEN communications area DOS 3.3   F.C. 5/29/86
;
       PUBLIC   FastOpenTable
       PUBLIC   FastTable                            ; a better name
       EXTRN    FastRet:FAR                          ; defined in misc2.asm

FastTable      label  byte                           ; a better name
FastOpenTable  label  byte
               dw      2                             ; number of entries
               dw      OFFSET V86GROUP:FastRet       ; pointer to ret instr.
               dw      0                             ; and will be modified by
               dw      OFFSET V86GROUP:FastRet       ; FASTxxx when loaded in
               dw      0                             ;
; DOS 3.3 F.C. 6/12/86
      PUBLIC   FastFlg,FastOpenFlg      ;AN000; flags
FastFlg        label  byte              ;AN000; don't change the following order
FastOpenFlg    db     0                 ;AN000;

       PUBLIC   FastOpen_Ext_Info

; FastOpen_Ext_Info is used as a temporary storage for saving dirpos,dirsec
; and clusnum  which are filled by DOS 3.3 when calling FastOpen Insert
; or filled by FastOPen when calling FastOpen Lookup

FastOpen_Ext_Info  label  byte
               db   SIZE FASTOPEN_EXTENDED_INFO dup(0) ;dirpos

; Dir_Info_Buff is a dir entry buffer which is filled by FastOPen
; when calling FastOpen Lookup

       PUBLIC  Dir_Info_Buff

Dir_Info_Buff  label  byte
               db   SIZE dir_entry dup (0)


Public  Next_Element_Start
Next_Element_Start dw ? ; save next element start offset

public Del_ExtCluster
Del_ExtCluster dw ?       ; for dos_delete

; The following is a stack and its pointer for interrupt 2F which is uesd
; by NLSFUNC.  There is no significant use of this stack, we are just trying
; not to destroy the INT 21 stack saved for the user.


       PUBLIC   User_SP_2F

USER_SP_2F      LABEL   WORD
                dw      OFFSET V86GROUP:FAKE_STACK_2F

       PUBLIC   Packet_Temp
Packet_Temp     label  word              ; temporary packet used by readtime
       PUBLIC   DOS_TEMP                 ; temporary word
DOS_TEMP        label  word
FAKE_STACK_2F   dw   14 dup (0)          ; 12 register temporary storage

       PUBLIC   Hash_Temp                ;AN000; temporary word
Hash_Temp        label  word             ;AN000;
                dw    4 dup (0)          ;AN000; temporary hash table during config.sys

      PUBLIC   SCAN_FLAG                 ; flag to indicate key ALT_Q
SCAN_FLAG      label  byte
               db     0
;;; The following  2 words must be adjacent for IBMDOS reasons

      PUBLIC   DATE_FLAG
DATE_FLAG      label  word               ; flag to
               dw     0                  ; to update the date
;;;; special tag for IBMDOS
      PUBLIC   FETCHI_TAG
FETCHI_TAG     label  word              ; TAG to make DOS 3.3 work
               dw     0                 ; must be 22642
                                        ; OBSOLETE - no longer used
                                        ; formerly part of IBM's piracy protection
;;; The above  2 words must be adjacent for IBMDOS reasons
; DOS 3.3 F.C. 6/12/86


      PUBLIC   MSG_EXTERROR              ; for system message addr              ;AN000;
MSG_EXTERROR   label  DWORD                                                     ;AN000;
               dd     0                  ; for extended error                   ;AN000;
               dd     0                  ; for parser                           ;AN000;
               dd     0                  ; for critical errror                  ;AN000;
               dd     0                  ; for IFS                              ;AN000;
               dd     0                  ; for code reduction                   ;AN000;

      PUBLIC   SEQ_SECTOR                ; last sector read                     ;AN000;
SEQ_SECTOR     label  DWORD                                                     ;AN000;
               dd     -1                                                        ;AN000;


public SC_SECTOR_SIZE,SC_DRIVE,CurSC_DRIVE,CurSC_SECTOR,SC_STATUS,SC_FLAG
public AbsDskErr
SC_SECTOR_SIZE  dw      ?               ; sector size for SC
SC_DRIVE        db      ?               ; drive # for secondary cache
CurSC_DRIVE     db      -1              ; current SC drive
CurSC_SECTOR    dd      ?               ; current SC starting sector
SC_STATUS       dw      0               ; SC status word
SC_FLAG         db      0               ; SC flag
AbsDskErr       dw      0               ; Storage for Abs dsk read/write err

          PUBLIC NO_NAME_ID                                                           ;AN000;
NO_NAME_ID       label byte                                                           ;AN000;
                 db   'NO NAME    '              ; null media id                      ;AN000;


Public  KISTR001S,KISTR001E,LOOKSIZ     ;AN000;; 2/17/KK
KISTR001S       label   byte            ;AN000;; 2/17/KK
LOOKSIZ DB      0                       ;AN000;; 0 if byte, NZ if word  2/17/KK
KISTR001E       label   byte            ;AN000;; 2/17/KK





; the nul device driver used to be part of the code.  However, since the
; header is in the data, and the entry points are only given as an offset,
; the strategy and interrupt entry points must also be in the data now.
;

        assume  ds:nothing,es:nothing,ss:nothing,cs:v86group
        public  sNulDev,iNulDev
sNulDev proc    far
;???    mov     es:[bx].NDRbyte,0
        or      es:[bx].reqstat,stdon   ; set done bit
iNulDev:
        ret                             ; must not be a return!
sNulDev endp



;M044
; Second part of save area for saving last para of Windows memory
;
public WinoldPatch2
WinoldPatch2    db      8 dup (?)       ; M044

public  UmbSave2, UmbSaveFlag           ; M062
UmbSave2        db      5 dup (?)       ; M062
UmbSaveFlag     db      0               ; M062

public Mark2
        Mark2   label byte


;
; The following table defines CLASS ACTION and LOCUS info for the INT 21H
; errors.  Each entry is 4 bytes long:
;
;       Err#,Class,Action,Locus
;
; A value of 0FFh indicates a call specific value (ie.  should already
; be set).  AN ERROR CODE NOT IN THE TABLE FALLS THROUGH TO THE CATCH ALL AT
; THE END, IT IS ASSUMED THAT CLASS, ACTION, LOCUS IS ALREADY SET.

ErrTab  macro   err,class,action,locus
        DB  error_&err
        DB  errCLASS_&class
        DB  errACT_&action
        DB  errLOC_&locus
        endm

;class OUTRES  = 1
;class AUTH    = 3
;class APPERR  = 7
;class NOTFND  = 8
;class BADFMT  = 9
;class LOCKED  = 10
;class ALREADY = 12
;class UNK     = 13
;class CANT    = 14

;action RETRY  = 1
;action DLYRET = 2
;action ABORT  = 4
;action USER   = 3
;action PANIC  = 5

;locus UNK     = 1
;locus DISK    = 2
;locus NET     = 3
;locus MEM     = 5
ERRLOC_0FFH equ 0FFh

        public  Err_Table_21
Err_Table_21    label   byte
    ErrTab  INVALID_FUNCTION,       APPERR,     ABORT,      0FFh    ;1
    ErrTab  FILE_NOT_FOUND,         NOTFND,     USER,       DISK    ;2
    ErrTab  PATH_NOT_FOUND,         NOTFND,     USER,       DISK    ;3
    ErrTab  TOO_MANY_OPEN_FILES,    OUTRES,     ABORT,      UNK     ;4
    ErrTab  ACCESS_DENIED,          AUTH,       USER,       0FFh    ;5
    ErrTab  INVALID_HANDLE,         APPERR,     ABORT,      UNK     ;6
    ErrTab  ARENA_TRASHED,          APPERR,     PANIC,      MEM     ;7
    ErrTab  NOT_ENOUGH_MEMORY,      OUTRES,     ABORT,      MEM     ;8
    ErrTab  INVALID_BLOCK,          APPERR,     ABORT,      MEM     ;9
    ErrTab  BAD_ENVIRONMENT,        APPERR,     ABORT,      MEM     ;10
    ErrTab  BAD_FORMAT,             BADFMT,     USER,       UNK     ;11
    ErrTab  INVALID_ACCESS,         APPERR,     ABORT,      UNK     ;12
    ErrTab  INVALID_DATA,           BADFMT,     ABORT,      UNK     ;13
    ErrTab  INVALID_DRIVE,          NOTFND,     USER,       DISK    ;15
    ErrTab  CURRENT_DIRECTORY,      AUTH,       USER,       DISK    ;16
    ErrTab  NOT_SAME_DEVICE,        UNK,        USER,       DISK    ;17
    ErrTab  NO_MORE_FILES,          NOTFND,     USER,       DISK    ;18
    ErrTab  FILE_EXISTS,            ALREADY,    USER,       DISK    ;80
    ErrTab  SHARING_VIOLATION,      LOCKED,     DLYRET,     DISK    ;32
    ErrTab  LOCK_VIOLATION,         LOCKED,     DLYRET,     DISK    ;33
    ErrTab  OUT_OF_STRUCTURES,      OUTRES,     ABORT,      0FFh    ;84
    ErrTab  INVALID_PASSWORD,       AUTH,       USER,       UNK     ;86
    ErrTab  CANNOT_MAKE,            OUTRES,     ABORT,      DISK    ;82
    ErrTab  NOT_SUPPORTED,          BADFMT,     USER,       NET     ;50
    ErrTab  ALREADY_ASSIGNED,       ALREADY,    USER,       NET     ;85
    ErrTab  INVALID_PARAMETER,      BADFMT,     USER,       UNK     ;87
    ErrTab  FAIL_I24,               UNK,        ABORT,      UNK     ;83
    ErrTab  SHARING_BUFFER_EXCEEDED,OUTRES,     ABORT,      MEM     ;36
    ErrTab  Handle_EOF,             OutRes,     Abort,      Unk     ;38
    ErrTab  Handle_DISK_FULL,       OutRes,     Abort,      Unk     ;39
    ErrTab  sys_comp_not_loaded,    Unk,        Abort,      Disk    ;90

;-- MVDM additional entries
    ErrTab  NETWORK_ACCESS_DENIED,  APPERR,     ABORT,      UNK     ;65
    ErrTab  DUP_FCB,                UNK,        ABORT,      UNK     ;81
    ErrTab  INTERRUPT,              UNK,        RETRY,      UNK     ;95
    ErrTab  DRIVE_LOCKED,           LOCKED,     DLYRET,     DISK    ;108
    ErrTab  OPEN_FAILED,            NOTFND,     USER,       UNK     ;110
    ErrTab  BUFFER_OVERFLOW,        APPERR,     RETRY,      MEM     ;111
    ErrTab  DISK_FULL,              OUTRES,     USER,       DISK    ;112
    ErrTab  NO_MORE_SEARCH_HANDLES  OUTRES,     ABORT,      UNK     ;113
    ErrTab  INVALID_TARGET_HANDLE   APPERR,     ABORT,      UNK     ;114
    ErrTab  VIOKBD_REQUEST          APPERR,     ABORT,      UNK     ;116
    ErrTab  INVALID_CATEGORY        APPERR,     ABORT,      UNK     ;117
    ErrTab  INVALID_VERIFY_SWITCH   APPERR,     ABORT,      UNK     ;118
    ErrTab  BAD_DRIVER_LEVEL        APPERR,     ABORT,      DISK    ;119
    ErrTab  INVALID_NAME,           BADFMT,     USER,       UNK     ;123
    ErrTab  DIRECT_ACCESS_HANDLE,   CANT,       ABORT,      DISK    ;130
    ErrTab  BUSY_DRIVE,             ALREADY,    DLYRET,     DISK    ;142
    ErrTab  SAME_DRIVE,             CANT,       USER,       UNK     ;143
    ErrTab  DIR_NOT_ROOT,           CANT,       USER,       DISK    ;144
    ErrTab  DIR_NOT_EMPTY,          CANT,       USER,       DISK    ;145
    ErrTab  PATH_BUSY,              ALREADY,    USER,       UNK     ;148
    ErrTab  LABEL_TOO_LONG,         BADFMT,     USER,       DISK    ;154
    ErrTab  NOT_LOCKED,             CANT,       ABORT,      UNK     ;158
    ErrTab  BAD_ARGUMENTS,          BADFMT,     ABORT,      UNK     ;160
    ErrTab  BAD_PATHNAME,           BADFMT,     USER,       UNK     ;161
    ErrTab  ALREADY_EXISTS,         ALREADY,    USER,       UNK     ;183
    ErrTab  NOT_CURRENT_CTRY,       CANT,       ABORT,      UNK     ;204
    ErrTab  DEVICE_IN_USE           ALREADY,    DLYRET,     UNK     ;99
    ErrTab  INVALID_DTA,            APPERR,     ABORT,      MEM     ;96

;-- end of table
    DB      0FFh,                   0FFH,       0FFH,       0FFh


;
; The following table defines CLASS ACTION and LOCUS info for the INT 24H
; errors.  Each entry is 4 bytes long:
;
;       Err#,Class,Action,Locus
;
; A Locus value of 0FFh indicates a call specific value (ie.  should already
; be set).  AN ERROR CODE NOT IN THE TABLE FALLS THROUGH TO THE CATCH ALL AT
; THE END.

        public  Err_Table_24
Err_Table_24    label   byte
    ErrTab  WRITE_PROTECT,          MEDIA,      INTRET,     DISK    ;19
    ErrTab  BAD_UNIT,               INTRN,      PANIC,      UNK     ;20
    ErrTab  NOT_READY,              HRDFAIL,    INTRET,     0FFh    ;21
    ErrTab  BAD_COMMAND,            INTRN,      PANIC,      UNK     ;22
    ErrTab  CRC,                    MEDIA,      ABORT,      DISK    ;23
    ErrTab  BAD_LENGTH,             INTRN,      PANIC,      UNK     ;24
    ErrTab  SEEK,                   HRDFAIL,    RETRY,      DISK    ;25
    ErrTab  NOT_DOS_DISK,           MEDIA,      INTRET,     DISK    ;26
    ErrTab  SECTOR_NOT_FOUND,       MEDIA,      ABORT,      DISK    ;27
    ErrTab  OUT_OF_PAPER,           TEMPSIT,    INTRET,     SERDEV  ;28
    ErrTab  WRITE_FAULT,            HRDFAIL,    ABORT,      0FFh    ;29
    ErrTab  READ_FAULT,             HRDFAIL,    ABORT,      0FFh    ;30
    ErrTab  GEN_FAILURE,            UNK,        ABORT,      0FFh    ;31
    ErrTab  SHARING_VIOLATION,      LOCKED,     DLYRET,     DISK    ;32
    ErrTab  LOCK_VIOLATION,         LOCKED,     DLYRET,     DISK    ;33
    ErrTab  WRONG_DISK,             MEDIA,      INTRET,     DISK    ;34
    ErrTab  NOT_SUPPORTED,          BADFMT,     USER,       NET     ;50
    ErrTab  FCB_UNAVAILABLE,        APPERR,     ABORT,      UNK     ;35
    ErrTab  SHARING_BUFFER_EXCEEDED,OUTRES,     ABORT,      MEM     ;36

;-- MVDM Additional entries
    ErrTab  DISK_CHANGE,            MEDIA,      USER,       DISK    ;107 (33..34)
    ErrTab  UNCERTAIN_MEDIA,        INTRN,      ABORT,      DISK    ;163
    ErrTab  MONITORS_NOT_SUPPORTED, CANT,       ABORT,      UNK     ;165
    ErrTab  INVALID_PARAMETER,      BADFMT,     USER,       UNK     ;87
    ErrTab  DEVICE_IN_USE,          TEMPSIT,    DLYRET,     UNK     ;99
    ErrTab  INVALID_DTA,            APPERR,     ABORT,      MEM     ;96

;-- end of table
    DB      0FFh,                   errCLASS_Unk, errACT_Panic, 0FFh

;
; We need to map old int 24 errors and device driver errors into the new set
; of errors.  The following table is indexed by the new errors
;
        public  ErrMap24
ErrMap24    label   byte
    DB  ERROR_WRITE_PROTECT             ;   00h
    DB  ERROR_BAD_UNIT                  ;   01h
    DB  ERROR_NOT_READY                 ;   02h
    DB  ERROR_BAD_COMMAND               ;   03h
    DB  ERROR_CRC                       ;   04h
    DB  ERROR_BAD_LENGTH                ;   05h
    DB  ERROR_SEEK                      ;   06h
    DB  ERROR_NOT_DOS_DISK              ;   07h
    DB  ERROR_SECTOR_NOT_FOUND          ;   08h
    DB  ERROR_OUT_OF_PAPER              ;   09h
    DB  ERROR_WRITE_FAULT               ;   0Ah
    DB  ERROR_READ_FAULT                ;   0Bh
    DB  ERROR_GEN_FAILURE               ;   0Ch
    DB  ERROR_DISK_CHANGE               ;   0Dh [DOS 6 = Error_GEN_failure]
    DB  ERROR_GEN_FAILURE               ;   0Eh  RESERVED
    DB  ERROR_WRONG_DISK                ;   0Fh

    DB  ERROR_UNCERTAIN_MEDIA           ;   10h
    DB  ERROR_INTERRUPT                 ;   11h
    DB  ERROR_MONITORS_NOT_SUPPORTED    ;   12h
    DB  ERROR_INVALID_PARAMETER         ;   13h
    DB  ERROR_DEVICE_IN_USE             ;   14h

Public  ErrMap24End
ErrMap24End LABEL   BYTE


public  FIRST_BUFF_ADDR,SPECIAL_VERSION,FAKE_COUNT,OLD_FIRSTCLUS
FIRST_BUFF_ADDR dw      ?       ; first buffer address
SPECIAL_VERSION dw      0       ;AN006; used by INT 2F 47H
FAKE_COUNT      db      -1      ;AN008; fake version count
OLD_FIRSTCLUS   dw      ?       ;AN011; save old first cluster for fastopen




                PUBLIC  exec_init_SP,exec_init_IP
                PUBLIC  exec_init_SS,exec_init_CS
exec_init_SP    DW      ?
exec_init_SS    DW      ?
exec_init_IP    DW      ?
exec_init_CS    DW      ?
                PUBLIC  Exec_signature
Exec_signature  EXE_FILE <>



;SR;
; WIN386 instance table for DOS
;
public  Win386_Info
Win386_Info     db      3, 0
                dd      0, 0, 0
                dw      offset v86group:Instance_Table, 0


public  Instance_Table
Instance_Table  dw      offset v86group:contpos, 0, 2
                dw      offset v86group:bcon, 0, 4
                dw      offset v86group:carpos, 0, 106h
                dw      offset v86group:charco, 0, 1
                dw      offset v86group:exec_init_sp, 0, 34      ; M074
                dw      offset v86group:umbflag,0,1              ; M019
                dw      offset v86group:umb_head,0,2             ; M019
                dw      0, 0

; M001; SR;
; M001; On DOSMGR call ( cx == 0 ), we need to return a table of offsets of
; M001; some DOS variables. Note that the only really important variable in
; M001; this is User_Id. The other variables are needed only to patch stuff
; M001; which does not need to be done in DOS 5.0.
; M001;
public  Win386_DOSVars
Win386_DOSVars  db      5               ;Major version 5 ; M001
                db      0               ;Minor version 0 ; M001
                dw      offset v86group:SaveDS   ; M001
                dw      offset v86group:SaveBX   ; M001
                dw      offset v86group:Indos    ; M001
                dw      offset v86group:User_id  ; M001
                dw      offset v86group:CritPatch ; M001
                dw      offset v86group:UMB_Head ; M012

;SR;
; Flag to indicate whether WIN386 is running or not
;
public  IsWin386
IsWin386                db      0

;M018
; This variable contains the path to the VxD device needed for Win386
;
public  VxDpath                                 ;M018
VxDpath         db      'c:\wina20.386',0               ;M018

;
;End WIN386 support
;



; These variables have been added for the special lie support for device
;drivers.
                PUBLIC  DriverLoad
                public  BiosDataPtr
DriverLoad      db      1       ;initialized to do special handling
BiosDataPtr     dd      ?

;------------------------------------------------------------------------
; Patch for Sidekick
; A documented method for finding the offset of the Errormode flag in the
; dos swappable data area if for the app to scan in the dos segment (data)
; for the following sequence of instructions.
; Ref: Part C, Artice 11, pg 356 of MSDOS Encyclopedia
; The Offset of Errormode flag is 0320h
;------------------------------------------------------------------------

        db      036h, 0F6h, 006h, 020h, 003h, 0FFh ; test ss:[errormode], -1
        db      075h, 00Ch                         ; jnz  NearLabel
        db      036h, 0FFh, 036h, 058h, 003h       ; push ss:[NearWord]
        db      0CDh, 028h                         ; int  28h

;--------------------------------------------------------------------------
; Patch for PortOfEntry - M036
; PortOfEntry by Sector Technology uses an un documented way of determining
; the offset of Errormode flag. The following patch is to support them in
; DOS 5.0. The corresponding code is actually in msdisp.asm
;---------------------------------------------------------------------------

        db      080h, 03Eh, 020h, 003h, 000h     ; cmp  [errormode], 0
        db      075h, 037h                       ; jnz  NearLabel
        db      0BCh, 0A0h, 00Ah                 ; mov  sp, dosdata:iostack

;
;*** New FCB Implementation
; This variable is used as a cache in the new FCB implementation to remember
;the address of a local SFT that can be recycled for a regenerate operation
;

public  LocalSFT
LocalSFT                dd      0       ;0 to indicate invalid pointer


V86DATA ENDS

        END
