summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/MAPPER')
-rw-r--r--v4.0/src/MAPPER/ALLOCSEG.ASM87
-rw-r--r--v4.0/src/MAPPER/BEEP.ASM97
-rw-r--r--v4.0/src/MAPPER/CASEMAP.ASM73
-rw-r--r--v4.0/src/MAPPER/CHARIN.ASM112
-rw-r--r--v4.0/src/MAPPER/CHDIR.ASM74
-rw-r--r--v4.0/src/MAPPER/CLOSE.ASM74
-rw-r--r--v4.0/src/MAPPER/CWAIT.ASM90
-rw-r--r--v4.0/src/MAPPER/DBCS.ASM71
-rw-r--r--v4.0/src/MAPPER/DELETE.ASM70
-rw-r--r--v4.0/src/MAPPER/DEVCONFG.ASM117
-rw-r--r--v4.0/src/MAPPER/D_GCTRCD.ASM47
-rw-r--r--v4.0/src/MAPPER/ERROR.ASM149
-rw-r--r--v4.0/src/MAPPER/ERROR.INC285
-rw-r--r--v4.0/src/MAPPER/EXECPGM.ASM117
-rw-r--r--v4.0/src/MAPPER/EXIT.ASM58
-rw-r--r--v4.0/src/MAPPER/FIND.INC37
-rw-r--r--v4.0/src/MAPPER/FLUSHBUF.ASM57
-rw-r--r--v4.0/src/MAPPER/FREESEG.ASM65
-rw-r--r--v4.0/src/MAPPER/F_CLOSE.ASM104
-rw-r--r--v4.0/src/MAPPER/F_FIRST.ASM354
-rw-r--r--v4.0/src/MAPPER/F_NEXT.ASM271
-rw-r--r--v4.0/src/MAPPER/GETCNTRY.ASM135
-rw-r--r--v4.0/src/MAPPER/GETMSG.ASM586
-rw-r--r--v4.0/src/MAPPER/GETVER.ASM49
-rw-r--r--v4.0/src/MAPPER/GET_TOD.ASM67
-rw-r--r--v4.0/src/MAPPER/GMACHMOD.ASM40
-rw-r--r--v4.0/src/MAPPER/IOCTL.ASM93
-rw-r--r--v4.0/src/MAPPER/KBD.INC35
-rw-r--r--v4.0/src/MAPPER/KBDGSTAT.ASM76
-rw-r--r--v4.0/src/MAPPER/KBDSSTAT.ASM129
-rw-r--r--v4.0/src/MAPPER/LSEEK.ASM68
-rw-r--r--v4.0/src/MAPPER/MACROS.INC46
-rw-r--r--v4.0/src/MAPPER/MAKEFILE132
-rw-r--r--v4.0/src/MAPPER/MAPPER.INC23
-rw-r--r--v4.0/src/MAPPER/MAPPER.LBR57
-rw-r--r--v4.0/src/MAPPER/MESSAGES.INC88
-rw-r--r--v4.0/src/MAPPER/MKDIR.ASM53
-rw-r--r--v4.0/src/MAPPER/MSC.INC16
-rw-r--r--v4.0/src/MAPPER/NLSAPI.INC17
-rw-r--r--v4.0/src/MAPPER/OLDGETCN.ASM132
-rw-r--r--v4.0/src/MAPPER/OPEN.ASM289
-rw-r--r--v4.0/src/MAPPER/OPENPTMS.DAT502
-rw-r--r--v4.0/src/MAPPER/PUTMSG.ASM67
-rw-r--r--v4.0/src/MAPPER/QCURDIR.ASM104
-rw-r--r--v4.0/src/MAPPER/QCURDSK.ASM148
-rw-r--r--v4.0/src/MAPPER/QFILEINF.ASM146
-rw-r--r--v4.0/src/MAPPER/QFILEMOD.ASM64
-rw-r--r--v4.0/src/MAPPER/QFSINFO.ASM136
-rw-r--r--v4.0/src/MAPPER/QHANDTYP.ASM76
-rw-r--r--v4.0/src/MAPPER/QVERIFY.ASM54
-rw-r--r--v4.0/src/MAPPER/READ.ASM63
-rw-r--r--v4.0/src/MAPPER/REALLSEG.ASM81
-rw-r--r--v4.0/src/MAPPER/RMDIR.ASM53
-rw-r--r--v4.0/src/MAPPER/SCNTRY.ASM57
-rw-r--r--v4.0/src/MAPPER/SCROLLUP.ASM103
-rw-r--r--v4.0/src/MAPPER/SCURPOS.ASM72
-rw-r--r--v4.0/src/MAPPER/SEL_DISK.ASM54
-rw-r--r--v4.0/src/MAPPER/SETFSINF.ASM105
-rw-r--r--v4.0/src/MAPPER/SETINT24.ASM94
-rw-r--r--v4.0/src/MAPPER/SET_TOD.ASM76
-rw-r--r--v4.0/src/MAPPER/SFILEINF.ASM89
-rw-r--r--v4.0/src/MAPPER/SFILEMOD.ASM61
-rw-r--r--v4.0/src/MAPPER/SIGHAND.ASM204
-rw-r--r--v4.0/src/MAPPER/SVERIFY.ASM59
-rw-r--r--v4.0/src/MAPPER/WCHSTRA.ASM115
-rw-r--r--v4.0/src/MAPPER/WRITE.ASM64
66 files changed, 7187 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/ALLOCSEG.ASM b/v4.0/src/MAPPER/ALLOCSEG.ASM
new file mode 100644
index 0000000..36de869
--- /dev/null
+++ b/v4.0/src/MAPPER/ALLOCSEG.ASM
@@ -0,0 +1,87 @@
1;0
2page 80,132
3;
4title CP/DOS DosAllocSeg mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosAllocSeg
12; *
13; * FUNCTION: This module allocates a segment of memory to the
14; * requesting process
15; *
16; * CALLING SEQUENCE:
17; *
18; * push size ; number of bytes requested
19; * push@ selector ; selector allocated (returned)
20; * push shareind ; whether segment will be shared
21; * call dosallocseg
22; *
23; * RETURN SEQUENCE:
24; *
25; * AX = error , 0 = no error
26; *
27; * MODULES CALLED: DOS int 21h
28; *
29; *************************************************************************
30;
31 public dosallocseg
32 .sall
33 .xlist
34 include macros.inc
35 .list
36;
37str struc
38old_bp dw ?
39return dd ?
40ShareIndicator dw ? ; whether segment will be shared
41SelectorPtr dd ? ; selector allocated
42SegmentSize dw ? ; number of bytes requested
43str ends
44
45dosallocseg proc far
46 Enter dosallocseg ; push registers
47
48 mov bx,[bp].SegmentSize ; Get segment size
49
50 test bx,0000fh ; check segment size
51 jz NoRoundRequired
52
53 and bx,not 0000fh
54 add bx,00010h
55
56NoRoundRequired:
57 cmp bx,0 ; check for 0 (full seg)
58 je AllocateMax ; jmp to full seg
59
60 shr bx,1 ; convert segment in bytes to
61 shr bx,1 ; paragraph
62 shr bx,1
63 shr bx,1
64 jmp HaveSize
65
66AllocateMax:
67 mov bx,4096 ; setup default paragraph size
68
69HaveSize:
70 mov ah,48h ; set up for dos allocate call
71 int 21h ; allocate segment
72 jc ErrorExit ; jump if error
73
74 lds si,[bp].SelectorPtr ; get selector address
75 mov ds:[si],ax ; save allocated memory block
76
77AllocDone:
78 sub ax,ax ; set good return code
79ErrorExit:
80 mexit ; pop registers
81 ret size str - 6 ; return
82
83dosallocseg endp
84
85dosxxx ends
86
87 end
diff --git a/v4.0/src/MAPPER/BEEP.ASM b/v4.0/src/MAPPER/BEEP.ASM
new file mode 100644
index 0000000..27f8893
--- /dev/null
+++ b/v4.0/src/MAPPER/BEEP.ASM
@@ -0,0 +1,97 @@
1page 80,132
2
3title CP/DOS DosBeep mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7
8;**********************************************************************
9;*
10;* MODULE: dosbeep
11;*
12;* FUNCTION: generate a tone with desired frequency and duration
13;*
14;* CALLING SEQUENCE:
15;*
16;* push word frequency
17;* push word duration (in milliseconds)
18;* call dosbeep
19;*
20;* MODULES CALLED: none
21;*
22;*********************************************************************
23
24 public dosbeep
25 .sall
26 include macros.inc
27
28inv_parm equ 0002h ;invalid parameter return code
29
30str struc
31old_bp dw ?
32return dd ?
33duratn dw ? ; duration
34frqncy dw ? ; frequency
35str ends
36
37dosbeep proc far
38 Enter DosBeep
39
40 mov al,10110110b ; Set 8253 chip channel 2
41 out 43h,al ; to proper mode for tone
42
43; Channel 2 is now set up as a frequency divider. The sixteen bit
44; value sent to that port (in low-high format) is divided into
45; 1.19 MHz, the clock speed. In order to send the proper value
46; to the register, then, the frequency requested must be divided
47; into 1,190,000.
48
49 mov dx,012h ; MSB of 1.19M
50 mov ax,2970h ; LSB of 1.19M
51 mov cx,[bp].frqncy ; divisor
52 mov bx,025h ; check frequency range
53 cmp cx,bx ; frequency ok ??
54 jl error ; branch if error
55
56 mov bx,7fffh
57 cmp cx,bx
58 jg error
59 div cx ; then divide
60
61 out 42h,al ; and output
62 mov al,ah ; directly to
63 out 42h,al ; the 8253 port.
64
65; Turn on speaker
66
67 in al,61h ; Save original value
68 mov ah,al ; in ah
69 or al,3 ; Turn on control bit
70 out 61h,al ; in 8255 chip
71
72; Now loop for DURATN milliseconds
73
74 mov cx,[bp].duratn ; load value
75delay: mov bx,196 ; inner loop count
76del2: dec bx ; a millisecond
77 jne del2 ; for each
78 loop delay ; iteration
79
80; Turn speaker off
81
82 mov al,ah ; replace
83 out 61h,al ; original value
84
85 sub ax,ax ; set no error code
86 jmp exit ; return
87
88error: mov ax,inv_parm
89
90exit: MExit ; pop registers
91 ret size str - 6 ; return
92
93dosbeep endp
94
95dosxxx ends
96
97 end
diff --git a/v4.0/src/MAPPER/CASEMAP.ASM b/v4.0/src/MAPPER/CASEMAP.ASM
new file mode 100644
index 0000000..900ad4f
--- /dev/null
+++ b/v4.0/src/MAPPER/CASEMAP.ASM
@@ -0,0 +1,73 @@
1
2;
3page 80,132
4;
5title CP/DOS DosCaseMap
6;
7dosxxx segment byte public 'dos'
8 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
9
10;**********************************************************************
11;*
12;* MODULE: doscasemap
13;*
14;*
15;* CALLING SEQUENCE:
16;*
17;* PUSH WORD Length
18;* PUSH@ DWORD CountryCode
19;* PUSH@ DWORD BinaryString
20;* DosCaseMap
21;*
22;* MODULES CALLED: none
23;*
24;*********************************************************************
25
26 public doscasemap
27 .sall
28 include macros.inc
29
30str struc
31old_bp dw ?
32return dd ?
33StringPtr dd ? ; binary string pointer
34CountryCodePtr dd ? ; country code pointer
35StringLength dw ? ; lenght of the string
36str ends
37
38DosCaseMap proc far
39
40 Enter DosCaseMap ; save registers
41
42; Get the country, so we can then get the country case map stuff
43
44 lds si,[bp].CountryCodePtr
45 mov ax,ds:[si]
46
47; Note: do the country selection later (maybe never)
48
49 lds si,[bp].StringPtr
50 mov cx,[bp].StringLength
51
52MapLoop: ; convert characters to upper case
53 lodsb
54 cmp al,'a'
55 jc ThisCharDone
56
57 cmp al,'z'+1
58 jnc ThisCharDone
59
60 add al,'A' - 'a'
61 mov ds:[si-1],al
62
63ThisCharDone:
64 loop MapLoop ; loop until string is complete
65
66 MExit ; pop registers
67 ret size str - 6 ; return
68;
69DosCaseMap endp
70
71dosxxx ends
72
73 end
diff --git a/v4.0/src/MAPPER/CHARIN.ASM b/v4.0/src/MAPPER/CHARIN.ASM
new file mode 100644
index 0000000..384d05f
--- /dev/null
+++ b/v4.0/src/MAPPER/CHARIN.ASM
@@ -0,0 +1,112 @@
1
2;
3page 80,132
4;0
5title CP/DOS KbdCharIn mapper
6;
7kbdxxx segment byte public 'kbd'
8 assume cs:kbdxxx,ds:nothing,es:nothing,ss:nothing
9;
10; ************************************************************************* *
11; *
12; * MODULE: kbdcharin
13; *
14; * FILE NAME: charin.asm
15; *
16; * CALLING SEQUENCE:
17; *
18; * push@ dword chardata ; buffer for data
19; * push word iowait ; Indicate if wait
20; * push word kbdhandle ; Keyboard Handle
21; *
22; * call kbdcharin
23; *
24; *
25; * MODULES CALLED: BIOS int 16h
26; * PC-DOS Int 21h, ah=2ch, get time
27; *
28; *************************************************************************
29
30 public kbdcharin
31 .sall
32 .xlist
33 include kbd.inc
34 .list
35 extrn savedkbdinput:word
36
37
38
39error_kbd_parameter equ 0002h
40
41str struc
42old_bp dw ?
43return dd ?
44handle dw ? ; keyboard handle
45iowait dw ? ; indicate if wait for io
46data dd ? ; data buffer pointer
47str ends
48
49
50kbdcharin proc far
51
52 Enter KbdCharIn ; save registers
53 lds si,[bp].data ; set up return data area
54loopx:
55 mov ax,savedkbdinput
56 cmp ah,0
57 je nosavedchar
58
59 mov savedkbdinput,0
60 jmp avail
61
62nosavedchar:
63 mov ah,0bh ; Check for ^C
64 int 021h
65
66 mov ah,06
67 mov dl,-1
68 int 021h
69 jnz avail
70
71 mov ax,[bp].iowait ; else, see if wait is desired
72 cmp ax,0 ; if so,
73 jz loopx ; keep trying
74 ; else...
75 mov ds:[si].Char_Code,0 ; | zero out scan and char codes
76 mov ds:[si].Scan_Code,0 ; | zero out scan and char codes
77 mov ds:[si].Status,0 ; | 0 for status
78 jmp short shift ; | go to get shift status
79 ; end of block
80
81avail:
82 cmp al,0
83 je loopx
84 mov ds:[si].Scan_Code,0 ; |
85 mov ds:[si].Char_Code,al ; | move char&scan code into structure
86 mov ds:[si].Status,1 ; | 1 for status
87 ;
88shift: mov ah,02h ; Start of shift check block
89 int 16h ; | BIOS call to get shift state
90
91 sub ah,ah ; |
92 mov ds:[si].Shift_State,ax ; | put shift status into structure
93
94 mov ah,2ch ; start time stamping
95 int 21h ; | get current time of day
96
97 mov byte ptr ds:[si].Time+0,ch ; | put hours into structure
98 mov byte ptr ds:[si].Time+1,cl ; | put minutes into structure
99 mov byte ptr ds:[si].Time+2,dh ; | put seconds into structure
100 mov byte ptr cs:[si].Time+3,dl ; | put hundreds into structure
101
102
103 sub ax,ax ; set good return code
104 Mexit ; pop registers
105
106 ret size str - 6 ; return
107
108kbdcharin endp
109
110kbdxxx ends
111
112 end
diff --git a/v4.0/src/MAPPER/CHDIR.ASM b/v4.0/src/MAPPER/CHDIR.ASM
new file mode 100644
index 0000000..5143b26
--- /dev/null
+++ b/v4.0/src/MAPPER/CHDIR.ASM
@@ -0,0 +1,74 @@
1;
2page 80,132
3;
4title CP/DOS DosChDir mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosChDir
12; *
13; * FUNCTION: change directory name
14; *
15; * FUNCTION: This module will change the current directory for the
16; * requesting process.
17; *
18; *
19; * CALLING SEQUENCE:
20; *
21; * PUSH@ ASCIIZ Dirname ; Directory path name
22; * PUSH DWORD 0 ; Reserved (must be zero) took out @
23; * ; 5/28 to match 3/25 spec
24; * CALL DosChDir
25; *
26; *
27; * RETURN SEQUENCE:
28; *
29; * IF ERROR (AX NOT = 0)
30; *
31; * AX = Error Code:
32; *
33; * o Invalid directory path
34; *
35; * MODULES CALLED:
36; * DOS int 21h function 3Bh ; Change current directory
37; *
38; *************************************************************************
39
40 public DosChDir
41 .sall
42 .xlist
43 include macros.inc
44 .list
45
46str struc
47old_bp dw ?
48return dd ?
49dtrm006 dd 0h ;reserved (must be zero)
50dnam006 dd ? ;address of directory path name
51str ends
52
53DosChDir proc far
54 Enter DosChDir ; push registers
55
56 mov dx, word ptr [bp].dnam006 ;load directory name offset
57 mov ax, word ptr [bp].dnam006+2 ;load directory name segment
58
59 push ax ; set segment in DS
60 pop ds
61
62 mov ax,03b00h ; load chdir op code
63 int 21h ; call dos to change the directory
64 jc exit ; jump if error
65
66 xor ax,ax ; else, good return code
67exit: mexit ; pop registers
68 ret size str - 6 ; return
69
70DosChDir endp
71
72dosxxx ends
73
74 end
diff --git a/v4.0/src/MAPPER/CLOSE.ASM b/v4.0/src/MAPPER/CLOSE.ASM
new file mode 100644
index 0000000..ee7aa4c
--- /dev/null
+++ b/v4.0/src/MAPPER/CLOSE.ASM
@@ -0,0 +1,74 @@
1;0
2page 80,132
3
4title CP/DOS DosClose mapper * * *
5
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosClose
12; *
13; * FUNCTION: This module will close a file or a device.
14; *
15; * CALLING SEQUENCE:
16; *
17; * PUSH WORD FileHandle ; File Handle or device handle
18; * CALL DosClose
19; *
20; * RETURN SEQUENCE:
21; *
22; * IF ERROR (AX not = 0)
23; *
24; * AX = Error Code:
25; *
26; * o Invalid file handle
27; *
28; *
29; * MODULES CALLED: DOS int 21H function 3EH
30; *
31; *
32; *************************************************************************
33
34 public DosClose
35 .sall
36 .xlist
37 include macros.inc
38 .list
39
40str struc
41old_bp dw ?
42return dd ?
43FileHandle dw ? ; file or device handle
44str ends
45
46
47DosClose proc far
48 Enter DosClose ; push registers
49
50; Only files are closed. Devices are not closed, since OPEN creates
51; a dummy device handle without actually openning the device.
52
53 mov bx,[bp].FileHandle ; load the handle
54 mov ax,bx ; check for device handle
55 neg ax ; if device handle, return
56 jns GoodExit ; do not close the device
57
58FileCloseRequest:
59 mov ax,03e00h ; load opcode
60 int 21h ; close the file
61 jc ErrorExit ; return if error
62
63GoodExit:
64 sub ax,ax ; else, set good return code
65
66ErrorExit:
67 mexit ; pop registers
68 ret size str - 6 ; return
69
70DosClose endp
71
72dosxxx ends
73
74 end
diff --git a/v4.0/src/MAPPER/CWAIT.ASM b/v4.0/src/MAPPER/CWAIT.ASM
new file mode 100644
index 0000000..ed4a444
--- /dev/null
+++ b/v4.0/src/MAPPER/CWAIT.ASM
@@ -0,0 +1,90 @@
1;
2page 60,132
3;
4title CP/DOS DOSCWait mapper
5
6; ************************************************************************* *
7; *
8; * MODULE: DosCWait
9; *
10; * ACTION: Wait for a child termination
11; *
12; * CALLING SEQUENCE:
13; *
14; * push actioncode ; execution options
15; * push waitoption ; wait options
16; * push@ resultcode ; address to put result code
17; * push@ processidword ; address to put process id
18; * push processid ; process id of process to wait for
19; * call doscwait
20; *
21; * RETURN SEQUENCE:
22; *
23; *
24; *
25; * MODULES CALLED: None
26; *
27; *
28; *
29; *************************************************************************
30
31buffer segment word public 'buffer'
32
33 extrn DosExecPgmCalled:word
34 extrn DosExecPgmReturnCode:word
35
36buffer ends
37
38dosxxx segment byte public 'dos'
39 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
40
41 public doscwait
42 .sall
43 .xlist
44 include macros.inc
45 .list
46;
47str struc
48old_bp dw ?
49return dd ?
50Qprocessid dw ? ; Child process ID
51Aprocessid dd ? ; process id pointer
52resultcode dd ? ; result code pointer
53waitoption dw ? ; wait option
54actioncode dw ? ; action code
55str ends
56
57doscwait proc far
58 Enter doscwait ; push registers
59
60 mov ax,seg buffer
61 mov ds,ax ; set temporary buffer
62 assume ds:buffer
63
64 cmp DosExecPgmCalled,0 ; ??????
65 jz WeHaveExeced
66
67 mov ax,31
68 jmp ErrorExit ; error exit
69
70WeHaveExeced:
71 mov ax,DosExecPgmReturnCode
72 lds si,[bp].ResultCode
73 assume ds:nothing
74 mov ds:[si],ax ; return termination code
75
76 mov ax,[bp].Qprocessid ; return child process id
77 lds si,[bp].Aprocessid
78 mov ds:[si],ax
79
80 xor ax,ax ; set good return code
81
82ErrorExit:
83 Mexit ; pop registers
84 ret size str - 6 ; return
85
86doscwait endp
87
88dosxxx ends
89
90 end
diff --git a/v4.0/src/MAPPER/DBCS.ASM b/v4.0/src/MAPPER/DBCS.ASM
new file mode 100644
index 0000000..a856a09
--- /dev/null
+++ b/v4.0/src/MAPPER/DBCS.ASM
@@ -0,0 +1,71 @@
1;
2page 80,132
3;
4title CP/DOS DosGetDBCSEv
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: DosGetDBCSEv
12;*
13;* CALLING SEQUENCE:
14;*
15;* PUSH WORD Length
16;* PUSH@ DWORD Countrycode
17;* PUSH@ DWORD Memorybuffer
18;*
19;* MODULES CALLED: none
20;*
21;*********************************************************************
22;
23 public DosGetDBCSEv
24 .sall
25 include macros.inc
26
27str struc
28old_bp dw ?
29return dd ?
30DataAreaPtr dd ? ; Data buffer pointer
31CountryCodePtr dd ? ; Country code pointer
32DataAreaLength dw ? ; Length of data area
33str ends
34
35DosGetDBCSEv proc far
36
37 Enter DosGetDBCSEv ;AN000; push registers
38
39; Get the country, so we can then get the country case map stuff
40
41; lds si,[bp].CountryCodePtr
42; mov ax,ds:[si]
43
44; Note: do the country selection later (maybe never)
45
46 mov ax,6300H ;AN000; get DBCS vector
47 INT 21H ;AN000; DS:SI-->vector area
48
49 jc Exit
50Copy_Vector:
51 les di,[bp].DataAreaPtr ;AN000; ES:DI-->return buffer
52 mov cx,[bp].DataAreaLength ;AN000;
53loopx:
54 mov al,ds:[si] ;AN000;
55 mov es:[di],al ;AN000;
56 inc si ;AN000;
57 inc di ;AN000;
58 loop loopx ;AN000;
59
60 xor ax,ax ;AN000;
61
62Exit:
63 Mexit ;AN000;pop registers
64
65 ret size str - 6 ;AN000; return
66
67DosGetDBCSEv endp
68
69dosxxx ends
70
71 end
diff --git a/v4.0/src/MAPPER/DELETE.ASM b/v4.0/src/MAPPER/DELETE.ASM
new file mode 100644
index 0000000..c9dae66
--- /dev/null
+++ b/v4.0/src/MAPPER/DELETE.ASM
@@ -0,0 +1,70 @@
1;
2page 80,132
3;
4title CP/DOS DosDelete mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosDelete
12; *
13; * FILE NAME: DOS012.ASM
14; *
15; * FUNCTION: This module removes a directory entry associated with a
16; * filename.
17; *
18; *
19; * CALLING SEQUENCE:
20; *
21; * PUSH@ ASCIIZ FileName ; FileName path
22; * PUSH@ DWORD 0 ; Reserved (must be zero)
23; * CALL DosDelete
24; *
25; * RETURN SEQUENCE:
26; *
27; * IF ERROR (AX not = 0)
28; *
29; * AX = Error Code:
30; * o Invalid file path name
31; *
32; * MODULES CALLED: DOS int 21H function 41H
33; *
34; *
35; *
36; *************************************************************************
37
38 public DosDelete
39 .sall
40 .xlist
41 include macros.inc
42 .list
43
44str struc
45old_bp dw ?
46return dd ?
47dtrm12 dd ? ; reserved, always 0
48asc012 dd ? ; file name path pointer
49str ends
50
51DosDelete proc far
52 Enter DosDelete ; push registers
53
54 lds dx,dword ptr [bp].asc012 ; file path name
55
56 mov ah,041h
57 int 21h ; delete the file
58 jc err012 ; jump if no error
59
60 sub ax,ax ; set good return code
61
62err012:
63 mexit ; pop registers
64 ret size str - 6 ; return
65
66DosDelete endp
67
68dosxxx ends
69
70 end
diff --git a/v4.0/src/MAPPER/DEVCONFG.ASM b/v4.0/src/MAPPER/DEVCONFG.ASM
new file mode 100644
index 0000000..5715300
--- /dev/null
+++ b/v4.0/src/MAPPER/DEVCONFG.ASM
@@ -0,0 +1,117 @@
1;0
2page 60,132
3;
4title CP/DOS DosDevConfig mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosdevconfig
12;*
13;* FILE NAME: dos013.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ other returned info address
18;* push word item type being queried
19;* push word reserved parm(must be 0)
20;* call dosdevconfig
21;*
22;* MODULES CALLED: ROM BIOS Int 11, Equipment check
23;*
24;*********************************************************************
25
26 public dosdevconfig
27 .sall
28 include macros.inc
29
30inv_parm equ 0002h
31model_byte equ 0fffeh
32
33str struc
34old_bp dw ?
35return dd ?
36rsrvd dw ? ; reserved
37item dw ? ; item number
38data dd ? ; returned information
39str ends
40
41dosdevconfig proc far
42 Enter dosdevconfig ; push registers
43
44 mov ax,[bp].rsrvd ; reserved parm must
45 cmp ax,0 ; be zero
46 jne error ; if not zero, jump
47
48 mov ax,[bp].item ; range check
49 cmp ax,0
50 jl error ; if not zero, jump
51
52 cmp ax,3 ; covered by Int 11?
53 jg notint11
54 mov bx,ax ; ax destroyed by int
55
56 int 11h ; get peripherals on the system
57
58 xchg ax,bx ; restore ax
59
60 cmp ax,0 ; check number of printers??
61 jg notprint ; jump if not
62 mov cl,14 ; else, setup print bits
63 shr bx,cl ; in returned data
64 jmp short exit ; then return
65
66notprint: cmp ax,1 ; check for RS232 adapters??
67 jg diskchk ; jump if not
68 mov cl,4 ; else, setup RS232 bits
69 shl bx,cl ; clear top bits
70 mov cl,13
71 shr bx,cl ; shift back
72 jmp short exit
73
74diskchk: cmp ax,2 ; check for disk request??
75 jg math ; jump, if not
76 mov cl,8 ; else setup disk bits
77 shl bx,cl ; clear top bits
78 mov cl,14
79 shr bx,cl ; and shift back
80 inc bl ; 0=1 drive, etc.
81 jmp short exit
82
83math: cmp ax,3 ; check for math coprocessor
84 jg notint11 ; jump, if not
85 mov cl,14 ; else, setup math coprocessor
86 shl bx,cl ; bits in return data
87 mov cl,15
88 shr bx,cl
89 jmp short exit
90
91notint11: cmp ax,4 ; check for other valid item
92 je error
93 cmp ax,5 ; check for PC type ??
94 jg error ; jump if not so
95 push es ; else check for PC type
96 mov dx,0f000h ; read model byte from RAM
97 mov es,dx
98 mov al,es:model_byte ;model byte
99 pop es
100 sub al,0fch ;AT value = FC
101 jmp short exit ;all done, return
102
103error: mov ax,inv_parm
104 jmp short exit1
105
106exit: sub ax,ax ; set good return code
107 lds si,[bp].data ; set return data area address
108 mov byte ptr [si],bl ; save bit pattern in return
109 ; data area
110exit1: Mexit ; pop registers
111 ret size str - 6 ; return
112
113dosdevconfig endp
114
115dosxxx ends
116
117 end
diff --git a/v4.0/src/MAPPER/D_GCTRCD.ASM b/v4.0/src/MAPPER/D_GCTRCD.ASM
new file mode 100644
index 0000000..2c313b2
--- /dev/null
+++ b/v4.0/src/MAPPER/D_GCTRCD.ASM
@@ -0,0 +1,47 @@
1; SCCSID = @(#)d_gctrcd.asm 1.1 86/06/03
2.xlist
3; include struc.inc
4include nlsapi.inc
5.list
6
7DGROUP group _DATA
8
9_TEXT segment word public 'CODE'
10_TEXT ends
11
12_DATA segment word public 'DATA'
13 EXTRN _ApiSel:WORD
14_DATA ends
15
16_TEXT segment
17
18EXTRN W_NLS_APIS:near
19
20public DOSGETCTRYINFO
21DOSGETCTRYINFO proc far
22 assume cs:_TEXT
23
24
25 mov AX,BP ; Add 4 bytes of dummy parameters to the
26 mov BP,SP ; Stack by copying the return address down 4
27 push [BP+2]
28 push [BP]
29 mov BP,AX
30
31 push DS
32 mov AX,_DATA
33 mov DS,AX
34 mov AX, SETFILELIST
35 mov DS:_ApiSel,AX
36 pop DS
37
38 jmp W_NLS_APIS
39
40; pop bp
41; ret 14
42
43DOSGETCTRYINFO endp
44
45_TEXT ENDS
46 END
47 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/ERROR.ASM b/v4.0/src/MAPPER/ERROR.ASM
new file mode 100644
index 0000000..bf64801
--- /dev/null
+++ b/v4.0/src/MAPPER/ERROR.ASM
@@ -0,0 +1,149 @@
1;0
2page 80,132
3
4title CP/DOS DosError mapper
5
6
7;**********************************************************************
8;*
9;* MODULE: doserror
10;*
11;* ;AN000; PCDOS 4.00 ptm p2629 - Drive not ready yields FORMAT TERMINATED
12;*
13;*********************************************************************
14
15SystemIsHandling equ 1 ; system handles errors
16AppIsHandling equ 0 ; application handle errors
17
18;------------------------------------------------------------;;;
19databuff segment public 'databuff' ;;;
20 ;;;
21errorstate db SystemIsHandling ;;;
22 ;;;
23databuff ends ;;;
24;------------------------------------------------------------;;;
25
26
27dosxxx segment byte public 'dos'
28 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
29
30
31 public doserror
32 .sall
33 .xlist
34 include macros.inc
35 .list
36
37str struc
38old_bp dw ?
39Return dd ?
40Flag dw ? ; error flag; 0 = APP handle error
41str ends ; 1 = System handle error
42
43
44DosError proc far
45 Enter doserror ; Push registers
46
47 mov ax,seg databuff ;-->RW
48 mov ds,ax ;-->RW
49 assume ds:databuff ;-->RW
50
51 mov ax,[bp].flag ; get error flag
52 cmp ax,AppIsHandling ; check who should handle errors
53 je apperrorhandle ; branch if application handles error
54 cmp ax,SystemIsHandling ; system handle error ??
55 je syserrorhandle ; branch if true
56
57 mov ax,1 ; else, set error code
58 jmp exit ; return
59
60SysErrorHandle:
61
62 cmp errorstate,SystemIsHandling ; system handles error ??
63 jne setsys ; branch if not
64 xor ax,ax ; else set good return code
65 jmp exit ; return
66
67setsys: mov errorstate,SystemIsHandling ; set flag for system
68 lds dx,cs:prevadrs
69
70 mov ax,02524H
71 int 21h ; set new vector
72
73 xor ax,ax ; set good return code
74 jmp exit ; return
75
76
77AppErrorHandle:
78 cmp errorstate,AppIsHandling ; application handle errors
79 jne setapp ; branch if true
80
81 xor ax,ax ; else, set good error code
82 jmp exit ; return
83
84setapp: mov errorstate,AppIsHandling ; indicate app handles error
85 mov ax,03524h ; Get Interrupt 24 Vector
86 int 21h
87
88 mov word ptr cs:prevadrs+0,bx ; save it in prevadrs
89 mov word ptr cs:prevadrs+2,es
90
91 mov dx,cs
92 mov ds,dx
93 mov dx,offset ApiErrorHandler ; put error interrupt handler
94 ; as new vector
95 mov ax,02524H
96 int 21h ;set new vector
97
98 xor ax,ax ; set good error return
99
100exit: mexit ; pop all registers
101 ret size str - 6 ; return
102
103DosError endp
104
105 page
106
107
108
109
110
111;-------------------------------------------------------
112; **** Error Handler ******
113; This routine will get control on a hard error, returning an error.
114; If error is Drive not ready, keep retrying until drive IS ready or ^C
115;-------------------------------------------------------
116DriveNotReady equ 2 ;AN000;
117
118Ignore equ 0 ;AN000;
119Retry equ 1 ;AN000;
120Terminate equ 2 ;AN000;
121Fail equ 3 ;AN000;
122
123prevadrs dd ? ;AN000; ;save old interrupt handler address ;;;
124
125ApiErrorHandler proc near ;AN000;
126 pushf ;AN000;
127 cmp di,DriveNotReady ;AN000; Is it Drive Not Ready?
128 jne popf_and_fail_it ;AN000; If not, fail call and return
129
130Drive_Not_Ready: ;AN000; The drive is not ready!
131 call dword ptr cs:prevadrs ;AN000; Get user to respond
132 cmp al,Terminate ;AN000; For any resonse other than terminate,
133 jne retry_it ;AN000; retry the operation
134 int 023h ;AN000; Otherwise terminate via INT 023h
135
136popf_and_fail_it: ;AN000; Fail the operation
137 pop ax ;AN000; Remove garbage from stack
138 mov al,Fail ;AN000; Func code for fail
139 jmp rett ;AN000;
140retry_it: ;AN000; Retry the operation
141 mov al,Retry ;AN000; Func code for retry
142rett: ;AN000;
143 iret ;AN000; return
144Apierrorhandler endp
145;-------------------------------------------------------
146;-------------------------------------------------------
147
148dosxxx ends
149 end
diff --git a/v4.0/src/MAPPER/ERROR.INC b/v4.0/src/MAPPER/ERROR.INC
new file mode 100644
index 0000000..d19e498
--- /dev/null
+++ b/v4.0/src/MAPPER/ERROR.INC
@@ -0,0 +1,285 @@
1;break <CP/DOS error codes>
2
3; SCCSID = @(#)error.inc 6.2 86/02/27
4;
5; CP/DOS calls all return error codes through AX. If an error occurred then
6; the carry bit will be set and the error code is in AX. If no error occurred
7; then the carry bit is reset and AX contains returned info.
8;
9; Since the set of error codes is being extended as we extend the operating
10; system, we have provided a means for applications to ask the system for a
11; recommended course of action when they receive an error.
12;
13; The GetExtendedError system call returns a universal error, an error
14; location and a recommended course of action. The universal error code is
15; a symptom of the error REGARDLESS of the context in which GetExtendedError
16; is issued.
17;
18
19;
20; These are the 2.0 error codes
21;
22no_error EQU 0
23error_invalid_function EQU 1
24error_file_not_found EQU 2
25error_path_not_found EQU 3
26error_too_many_open_files EQU 4
27error_access_denied EQU 5
28error_invalid_handle EQU 6
29error_arena_trashed EQU 7
30error_not_enough_memory EQU 8
31error_invalid_block EQU 9
32error_bad_environment EQU 10
33error_bad_format EQU 11
34error_invalid_access EQU 12
35error_invalid_data EQU 13
36;**** reserved EQU 14 ; *****
37error_invalid_drive EQU 15
38error_current_directory EQU 16
39error_not_same_device EQU 17
40error_no_more_files EQU 18
41;
42; These are the universal int 24 mappings for the old INT 24 set of errors
43;
44error_write_protect EQU 19
45error_bad_unit EQU 20
46error_not_ready EQU 21
47error_bad_command EQU 22
48error_CRC EQU 23
49error_bad_length EQU 24
50error_Seek EQU 25
51error_not_DOS_disk EQU 26
52error_sector_not_found EQU 27
53error_out_of_paper EQU 28
54error_write_fault EQU 29
55error_read_fault EQU 30
56error_gen_failure EQU 31
57;
58; These are the new 3.0 error codes reported through INT 24
59;
60error_sharing_violation EQU 32
61error_lock_violation EQU 33
62error_wrong_disk EQU 34
63error_FCB_unavailable EQU 35
64error_sharing_buffer_exceeded EQU 36
65;
66; New OEM network-related errors are 50-79
67;
68error_not_supported EQU 50
69;
70; End of INT 24 reportable errors
71;
72error_file_exists EQU 80
73error_DUP_FCB EQU 81 ; *****
74error_cannot_make EQU 82
75error_FAIL_I24 EQU 83
76;
77; New 3.0 network related error codes
78;
79error_out_of_structures EQU 84
80error_Already_assigned EQU 85
81error_invalid_password EQU 86
82error_invalid_parameter EQU 87
83error_NET_write_fault EQU 88
84;
85; New error codes for 4.0
86;
87error_no_proc_slots EQU 89 ; no process slots available
88error_not_frozen EQU 90
89err_tstovfl EQU 91 ; timer service table overflow
90err_tstdup EQU 92 ; timer service table duplicate
91error_no_items EQU 93 ; There were no items to operate upon
92error_interrupt EQU 95 ; interrupted system call
93error_fixed_vector EQU 96 ; attempt to set fixed vector
94error_vector_used EQU 97 ; vector set by another process
95error_global_limit EQU 98 ; more than 16 vectors set
96error_vector_notset EQU 99 ; unsetting unallocated vector
97error_too_many_semaphores EQU 100 ; user/sys open sem limit hit
98error_sem_already_open EQU 101 ; attempt to open sem twice
99error_sem_is_set EQU 102 ; non-blk waitsem found it set
100error_sem_not_set EQU 103 ; tried to sig a non-owned sem
101error_sem_already_owned EQU 104 ; tried to wait on owned sem
102error_sem_owner_died EQU 105 ; waitsem found owner died
103error_sem_user_limit EQU 106 ; too many procs have this sem
104error_disk_change EQU 107 ; insert disk b into drive a
105error_drive_locked EQU 108 ; drive locked by another process
106error_broken_pipe EQU 109 ; write on pipe with no reader
107;
108; New error codes for CP/DOS
109;
110error_open_failed EQU 110 ; open/created failed due to
111 ; explicit fail command
112error_buffer_overflow EQU 111 ; buffer passed to system call
113 ; is too small to hold return
114 ; data.
115error_disk_full EQU 112 ; not enough space on the disk
116 ; (DOSNEWSIZE/w_NewSize)
117error_no_more_search_handles EQU 113 ; can't allocate another search
118 ; structure and handle.
119 ; (DOSFINDFIRST/w_FindFirst)
120error_invalid_target_handle EQU 114 ; Target handle in DOSDUPHANDLE
121 ; is invalid
122
123error_system_trace EQU 300 ; system trace error (DosSysTrace)
124error_ras_stcp EQU 301 ; system trace command processor error
125error_ras_createdd EQU 302 ; error in create dump diskette
126error_invalid_procid EQU 303 ; invalid process id
127error_invalid_pdelta EQU 304 ; invalid priority delta
128error_not_descendent EQU 305 ; not descendent
129error_request_notsm EQU 306 ; requestor not session manager
130error_invalid_pclass EQU 307 ; invalid p class
131error_invalid_scope EQU 308 ; invalid scope
132error_invalid_threadid EQU 309 ; invalid thread id
133error_msp_shrink EQU 310 ; can't shrink - MspSet
134error_msp_nomem EQU 311 ; no memory - MspAlloc
135error_msp_overlap EQU 312 ; overlap - MspFree
136error_msp_badsize EQU 313 ; bad size parameter - MspAlloc or MspFree
137error_msp_badflag EQU 314 ; bad flag parameter - MspSet
138error_msp_badselector EQU 315 ; invalid MspSegment Selector
139error_mr_msg_too_long EQU 316 ; message too long for buffer
140error_mr_mid_not_found EQU 317 ; message id number not found
141error_mr_un_acc_msgf EQU 318 ; unable to access message file
142error_mr_inv_msgf_format EQU 319 ; invalid message file format
143error_mr_inv_ivcount EQU 320 ; invalid insertion variable count
144error_mr_un_perform EQU 321 ; unable to perform function
145error_ts_wakeup EQU 322 ; unable to wake up
146error_ts_time EQU 323 ; time value < 0
147error_ts_notimer EQU 324 ; no times available
148error_ts_ticktype EQU 325 ; tick type not 0 or 1
149error_ts_handle EQU 326 ; invalid timer handle
150error_ts_datetime EQU 327 ; date or time invalid
151error_sys_internal EQU 328 ; internal system error
152error_que_current_name EQU 329 ; current name does not exist
153error_que_proc_not_owned EQU 330 ; current process does not own queue
154error_que_proc_owned EQU 331 ; current process owns queue
155error_que_duplicate EQU 332 ; duplicate name
156error_que_element_not_exist EQU 333 ; element does not exist
157error_que_no_memory EQU 334 ; inadequate memory
158error_que_invalid_name EQU 335 ; invalid name
159error_que_invalid_priority EQU 336 ; invalid priority parameter
160error_que_invalid_handle EQU 337 ; invalid queue handle
161error_que_link_not_found EQU 338 ; link not found
162error_que_memory_error EQU 339 ; memory error
163error_que_prev_at_end EQU 340 ; previous element was at end of queue
164error_que_proc_no_access EQU 341 ; process does not have access to queues
165error_que_empty EQU 342 ; queue is empty
166error_que_name_not_exist EQU 343 ; queue name does not exist
167error_que_not_initialized EQU 344 ; queues not initialized
168error_que_unable_to_access EQU 345 ; unable to access queues
169error_que_unable_to_add EQU 346 ; unable to add new queue
170error_que_unable_to_init EQU 347 ; unable to initialize queues
171error_vio_register EQU 348 ; vio register disallowed
172error_bvs_parameter EQU 349 ; invalid parameter supplied
173error_scs_call EQU 350 ; call issued by other than sm
174error_scs_value EQU 351 ; value is not for save or restore
175error_scs_wait_flag EQU 352 ; invalid wait flag setting
176error_scs_unlock EQU 353 ; screen not previously locked
177error_sm_init EQU 354 ; session mgr init failed
178error_sm_sgid EQU 355 ; invalid screen group id
179error_sm_nosg EQU 356 ; all screen groups in use
180error_kbd_parameter EQU 357 ; invalid parameter to kbd
181
182
183
184
185
186
187;
188; error codes for utilities
189;
190
191error_invalid_dosver EQU 1000 ; invalid dos version
192error_language_not_supported EQU 1001 ; language not supported
193error_msgfile_bad_format EQU 1002 ; bad message file format
194error_msgfile_bad_mid EQU 1003 ; message file has bad mid
195error_msgfile_outerror EQU 1004 ; error writing output file
196error_msgfile_inperror EQU 1005 ; error reading input file
197error_install_failed EQU 1006 ; install failed
198
199
200;
201; intercomponent error codes (from 8000H or 32768)
202;
203error_swapper_not_active EQU 32768 ; swapper is not active
204error_invalid_swapid EQU 32769 ; invalid swap identifier
205error_ioerr_swap_file EQU 32770 ; i/o error on swap file
206error_swap_table_full EQU 32771 ; swap control table is full
207error_swap_file_full EQU 32772 ; swap file is full
208error_cant_init_swapper EQU 32773 ; cannot initialize swapper
209error_swapper_already_init EQU 32774 ; swapper already initialized
210error_pmm_insufficient_memory EQU 32775 ; insufficient memory
211error_pmm_invalid_flags EQU 32776 ; invalid flags for phys. mem.
212error_pmm_invalid_address EQU 32777 ; invalid address of phys. mem.
213error_pmm_lock_failed EQU 32778 ; lock of storage failed
214error_pmm_unlock_failed EQU 32779 ; unlock of storage failed
215
216;break <Interrupt 24 error codes>
217
218error_I24_write_protect EQU 0
219error_I24_bad_unit EQU 1
220error_I24_not_ready EQU 2
221error_I24_bad_command EQU 3
222error_I24_CRC EQU 4
223error_I24_bad_length EQU 5
224error_I24_Seek EQU 6
225error_I24_not_DOS_disk EQU 7
226error_I24_sector_not_found EQU 8
227error_I24_out_of_paper EQU 9
228error_I24_write_fault EQU 0Ah
229error_I24_read_fault EQU 0Bh
230error_I24_gen_failure EQU 0Ch
231error_I24_disk_change EQU 0Dh
232error_I24_wrong_disk EQU 0Fh
233error_I24_Uncertain_media EQU 10h
234error_I24_Char_Call_Interrupted EQU 11h
235
236; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24
237
238Allowed_FAIL EQU 00001000B
239Allowed_RETRY EQU 00010000B
240Allowed_IGNORE EQU 00100000B
241;NOTE: ABORT is ALWAYS allowed
242
243I24_operation EQU 00000001B ;Z if READ,NZ if Write
244I24_area EQU 00000110B ; 00 if DOS
245 ; 01 if FAT
246 ; 10 if root DIR
247 ; 11 if DATA
248I24_class EQU 10000000B ;Z if DISK, NZ if FAT or char
249
250;break <GetExtendedError CLASSes ACTIONs LOCUSs>
251
252; Values for error CLASS
253
254errCLASS_OutRes EQU 1 ; Out of Resource
255errCLASS_TempSit EQU 2 ; Temporary Situation
256errCLASS_Auth EQU 3 ; Permission problem
257errCLASS_Intrn EQU 4 ; Internal System Error
258errCLASS_HrdFail EQU 5 ; Hardware Failure
259errCLASS_SysFail EQU 6 ; System Failure
260errCLASS_Apperr EQU 7 ; Application Error
261errCLASS_NotFnd EQU 8 ; Not Found
262errCLASS_BadFmt EQU 9 ; Bad Format
263errCLASS_Locked EQU 10 ; Locked
264errCLASS_Media EQU 11 ; Media Failure
265errCLASS_Already EQU 12 ; Collision with Existing Item
266errCLASS_Unk EQU 13 ; Unknown/other
267
268; Values for error ACTION
269
270errACT_Retry EQU 1 ; Retry
271errACT_DlyRet EQU 2 ; Delay Retry, retry after pause
272errACT_User EQU 3 ; Ask user to regive info
273errACT_Abort EQU 4 ; abort with clean up
274errACT_Panic EQU 5 ; abort immediately
275errACT_Ignore EQU 6 ; ignore
276errACT_IntRet EQU 7 ; Retry after User Intervention
277
278; Values for error LOCUS
279
280errLOC_Unk EQU 1 ; No appropriate value
281errLOC_Disk EQU 2 ; Random Access Mass Storage
282errLOC_Net EQU 3 ; Network
283errLOC_SerDev EQU 4 ; Serial Device
284errLOC_Mem EQU 5 ; Memory
285 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/EXECPGM.ASM b/v4.0/src/MAPPER/EXECPGM.ASM
new file mode 100644
index 0000000..738b950
--- /dev/null
+++ b/v4.0/src/MAPPER/EXECPGM.ASM
@@ -0,0 +1,117 @@
1;
2page 60,132
3;
4title CP/DOS DOSExecPrg mapper
5
6buffer segment word public 'buffer'
7 public DosExecPgmCalled
8DosExecPgmCalled db 0 ;????????????
9 public DosExecPgmReturnCode
10DosExecPgmReturnCode dw 0
11
12DosExecParameterBlock label word
13EnvironmentSegment dw 0
14ArgumentPointer dd 0
15Default_5C_FCB dd 0
16Default_6C_FCB dd 0
17
18buffer ends
19
20dosxxx segment byte public 'dos'
21 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
22;
23; ************************************************************************* *
24; *
25; * MODULE: DosExecPgm
26; *
27; * FUNCTION: Allows a program to execute another program
28; *
29; * CALLING SEQUENCE:
30; *
31; * push Asyncindic ; execute asynchronously
32; * push TraceIndic ; trace process
33; * push Argpointer ; address of arguments string
34; * push Envpointer ; address of environment string
35; * push Processid ; address to put process id
36; * push PgmPointer ; address of program filename
37; * call dosexecpgm
38; *
39; * RETURN SEQUENCE: AX = error code
40; *
41; *
42; *
43; * MODULES CALLED: INT 21H function 4BH and 4DH
44; *
45; *
46; *
47; *************************************************************************
48
49 public dosexecpgm
50 .sall
51 .xlist
52 include macros.inc
53 .list
54
55inv_parm equ 0002
56not_suf_mem equ 0004
57
58str struc
59old_bp dw ?
60return dd ?
61Pgmpointer dd ? ; address of program file name
62Processid dd ? ; this is used when only sync exec
63EnvPointer dd ? ; address of environment string
64ArgPointer dd ? ; address of argument string
65Traceindic dw ? ; ignored, what is a trace process?
66Asyncindic dw ? ; ignored, PC-DOS always waits!
67str ends
68
69dosexecpgm proc far ; push registers
70 Enter dosexecpgm
71
72 mov ax,seg buffer ; setup buffer segment
73 mov ds,ax ; and copy info into
74 assume ds:buffer ; data buffer
75
76 mov ax,word ptr [bp+2].EnvPointer ; seg portion only for pc-dos
77 mov EnvironmentSegment,ax ; copy environment string
78
79 les di,[bp].ArgPointer
80 mov word ptr ArgumentPointer+0,di ; copy argument string
81 mov word ptr ArgumentPointer+2,es
82
83 xor ax,ax
84 mov word ptr Default_5C_FCB+0,ax ; setup defaults
85 mov word ptr Default_5C_FCB+2,ax
86
87 mov word ptr Default_6C_FCB+0,ax
88 mov word ptr Default_6C_FCB+2,ax
89
90 mov bx,ds
91 mov es,bx
92 mov bx,offset buffer:DosExecParameterBlock
93
94 lds dx,[bp].PgmPointer ; setup program name
95 mov ax,4b00h
96 int 21h ; exec program and
97 jc ErrorExit ; check for error
98
99 mov ah,4dh
100 int 21h ; get return code of program
101 jc ErrorExit ; just executed and jump if
102 ; error
103 mov bx,seg buffer
104 mov ds,bx
105 mov DosExecPgmReturnCode,ax ; else, save return code
106
107 xor ax,ax ; set no error code
108
109ErrorExit:
110 Mexit ; pop registers
111 ret size str - 6 ; return
112
113dosexecpgm endp
114
115dosxxx ends
116
117 end
diff --git a/v4.0/src/MAPPER/EXIT.ASM b/v4.0/src/MAPPER/EXIT.ASM
new file mode 100644
index 0000000..5f98f70
--- /dev/null
+++ b/v4.0/src/MAPPER/EXIT.ASM
@@ -0,0 +1,58 @@
1;
2page 60,132
3;
4title CP/DOS DosExit mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosexit
12;*
13;* FUNCTION: Exit a process
14;*
15;* CALLING SEQUENCE:
16;*
17;* push word action code
18;* push word result code
19;* call dosexit
20;*
21;* MODULES CALLED: DOS Int 21h, Function 4ch, terminate process
22;*
23;*********************************************************************
24
25 public dosexit
26 .sall
27 include macros.inc
28
29str struc
30old_bp dw ?
31return dd ?
32Result dw ? ; result code
33Action dw ? ; action code
34str ends
35
36dosexit proc far
37
38 Enter DosExit ; push registers
39
40 mov ax,[bp].action ; set resule code area
41 cmp ax,1 ; check for valid action code
42 jg exit ; jump if invalid action code
43
44 mov ax,[bp].result ; else, set result code
45
46 mov ah,4ch ; load opcode
47 int 21h ; do exit
48
49 xor ax,ax ; set good return code
50
51exit: mexit ; pop registers
52 ret size str - 6 ; return
53
54dosexit endp
55
56dosxxx ends
57
58 end
diff --git a/v4.0/src/MAPPER/FIND.INC b/v4.0/src/MAPPER/FIND.INC
new file mode 100644
index 0000000..d4e1588
--- /dev/null
+++ b/v4.0/src/MAPPER/FIND.INC
@@ -0,0 +1,37 @@
1; find.inc
2
3 if1
4 %out find.inc
5 endif
6
7FileFindBuf struc
8Create_Date dw ?
9Create_Time dw ?
10Access_Date dw ?
11Access_Time dw ?
12Write_Date dw ?
13Write_Time dw ?
14File_Size dd ?
15FAlloc_Size dd ?
16Attributes dw ?
17String_Len db ?
18File_Name db 12 dup (?)
19FileFindBuf ends
20
21;
22; dta buffer structure
23;
24
25dtastr struc
26 db 21 dup (?)
27DTAFileAttrib db ?
28DTAFileTime dw ?
29DTAFileDate dw ?
30DTAFileSize dd ?
31DTAFileName db 13 dup (?)
32dtastr ends
33
34MaxFinds equ 8
35OpenedHandle equ 08000h
36
37 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/FLUSHBUF.ASM b/v4.0/src/MAPPER/FLUSHBUF.ASM
new file mode 100644
index 0000000..85e678a
--- /dev/null
+++ b/v4.0/src/MAPPER/FLUSHBUF.ASM
@@ -0,0 +1,57 @@
1;0
2page 80,132
3
4title CP/DOS KbdFlushBuffer mapper
5
6kbdxxx segment byte public 'kbd'
7 assume cs:kbdxxx,ds:nothing,es:nothing,ss:nothing
8
9; ************************************************************************* *
10; *
11; * MODULE: kbdflushbuffer
12; *
13; *************************************************************************
14;
15 public kbdflushbuffer
16 .sall
17 .xlist
18 include kbd.inc
19 .list
20
21 public savedkbdinput
22savedkbdinput label word
23 db 0 ; Character goes here
24 db 0 ; Not zero means char is here
25
26
27str struc
28old_bp dw ?
29return dd ?
30handle dw ? ; kbd handle
31str ends
32
33kbdflushbuffer proc far
34 Enter KbdFlushBuffer ; push registers
35 mov ah,0bh ; Check for ^C
36 int 021h
37
38 mov ax,0c06h
39 mov dl,-1
40 int 021h
41 jz nochar
42
43 mov ah,1
44 mov savedkbdinput,ax
45 jmp done
46nochar:
47 mov savedkbdinput,0
48
49done: sub ax,ax ; set good return code
50 Mexit ; pop registers
51 ret size str - 6 ; return
52
53kbdflushbuffer endp
54
55kbdxxx ends
56
57 end
diff --git a/v4.0/src/MAPPER/FREESEG.ASM b/v4.0/src/MAPPER/FREESEG.ASM
new file mode 100644
index 0000000..b3f2c1c
--- /dev/null
+++ b/v4.0/src/MAPPER/FREESEG.ASM
@@ -0,0 +1,65 @@
1;
2page 60,132
3;
4title CP/DOS DosFreeSeg mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosFreeSeg
12; *
13; * FILE NAME: dos023.asm
14; *
15; * FUNCTION: This module deallocates a segment
16; *
17; *
18; * CALLING SEQUENCE:
19; *
20; * push selector ; selector of the segment
21; * call dosfreeseg
22; *
23; * RETURN SEQUENCE:
24; *
25; * MODULES CALLED: DOS int 21h, ah=49h
26; *
27; *************************************************************************
28
29 public dosfreeseg
30 .sall
31 .xlist
32 include macros.inc
33 .list
34
35invalid_selector equ 0006h
36
37
38str struc
39Old_bp dw ?
40Return dd ?
41Selector dw ? ; selector of the segment to be freed
42str ends
43
44dosfreeseg proc far
45 Enter dosfreeseg ; push registers
46
47 mov es,[bp].selector ; get selector in es
48
49 mov ah,49h
50 int 21h ; free memory segment
51 jc error ; jump if error
52
53 sub ax,ax ; zero return code
54 jmp exit ; go to exit
55
56error: mov ax,invalid_selector ; put in error code
57
58exit: Mexit ; pop registers
59 ret size str - 6 ; return
60
61dosfreeseg endp
62
63dosxxx ends
64
65 end
diff --git a/v4.0/src/MAPPER/F_CLOSE.ASM b/v4.0/src/MAPPER/F_CLOSE.ASM
new file mode 100644
index 0000000..2da07b5
--- /dev/null
+++ b/v4.0/src/MAPPER/F_CLOSE.ASM
@@ -0,0 +1,104 @@
1page 80,132
2
3title CP/DOS DosFindClose mapper
4
5 include find.inc
6
7
8FindSegment segment word public 'find'
9
10; We will use the offset into the segment 'FindSegment' as the handle that we
11; return and use in subsequent FindNext and FindClose calls. The data that is
12; in the word is the offset into the 'FindSegment' to the DTA that we should
13; use.
14 extrn FindDTAs:word
15 extrn FindHandles:word
16
17FindSegment ends
18
19
20; ************************************************************************* *
21; *
22; * MODULE: DosFindClose
23; *
24; * FUNCTION: Close Find Handle
25; *
26; * FUNCTION: This module closes the directory handle used by CP/DOS
27; * in a find first/find next search. Since PC/DOS does not
28; * use directory handles it will simply return to the caller
29; * removing the parameters passed on the stack.
30; *
31; * CALLING SEQUENCE:
32; *
33; * PUSH WORD DirHandle ; Directory search handle
34; * CALL DosFindClose
35; *
36; *
37; * RETURN SEQUENCE:
38; *
39; * IF ERROR (AX not = 0)
40; *
41; * AX = Error Code:
42; *
43; *
44; * MODULES CALLED: None
45; *
46; *************************************************************************
47
48 public DosFindClose
49 .sall
50 .xlist
51 include macros.inc
52 .list
53
54str struc
55old_bp dw ?
56return dd ?
57DirHandle dw ? ; dirctory search handle
58str ends
59
60
61dosxxx segment byte public 'dos'
62 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
63
64DosFindClose proc far
65 Enter DosFindClose ; push registers
66
67 mov ax,seg FindSegment ; get address to our data
68 mov ds,ax
69 assume ds:FindSegment
70
71; Close the handle
72
73; The 'DirHandle' that the mapper returns from FindFirst, is the offset into
74; 'FindSegment' of the pointer to the DTA for that Handle. The 08000h bit
75; of the pointer is used to indicate that the handle is open. Reset the bit.
76
77; Special Logic to handle DirHandle = 1
78
79 mov si,[bp].DirHandle ; get directory hanlde
80 cmp si,1 ; handle = 1??
81 jne CheckForClose ; branch if not
82
83 mov si,offset FindSegment:FindHandles
84
85CheckForClose:
86 test ds:[si],OpenedHandle ; handle is open ??
87 jnz OkToClose ; go and close if it is open
88
89 mov ax,6 ; else load error code
90 jmp ErrorExit ; return
91
92OkToClose:
93 and ds:[si],not OpenedHandle ; set close flag
94 xor ax,ax ; set good return code
95
96ErrorExit:
97 mexit ; pop registers
98 ret size str - 6 ; return
99
100DosFindClose endp
101
102dosxxx ends
103
104 end
diff --git a/v4.0/src/MAPPER/F_FIRST.ASM b/v4.0/src/MAPPER/F_FIRST.ASM
new file mode 100644
index 0000000..90f6e7f
--- /dev/null
+++ b/v4.0/src/MAPPER/F_FIRST.ASM
@@ -0,0 +1,354 @@
1page 80,132
2
3title CP/DOS DosFindFirst mapper
4
5
6 include find.inc
7
8FindSegment segment word public 'find'
9
10 public SearchCount
11SearchCount dw 0
12 public ReturnBufferSave
13ReturnBufferSave dd 0
14 public CurrentDTA
15CurrentDTA dw 0
16 public ReturnLengthToGo
17ReturnLengthToGo dw 0
18
19 public SaveDTA
20SaveDTA Label dword
21 public SaveDTAOffset
22SaveDTAOffset dw 0
23 public SaveDTASegment
24SaveDTASegment dw 0
25 public SaveDTAFlag
26SaveDTAFlag db 0 ; 0 -> not saved
27 ; 1 -> is saved
28
29; We will use the offset into the segment 'FindSegment' as the handle that we
30; return and use in subsequent FindNext and FindClose calls. The data that is
31; in the word is the offset into the 'FindSegment' to the DTA that we should
32; use.
33
34 public FindDTAs
35FindDTAs label word
36 rept MaxFinds
37 dtastr <>
38 endm
39
40 public FindHandles
41FindHandles label word
42FindDTAIndex = 0
43 rept MaxFinds
44 dw FindDTAs + FindDTAIndex
45FindDTAIndex = FindDTAIndex + size dtastr
46 endm
47
48
49FindSegment ends
50
51dosxxx segment byte public 'dos'
52 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
53
54; ************************************************************************* *
55; *
56; * MODULE: DosFindFirst
57; *
58; * FILE NAME: DOS021.ASM
59; *
60; * FUNCTION: This module Finds the first filename that matches the
61; * specified file specification. The directory handle
62; * parameter passed will be ignored since PC/DOS does not
63; * support directory handles. The last access, last write
64; * and the creation date and time are all set to the same,
65; * because PC/DOS does not have seperate last access and
66; * last write fields in the directory. The allocation
67; * fields are set equal to the eod because of the same
68; * reason.
69; *
70; * CALLING SEQUENCE:
71; *
72; * PUSH@ ASCIIZ FileName ; File path name
73; * PUSH@ WORD DirHandle ; Directory search handle
74; * PUSH WORD Attribute ; Search attribute
75; * PUSH@ OTHER ResultBuf ; Result buffer
76; * PUSH DWORD ResultBufLen ; Result buffer length
77; * PUSH@ WORD SearchCount ; # of entries to find
78; * PUSH DWORD 0 ; Reserved (must be zero)
79; * CALL DosFindFirst
80; *
81; * RETURN SEQUENCE:
82; *
83; * IF ERROR (AX not = 0)
84; *
85; * AX = Error Code:
86; *
87; * o Invalid file path name
88; *
89; * o Invalid search attribute
90; *
91; * MODULES CALLED: DOS int 21H function 2FH
92; * DOS int 21H function 4EH
93; * DOS int 21H function 4FH
94; *
95; *************************************************************************
96;
97 public DosFindFirst
98 .sall
99 .xlist
100 include macros.inc
101 .list
102
103
104str struc
105old_bp dw ?
106return dd ?
107ReservedZero dd 0 ; reserved
108FindCountPtr dd ? ; number of entries to find
109FindBufferLen dw ? ; result buffer lenght
110FindBufferPtr dd ? ; result buffer pointer
111FileAttribute dw ? ; search attribute
112DirHandlePtr dd ? ; directory search handle
113PathNamePtr dd ? ; file path name pointer
114str ends
115
116
117DosFindFirst proc far
118
119 Enter DosFindFirst
120
121 mov ax,seg FindSegment ; get address to our data
122 mov ds,ax
123 assume ds:FindSegment
124
125; Search for an available Find Handle
126
127; The Dir handle that we will return is the offset into the 'FindSegment' that
128; the pointer to the DTA for that handle is at. Two special things:
129;
130; 1) when we see file handle one, will use the first pointer and DTA
131; 2) the high order bit of the DTA pointer is used to indicate that
132; the handle is allocated
133
134 mov si,offset FindSegment:FindHandles
135 mov cx,MaxFinds
136
137; DS:[SI] -> Find DTA Pointer Table
138; CX = number of Find DTAs
139
140; Incoming DirHandle = -1 ==> allocate a new dir handle
141
142 les di,[bp].DirHandlePtr
143 mov ax,es:[di]
144 cmp ax,-1
145 je AllocateHandle
146
147; Incoming DirHandle = 1, we will use the first DTA
148
149 cmp ax,1
150 je HandleFound
151
152; We have not been requested to allocate a new handle, and we are not using
153; DirHandle 1. At this time, we need to reuse the incoming handle, but only
154; if it is a valid (ie - previously allocated by us) DirHandle
155
156 mov si,ax ; verify it is an active handle
157 test ds:[si],OpenedHandle
158 jnz HandleFound ; jump if true
159
160 mov ax,6 ; else set error code
161 jmp ErrorExit ; return
162
163; Allocate a new handle from the DTA pointer list
164
165AllocateHandle:
166 add si,2
167 dec cx
168
169FindHandleLoop:
170 test ds:[si],OpenedHandle
171 jz HandleFound
172
173 add si,2
174 loop FindHandleLoop
175
176; No Handles available, return error
177
178 mov ax,4 ; report 'no handles available'
179 jmp ErrorExit ; error return - buffer not large enough
180
181
182; We have a handle, let's look for the file(s)
183
184HandleFound:
185 mov ax,ds:[si] ; get the dta pointer
186 or ds:[si],OpenedHandle ; allocate the handle
187 and ax,not OpenedHandle
188 mov CurrentDTA,ax
189
190 les di,[bp].DirHandlePtr ; the handle number we return is the
191 mov es:[di],si ; offset to the entry in FindSegment
192
193; save the callers dta so we can restore it later
194
195 mov ah,02fh ; get callers DTA
196 int 21h
197
198 mov SaveDTAOffset,bx ; save it
199 mov SaveDTASegment,es
200 mov SaveDTAFlag,1
201
202; Set the dta to our area
203
204 mov dx,CurrentDTA ; set DTA address
205 mov ah,1ah
206 int 21h
207
208; Get the count of files to search for
209
210 les di,[bp].FindCountPtr ; load result buffer pointer
211 mov ax,es:[di] ; save the search
212 mov SearchCount,ax ; count
213 mov es:word ptr [di],0 ; set found count to zero
214
215 cmp ax,0 ; just in case they try to trick us!
216 jne DoSearch
217
218 jmp SearchDone
219
220; Find first file
221
222DoSearch:
223 lds dx,[bp].PathNamePtr ; load address of asciiz string
224 assume ds:nothing
225 mov cx,[bp].FileAttribute ; load the attribute
226 mov ax,04E00h
227 int 21h ; find the first occurance of file
228 jnc FindFirstOK ; continue
229
230 jmp ErrorExit
231
232FindFirstOK:
233 mov ax,seg FindSegment
234 mov ds,ax
235 assume ds:FindSegment
236
237 mov ax,[bp].FindBufferLen ; load the buffer length
238 mov ReturnLengthToGo,ax ; save low order buffer length
239
240 les di,[bp].FindBufferPtr ; load result buffer pointer
241
242 mov word ptr ReturnBufferSave+0,di
243 mov word ptr ReturnBufferSave+2,es
244
245; Move find data into the return areas
246
247MoveFindData:
248 sub ReturnLengthToGo,size FileFindBuf ; check if result buffer is larg enough
249 jnc BufferLengthOk ; it is ok
250
251 mov ax,8 ; report 'Insufficient memory'
252 jmp ErrorExit ; error return - buffer not large enough
253
254BufferLengthOk:
255 mov si,CurrentDTA ; DS:SI -> our dta area
256 les di,ReturnBufferSave
257
258; At this point, the following MUST be true:
259; es:di -> where we are to put the resultant data
260; ds:si -> DTA from find (either first or next)
261
262 mov ax,ds:[si].DTAFileDate ; save date
263 mov es:[di].Create_Date,ax
264 mov es:[di].Access_Date,ax
265 mov es:[di].Write_Date,ax
266
267 mov ax,ds:[si].DTAFileTime ; save time
268 mov es:[di].Create_Time,ax
269 mov es:[di].Access_Time,ax
270 mov es:[di].Write_Time,ax
271
272 mov ax,ds:word ptr [si].DTAFileSize+0 ; save file size
273 mov es:word ptr [di].File_Size+0,ax
274 mov es:word ptr [di].FAlloc_Size+0,ax
275 mov ax,ds:word ptr [si].DTAFileSize+2
276 mov es:word ptr [di].File_Size+2,ax
277 mov es:word ptr [di].FAlloc_Size+2,ax
278
279 test es:word ptr [di].FAlloc_Size,001ffh
280 jz AllocateSizeSet
281
282 and es:word ptr [di].FAlloc_Size,not 001ffh
283 add es:word ptr [di].FAlloc_Size,00200h
284
285AllocateSizeSet:
286 xor ax,ax
287 mov al,ds:[si].DTAFileAttrib
288 mov es:[di].Attributes,ax
289
290 mov cx,12
291 mov bx,0
292
293MoveNameLoop:
294 mov al,ds:[si+bx].DTAFileName
295 cmp al,0
296 je EndOfName
297
298 mov es:[di+bx].File_Name,al
299 inc bx
300 loop MoveNameLoop
301
302EndOfName:
303 mov es:[di+bx].File_Name,0
304 mov ax,bx
305 mov es:[di].String_len,al
306
307 add di,bx
308 mov word ptr ReturnBufferSave+0,di
309 mov word ptr ReturnBufferSave+2,es
310
311 les di,[bp].FindCountPtr
312 inc word ptr es:[di]
313
314;
315; Check if the request was for more than one
316;
317 dec SearchCount
318 jz SearchDone
319
320 mov ax,04f00h ; set opcode
321 int 21h ; find next matching file
322 jc ErrorExit ; jump if error
323
324 les di,ReturnBufferSave ;
325 jmp MoveFindData
326
327SearchDone:
328 sub ax,ax ; set good return code
329
330ErrorExit:
331 push ax
332 mov ax,seg FindSegment
333 mov ds,ax
334 assume ds:FindSegment
335 cmp SaveDTAFlag,0
336 je DoNotRestore
337
338 mov SaveDTAFlag,0
339
340 lds dx,SaveDTA
341 mov ah,1ah ; load opcode
342 int 21h ; setup DTA
343
344DoNotRestore:
345 pop ax
346
347 mexit ; pop registers
348 ret size str - 6 ; return
349
350DosFindFirst endp
351
352dosxxx ends
353
354 end
diff --git a/v4.0/src/MAPPER/F_NEXT.ASM b/v4.0/src/MAPPER/F_NEXT.ASM
new file mode 100644
index 0000000..eaef626
--- /dev/null
+++ b/v4.0/src/MAPPER/F_NEXT.ASM
@@ -0,0 +1,271 @@
1;
2page 80,132
3;
4title CP/DOS DosFindNext mapper
5;
6
7 include find.inc
8
9FindSegment segment word public 'find'
10
11 extrn SearchCount:word
12 extrn ReturnBufferSave:dword
13 extrn CurrentDTA:word
14 extrn ReturnLengthToGo:word
15
16 extrn SaveDTA:dword
17 extrn SaveDTAOffset:word
18 extrn SaveDTASegment:word
19 extrn SaveDTAFlag:byte
20
21; We will use the offset into the segment 'FindSegment' as the handle that we
22; return and use in subsequent FindNext and FindClose calls. The data that is
23; in the word is the offset into the 'FindSegment' to the DTA that we should
24; use.
25
26 extrn FindDTAs:word
27
28 extrn FindHandles:word
29
30FindSegment ends
31
32dosxxx segment byte public 'dos'
33 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
34;
35; ************************************************************************* *
36; *
37; * MODULE: DosFindNext
38; *
39; * FILE NAME: DOS022.ASM
40; *
41; * FUNCTION: This module finds the next file in a sequence initiated
42; * by the find first the command.
43; *
44; *
45; *
46; *
47; * CALLING SEQUENCE:
48; *
49; * PUSH WORD DirHandle ; Directory search handle
50; * PUSH@ OTHER ResultBuf ; Result buffer
51; * PUSH DWORD ResultBufLen ; Result buffer length
52; * PUSH@ WORD SearchCount ; # of entries to find
53; * CALL DosFindNext
54; *
55; *
56; * RETURN SEQUENCE:
57; *
58; * IF ERROR (AX not = 0)
59; *
60; * AX = Error Code:
61; *
62; * o Invalid file path name
63; *
64; * o Invalid search attribute
65; *
66; * MODULES CALLED: DOS int 21H function 2FH
67; * DOS int 21H function 4FH
68; *
69; *************************************************************************
70;
71 public DosFindNext
72 .sall
73 .xlist
74 include macros.inc
75 .list
76;
77
78str struc
79old_bp dw ?
80return dd ?
81FindCountPtr dd ?
82FindBufferLen dw ?
83FindBufferPtr dd ? ;Changed to DW to match the DOSCALL.h PyL 6/1 Rsltbuf21 dd ?
84DirHandle dw ?
85str ends
86
87;
88DosFindNext proc far
89
90
91 Enter DosFindNext
92
93 mov ax,seg FindSegment ; get address to our data
94 mov ds,ax
95 assume ds:FindSegment
96
97; check for a valid dir handle
98
99; Special Logic to handle DirHandle = 1
100
101 mov si,[bp].DirHandle
102 cmp si,1
103 jne CheckForNext
104
105 mov si,offset FindSegment:FindHandles
106
107CheckForNext:
108 test ds:[si],OpenedHandle
109 jnz OkToFindNext
110
111 mov ax,6
112 jmp ErrorExit
113
114OkToFindNext:
115
116; We have a handle, let's look for the file(s)
117
118HandleFound:
119 mov si,ds:[si] ; get the DTA pointer
120 and si,not OpenedHandle ; and get rid of the allocated flag
121 mov CurrentDTA,si ; and save the current DTA value
122
123; save the callers dta so we can restore it later
124
125 mov ah,02fh
126 int 21h
127 mov SaveDTAOffset,bx
128 mov SaveDTASegment,es
129 mov SaveDTAFlag,1
130
131; Set the dta to our area
132
133 mov dx,CurrentDTA
134 mov ah,1ah
135 int 21h
136
137; Get the count of files to search for
138
139 les di,[bp].FindCountPtr ; load result buffer pointer
140 mov ax,es:[di] ; save the search
141 mov SearchCount,ax ; count
142 mov es:word ptr [di],0 ; set found count to zero
143
144 cmp ax,0 ; just in case they try to trick us!
145 jne DoSearch
146
147 jmp SearchDone
148
149; Find first file
150
151DoSearch:
152 mov ax,[bp].FindBufferLen ; load the buffer length
153 mov ReturnLengthToGo,ax ; save low order buffer length
154
155 les di,[bp].FindBufferPtr ; load result buffer pointer
156 mov word ptr ReturnBufferSave+0,di
157 mov word ptr ReturnBufferSave+2,es
158
159DoFindNext:
160 mov ax,4f00h
161 int 21h
162 jnc MoveFindData
163
164 jmp ErrorExit
165
166; Move find data into the return areas
167
168MoveFindData:
169 sub ReturnLengthToGo,size FileFindBuf ; check if result buffer is larg enough
170 jnc BufferLengthOk ; it is ok
171
172 mov ax,8 ; report 'Insufficient memory'
173 jmp ErrorExit ; error return - buffer not large enough
174
175BufferLengthOk:
176 mov si,CurrentDTA ; DS:SI -> our dta area
177 les di,ReturnBufferSave
178
179; At this point, the following MUST be true:
180; es:di -> where we are to put the resultant data
181; ds:si -> DTA from find (either first or next)
182
183 mov ax,ds:[si].DTAFileDate
184 mov es:[di].Create_Date,ax
185 mov es:[di].Access_Date,ax
186 mov es:[di].Write_Date,ax
187
188 mov ax,ds:[si].DTAFileTime
189 mov es:[di].Create_Time,ax
190 mov es:[di].Access_Time,ax
191 mov es:[di].Write_Time,ax
192
193 mov ax,ds:word ptr [si].DTAFileSize+0
194 mov es:word ptr [di].File_Size+0,ax
195 mov es:word ptr [di].FAlloc_Size+0,ax
196 mov ax,ds:word ptr [si].DTAFileSize+2
197 mov es:word ptr [di].File_Size+2,ax
198 mov es:word ptr [di].FAlloc_Size+2,ax
199
200 test es:word ptr [di].FAlloc_Size,001ffh
201 jz AllocateSizeSet
202
203 and es:word ptr [di].FAlloc_Size,not 001ffh
204 add es:word ptr [di].FAlloc_Size,00200h
205
206AllocateSizeSet:
207 xor ax,ax
208 mov al,ds:[si].DTAFileAttrib
209 mov es:[di].Attributes,ax
210
211 mov cx,12
212 mov bx,0
213
214MoveNameLoop:
215 mov al,ds:[si+bx].DTAFileName
216 cmp al,0
217 je EndOfName
218
219 mov es:[di+bx].File_Name,al
220 inc bx
221 loop MoveNameLoop
222
223EndOfName:
224 mov es:[di+bx].File_Name,0
225 mov ax,bx
226 mov es:[di].String_len,al
227
228 add di,bx
229 mov word ptr ReturnBufferSave+0,di
230 mov word ptr ReturnBufferSave+2,es
231
232 les di,[bp].FindCountPtr
233 inc word ptr es:[di]
234
235;
236; Check if the request was for more than one
237;
238 dec SearchCount
239 jz SearchDone
240
241 jmp DoFindNext
242
243SearchDone:
244 sub ax,ax ; set good return code
245
246ErrorExit:
247 push ax
248 mov ax,seg FindSegment
249 mov ds,ax
250 assume ds:FindSegment
251 cmp SaveDTAFlag,0
252 je DoNotRestore
253
254 mov SaveDTAFlag,0
255
256 lds dx,SaveDTA
257 mov ah,1ah
258 int 21h
259
260DoNotRestore:
261 pop ax
262
263 mexit
264
265 ret size str - 6
266
267DosFindNext endp
268
269dosxxx ends
270
271 end
diff --git a/v4.0/src/MAPPER/GETCNTRY.ASM b/v4.0/src/MAPPER/GETCNTRY.ASM
new file mode 100644
index 0000000..d107b9d
--- /dev/null
+++ b/v4.0/src/MAPPER/GETCNTRY.ASM
@@ -0,0 +1,135 @@
1;
2page 60,132
3;
4title CP/DOS DosGetCtryInfo mapper
5
6Buffer segment word public 'buffer'
7CountryInfo db 64
8Buffer ends
9
10dosxxx segment byte public 'dos'
11 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
12
13;**********************************************************************
14;*
15;* MODULE: dosgetctryinfo
16;*
17;* FUNCTION:get country information
18;*
19;* CALLING SEQUENCE:
20;*
21;* push word data area length
22;* push word country code
23;* push@ struc data area
24;* call dosgetctryinfo
25;*
26;* MODULES CALLED: PC-DOS Int 21h, ah=38h, get cntry info
27;*
28;*********************************************************************
29
30 public dosgetctryinfo
31 .sall
32 include macros.inc
33
34
35str struc
36old_bp dw ?
37return dd ?
38ReturnLength dd ?
39BufferPtr dd ?
40CountryCodePtr dd ?
41BufferLength dw ?
42str ends
43
44
45cntry struc ;country info. sturctrue
46ctry_code dw ?
47code_page dw ?
48dformat dw ?
49curr_sym db 5 dup(?)
50thous_sep dw ?
51decimal_sep dw ?
52date_sep dw ?
53time_sep dw ?
54bit_field db ?
55curr_cents db ?
56tformat db ?
57map_call dd ?
58data_sep dw ?
59ra db 5 dup(?)
60cntry ends
61
62
63Doscntry struc ;country info. sturctrue
64 Ddformat dw ?
65 Dcurr_sym db 5 dup(?)
66 Dthous_sep dw ?
67 Ddecimal_sep dw ?
68 Ddate_sep dw ?
69 Dtime_sep dw ?
70 Dbit_field db ?
71 Dsig_digit db ?
72 Dtformat db ?
73 Dmap_call dd ?
74 Ddata_sep dw ?
75 DResv db 5 dup(?)
76Doscntry ends
77
78
79dosgetctryinfo proc far
80
81 Enter Dosgetcntryinfo ; save registers
82
83 lds si,[bp].CountryCodePtr
84 mov ax,ds:[si] ; get country code pointer
85
86 cmp ax,256 ; 16 bit country code
87 jc getinfo
88
89 mov bx,ax ; if so, load into bx
90 mov al,0ffH ; and tell DOS it is get country
91
92getinfo:
93 mov dx,seg buffer
94 mov ds,dx
95 assume ds:buffer
96 mov dx,offset buffer:CountryInfo
97
98 mov ah,38h ; remember: the al value was set above!!!
99 int 21h ; get country information
100 jc ErrorExit
101
102 mov si,offset buffer:CountryInfo ;pointer to DOS cntry infor
103 les di,[bp].BufferPtr ;pointer to return data area
104
105 mov ax,[si].ddformat ;copy date format
106 mov es:[di].dformat,ax
107 mov ax,[si].ddate_sep ;copy date seperator
108 mov es:[di].date_sep,ax
109 mov ax,[si].dtime_sep ;copy time separator
110 mov es:[di].time_sep,ax
111 mov al,[si].dtformat ;copy time format
112 mov es:[di].tformat,al
113
114 mov cx,[bp].BufferLength ;was buffer larger than pc-dos gave us?
115 sub cx,34
116 jc NoFillNecessary ; no fill necessary
117
118 les di,[bp].BufferPtr ; else fill the remaining area
119 add di,34 ; with zeros
120 mov al,0
121 rep stosb
122
123NoFillNecessary:
124 sub ax,ax ; set good return code
125
126ErrorExit:
127 Mexit ; pop registers
128
129 ret size str - 6 ; return
130
131dosgetctryinfo endp
132
133dosxxx ends
134
135 end
diff --git a/v4.0/src/MAPPER/GETMSG.ASM b/v4.0/src/MAPPER/GETMSG.ASM
new file mode 100644
index 0000000..12dfaa3
--- /dev/null
+++ b/v4.0/src/MAPPER/GETMSG.ASM
@@ -0,0 +1,586 @@
1;
2page 80,132
3;
4title CP/DOS DosGetMessage mapper
5;
6messages segment word public 'messages'
7
8OurMessage db 0dh,0ah,"DosGetMessage returning ->",'$'
9
10ErrorMessageFlag db 0
11MessageToGo dw 0
12MessageLength dw 0
13NextVarPointer dd 0
14VarsToGo dw 0
15
16MaxMessageNumber = 0
17
18; This macro is used to define/declare all of the messages
19
20; We will have four macros, msg -> defines a complete message
21; msgStart -> defines the first part of a message
22; msgContinue -> continues a started message
23; msgEnd -> ends a message
24
25MacroState = 0
26
27;----------------------------------------------
28
29MsgError macro text ; message string error
30
31 if1
32 else
33 %out 
34 %out $ERROR - &text
35 endif
36
37 $ERROR - &text
38
39 endm
40
41;----------------------------------------------
42
43msg macro number,text
44
45 if MacroState NE 0
46 MsgError <Cannot use the 'Msg' Macro when inside a message definition.>
47 mexit
48 endif
49
50Message&Number db text
51 db 0
52
53 if MaxMessageNumber lt &number
54 MaxMessageNumber = &Number
55 endif
56
57MacroState = 0
58
59 endm
60
61;----------------------------------------------
62
63msgStart macro number,text ; start of a message string
64
65 if MacroState NE 0
66 MsgError <Cannot use the 'MsgStart' macro when inside a message definition.>
67 mexit
68 endif
69
70Message&Number db text
71
72 if MaxMessageNumber lt &number
73 MaxMessageNumber = &Number
74 endif
75
76MacroState = 1
77
78 endm
79
80;----------------------------------------------
81
82msgContinue macro text ; messgage string contination
83
84 if MacroState EQ 0
85 MsgError <Cannot use the 'MsgContinue' macro unless inside a message definition.>
86 mexit
87 endif
88
89 db text
90
91MacroState = 1
92
93 endm
94
95;----------------------------------------------
96
97msgEnd macro ; end of message string
98
99 if MacroState EQ 0
100 MsgError <Cannot use the 'MsgEnd' macro unless inside a message definition.>
101 mexit
102 endif
103
104 db 0
105
106MacroState = 0
107
108 endm
109
110
111;-----------------------------------------------
112
113; Define/declare the messages first!
114
115 include messages.inc
116
117NotFoundNumber = -2
118
119NotFoundMessage label byte
120 msg NotFoundNumber,<'We could not find your message #'>
121
122; Now, for each defined message, generate an index
123
124msgidx macro number
125 ifdef Message&Number
126 dw &Number
127 dw offset messages:Message&Number
128 endif
129 endm
130
131 even
132
133MessageIndex label word
134
135ThisMessageNumber = 0
136 rept MaxMessageNumber + 1
137 msgidx %ThisMessageNumber
138ThisMessageNumber = ThisMessageNumber + 1
139 endm
140
141 dw -1
142
143NotFoundIndex dw -2
144 dw offset messages:NotFoundMessage
145
146messages ends
147;
148dosxxx segment byte public 'dos'
149 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
150;
151;**********************************************************************
152;*
153;* MODULE: dosgetmessage
154;*
155;* FILE NAME: dos029.asm
156;*
157;* CALLING SEQUENCE:
158;*
159;* push@ other insert variable table
160;* push word insert variable count
161;* push@ other message buffer address
162;* push word buffer length
163;* push word message number
164;* push@ asciiz message file name
165;* push@ word returned message length
166;* call dosgetmessage
167;*
168;* MODULES CALLED: None (preliminary version)
169;*
170;*********************************************************************
171;
172 public dosgetmessage
173 .sall
174 .xlist
175 include macros.inc
176 .list
177
178str struc
179old_bp dw ?
180return dd ?
181ReturnLengthPtr dd ? ; length of returned message
182MessageFileName dd ? ; message file name
183MessageNumber dw ? ; number of the message
184MessageBufferLen dw ? ; length of the message buffer
185MessageBufferPtr dd ? ; buffer address to return message
186VariablesCount dw ? ; number of variables
187VariableTablePtr dd ? ; table of variables to insert
188str ends
189
190
191dosgetmessage proc far
192
193 Enter Dosgetmessage ; push registers
194 mov ax,messages ; setup message buffer
195 mov ds,ax
196 assume ds:messages
197 mov ErrorMessageFlag,0 ; reset error message flag
198
199 mov bx,[bp].MessageNumber ; get message number
200 mov si,offset messages:MessageIndex
201
202SearchForMessageLoop: ; search for message in table
203 lodsw
204 cmp ax,bx ; found ??
205 je FoundMessage ; jump if true
206
207 add si,2 ; if not serach continues
208 cmp ax,-1
209 jne SearchForMessageLoop
210
211 mov si,offset messages:NotFoundIndex + 2
212 mov ErrorMessageFlag,1
213
214; Here, ds:[si] -> word message number, followed by word message offset
215
216FoundMessage:
217 mov si,ds:[si]
218
219; Here, ds:[si] -> message text bytes
220
221 les di,[bp].VariableTablePtr ; get variable address
222 mov word ptr NextVarPointer+0,di ; save it
223 mov word ptr NextVarPointer+2,es
224
225 mov di,[bp].VariablesCount ; get variable count
226 mov VarsToGo,di ; save it
227
228 les di,[bp].MessageBufferPtr ; get return message buffer
229 ; address
230 mov ax,[bp].MessageBufferLen ; get return message buffer
231 mov MessageToGo,ax ; length
232
233 cmp ax,0 ; length = 0 ??
234 jne HaveLengthToCopy ; if not, jump
235
236 jmp GetMessageDone ; done
237
238HaveLengthToCopy:
239 mov MessageLength,0 ; initialize counter
240
241MoveCharsLoop:
242 lodsb ; get next character
243 cmp al,'%' ; is it a % sign
244 je DoSubstitution ; if so, need substitution
245
246 cmp al,0 ; end of string ??
247 jne RealCharacter ; if not look for real chars
248
249 jmp GetMessageDone ; else, jump to update
250 ; return message length
251
252RealCharacter: ; look for real character
253 stosb
254 inc MessageLength ; update message length counter
255 dec MessageToGo
256 jnz MoveCharsLoop ; branch if not all done
257
258 jmp GetMessageDone ; else alldone, branch
259
260DoSubstitution: ; do substitution
261 lodsb ; get character
262 cmp al,'%' ; check for %%
263 je RealCharacter ; if so, get next character
264
265
266
267; skip the numbers that indicate field width!
268
269SkipFieldWidth: ; check for field width digit
270 cmp al,'0' ; indicator digits
271 jc CheckChar
272
273 cmp al,'9'+1
274 jnc CheckChar
275 ; if field width indicator
276 lodsb ; jump to examine next char
277 jmp SkipFieldWidth
278
279;-----------------------------------------
280
281CheckChar: ; check for char substitution
282 cmp al,'c' ; if true go do character
283 je SubstituteChar ; substitution
284 cmp al,'C'
285 jne CheckDecimal
286
287SubstituteChar: ; do character subtitution
288 push ds
289 push si
290 lds si,NextVarPointer
291 lds si,ds:dword ptr [si]
292
293 assume ds:nothing
294
295 lodsb
296 pop si
297 pop ds
298
299 assume ds:messages
300
301 add word ptr NextVarPointer,4
302 dec VarsToGo
303
304 jmp RealCharacter
305
306;-----------------------------------------
307
308CheckDecimal: ; check for decimal subtitution
309 cmp al,'d' ; if true, do decimal
310 je SubstituteDecimal ; substitution
311 cmp al,'D'
312 jne CheckString
313
314SubstituteDecimal: ; do decimal subtitution
315 push ds
316 push si
317 lds si,NextVarPointer
318 lds si,ds:dword ptr [si]
319
320 assume ds:nothing
321
322 lodsw
323 pop si
324 pop ds
325
326 assume ds:messages
327
328 add word ptr NextVarPointer,4
329 dec VarsToGo
330
331 mov dx,0
332 call ConvDec
333
334 add MessageLength,ax
335 sub MessageToGo,ax
336 jc PastEndOfBuffer
337
338 jmp MoveCharsLoop
339
340PastEndOfBuffer:
341 jmp GetMessageDone
342
343;-----------------------------------------
344
345CheckString:
346 cmp al,'s' ; check for string subtitution
347 je SubstituteString ; if true, do string
348 cmp al,'S' ; substitution
349 jne CheckLong
350
351SubstituteString: ; do string substitution
352 push ds
353 push si
354 mov cx,MessageToGo
355 mov dx,MessageLength
356 lds si,NextVarPointer
357 lds si,ds:dword ptr [si]
358 assume ds:nothing
359
360ContinueStringSubstitution:
361 lodsb
362 cmp al,0
363 je EndOfSubstituteString
364
365 stosb
366 inc dx
367 loop ContinueStringSubstitution
368
369EndOfSubstituteString:
370 pop si
371 pop ds
372 assume ds:messages
373
374 add word ptr NextVarPointer,4
375 dec VarsToGo
376
377 mov MessageLength,dx
378 mov MessageToGo,cx
379 jcxz PastEndOfBuffer
380
381 jmp MoveCharsLoop
382
383;-----------------------------------------
384
385CheckLong: ; need long substitution
386 cmp al,'l'
387 je SubstituteLong ; if true go do it
388 cmp al,'L'
389 jne Unknown ; else unknown substitution
390
391SubstituteLong:
392 jmp RealCharacter ; just go back
393
394;-----------------------------------------
395
396Unknown:
397 jmp RealCharacter ; just go back
398
399
400
401
402; Update the return message length
403
404GetMessageDone:
405 push ds
406 push si
407 mov ax,MessageLength
408 lds si,[bp].ReturnLengthPtr
409 assume ds:nothing
410 mov ds:[si],ax
411 pop si
412 pop ds
413 assume ds:messages
414
415 cmp ErrorMessageFlag,0
416 je NotErrorMessage
417
418 mov ErrorMessageFlag,0
419
420KeepGoingBackwards:
421 cmp es:byte ptr [di-1],0
422 jne PutItHere
423
424 dec di
425 jmp KeepGoingBackwards
426
427PutItHere:
428 mov ax,[bp].MessageNumber
429 mov dx,0
430
431 call convdec
432 lds si,[bp].ReturnLengthPtr
433 assume ds:nothing
434 add ax,3 ; for cr, lf, nul
435 add ds:[si],ax
436
437 mov al,0dh
438 stosb
439 mov al,0ah
440 stosb
441
442 mov al,0
443 stosb
444
445NotErrorMessage:
446 jmp SkipToHere
447
448 mov dx,seg messages
449 mov ds,dx
450 mov dx,offset messages:OurMessage
451
452 mov ah,9 ; load op code
453 int 21h ; display message
454
455 lds si,[bp].ReturnLengthPtr
456 mov cx,ds:[si]
457 lds dx,[bp].MessageBufferPtr
458
459 mov bx,1
460 mov ah,40h
461 int 21h ; display message
462
463SkipToHere:
464 xor ax,ax ; set good return code
465
466 mexit ; pop registers
467 ret size str - 6 ; return
468
469dosgetmessage endp
470
471 page
472
473;������������������������������������������������������������������
474
475Tens dd 10000000
476 dd 1000000
477 dd 100000
478 dd 10000
479 dd 1000
480 dd 100
481 dd 10
482 dd 1
483 dd 0
484
485convdec proc near
486
487; input es:di -> location to put decimal characters at
488; dx:ax -> 32bit value to be displayed
489
490; output es:di -> next location for output characters
491; ax = number of characters output
492
493 push bp
494 sub sp,6
495 mov bp,sp
496
497DecLength equ word ptr [bp+0]
498LowValue equ word ptr [bp+2]
499HighValue equ word ptr [bp+4]
500
501 mov DecLength,0
502 mov HighValue,dx
503 mov LowValue,ax
504
505 mov bx,offset dosxxx:Tens
506
507; Start with a count of zero.
508
509DigitLoop:
510 mov dx,0
511
512; Loop, counting the number of times you can subtract the current digit value
513
514CountLoop:
515 mov ax,cs:[bx+0]
516 sub LowValue,ax
517 mov ax,cs:[bx+2]
518 sbb HighValue,ax
519 jc TooFar
520 inc dx ; Subtraction did no go negative, inc digit
521 jmp CountLoop
522
523; Since we know when this digit is done by the number going negative, we must
524; fixup the damage.
525
526TooFar:
527 mov ax,cs:[bx+0]
528 add LowValue,ax
529 mov ax,cs:[bx+2]
530 adc HighValue,ax
531
532; We need to supress leading zeros, so check to see if this digit is non zero
533
534 cmp dx,0
535 jnz DoDisplay
536
537; Digit is zero, check to see if we have put out any digits yet?
538
539 cmp Declength,0
540 jz NextDigit
541
542; Either digit was non zero, or we have already output the leading non-zero.
543; It really doesn't matter, display the digit
544
545DoDisplay:
546 mov al,dl
547 add al,'0'
548 stosb
549 inc DecLength
550
551; Set up for the next digit, and determine if we are done
552
553NextDigit:
554 add bx,4
555 cmp cs:word ptr [bx+0],0
556 jnz DigitLoop
557 cmp cs:word ptr [bx+2],0
558 jnz DigitLoop
559
560; Check to see that we at least put out a single 0 character
561
562 cmp DecLength,0
563 jne Done
564
565; We didn't, so let's put the zero there
566
567 mov al,'0'
568 stosb
569 inc DecLength
570
571; The decimal display is complete. Get the return value and return
572
573Done:
574 mov ax,DecLength
575
576 mov sp,bp
577 add sp,6
578 pop bp
579
580 ret
581
582convdec endp
583
584dosxxx ends
585
586 end
diff --git a/v4.0/src/MAPPER/GETVER.ASM b/v4.0/src/MAPPER/GETVER.ASM
new file mode 100644
index 0000000..3f94ec7
--- /dev/null
+++ b/v4.0/src/MAPPER/GETVER.ASM
@@ -0,0 +1,49 @@
1page 80,132
2
3title CP/DOS DosGetVersion mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7;
8;**********************************************************************
9;*
10;* MODULE: dosgetversion
11;*
12;* CALLING SEQUENCE:
13;*
14;* push@ word versionword pointer
15;* call dosgetversion
16;*
17;* MODULES CALLED: PC-DOS Int 21h, ah=30h, get version
18;*
19;*********************************************************************
20
21 public dosgetversion
22 .sall
23 include macros.inc
24
25str struc
26old_bp dw ?
27Return dd ?
28Data dd ? ; return data area pointer
29str ends
30
31dosgetversion proc far
32 Enter dosgetversion
33 lds si,[bp].data ; set pointer
34
35 mov ah,30h ; get DOS version
36 int 21h
37
38 mov byte ptr [si],ah ; minor version
39 mov byte ptr [si]+1,al ; major version
40
41exit: mexit ; pop registers
42 sub ax,ax
43 ret size str - 6
44;
45dosgetversion endp
46
47dosxxx ends
48
49 end
diff --git a/v4.0/src/MAPPER/GET_TOD.ASM b/v4.0/src/MAPPER/GET_TOD.ASM
new file mode 100644
index 0000000..d6c390f
--- /dev/null
+++ b/v4.0/src/MAPPER/GET_TOD.ASM
@@ -0,0 +1,67 @@
1;
2page 80,132
3;
4title CP/DOS DosGetDateTime mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosgetdatetime
12;*
13;* FUNCTION: get date and time information
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ struc date/time
18;* call dosgetdatetime
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=2ah, get date
21;* ah=2ch, get time
22;*
23;*********************************************************************
24
25 public dosgetdatetime
26 .sall
27 include macros.inc
28
29str struc
30old_bp dw ?
31return dd ?
32data dd ? ; date and time info return pointer
33str ends
34
35dosgetdatetime proc far
36
37 Enter dosgetdatetime ; push registers
38
39 lds si,[bp].data ; set return data area
40
41 mov ah,2ch ; get time information
42 int 21h
43 ; save info in return data are
44 mov byte ptr [si],ch ; save hour
45 mov byte ptr [si]+1,cl ; minutes
46 mov byte ptr [si]+2,dh ; seconds
47 mov byte ptr [si]+3,dl ; hundredths
48
49 mov ah,2ah ; get date and save it
50 int 21h ; in return data area
51
52 mov byte ptr [si]+4,dl ; save day
53 mov byte ptr [si]+5,dh ; month
54 mov word ptr [si]+6,cx ; year
55 mov word ptr [si]+8,360 ; min. from GMT
56 mov byte ptr [si]+10,al ; day of week
57
58exit: sub ax,ax ; set good return code
59
60 Mexit ; pop registers
61 ret size str - 6 ; return
62
63dosgetdatetime endp
64
65dosxxx ends
66
67 end
diff --git a/v4.0/src/MAPPER/GMACHMOD.ASM b/v4.0/src/MAPPER/GMACHMOD.ASM
new file mode 100644
index 0000000..a460aab
--- /dev/null
+++ b/v4.0/src/MAPPER/GMACHMOD.ASM
@@ -0,0 +1,40 @@
1;0
2page 80,132
3;
4title CP/DOS DOSGETMACHINEMODE mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosgetmachinemode
12;* Note that in PCDOS, this call should NOT BE ISSUED!
13;* This mapper does not return anything, it is meant
14;* only to allow the utility to link without errors.
15;*
16;*********************************************************************
17
18 public dosgetmachinemode
19 .sall
20 .xlist
21 include macros.inc
22 .list
23
24str struc
25modeaddr dw ?
26str ends
27
28dosgetmachinemode proc far
29 Enter DosGetMachMode ; push registers
30
31 sub ax,ax ; set good return code
32
33 mexit ; pop registers
34 ret size str - 6 ; return garbage (Not supported in PCDOS)
35
36dosgetmachinemode endp
37
38dosxxx ends
39
40 end
diff --git a/v4.0/src/MAPPER/IOCTL.ASM b/v4.0/src/MAPPER/IOCTL.ASM
new file mode 100644
index 0000000..03302db
--- /dev/null
+++ b/v4.0/src/MAPPER/IOCTL.ASM
@@ -0,0 +1,93 @@
1page 80,132
2
3title CP/DOS DosDevIOCTl mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7;
8;**********************************************************************
9;*
10;* MODULE: dosdevioctl
11;*
12;* FILE NAME: dos007.asm
13;*
14;* CALLING SEQUENCE:
15;*
16;* push@ dword Data
17;* push@ dword Paramlist
18;* push word Function
19;* push word Category
20;* push@ word Devicehandle
21;*
22;* call doschgfileptr
23;*
24;* MODULES CALLED: PC-DOS Int 21h, ah=42h, move file pointer
25;*
26;*********************************************************************
27
28 public dosdevioctl
29 .sall
30 .xlist
31 include macros.inc
32 .list
33
34str struc
35Old_bp dw ?
36Return dd ?
37Handle dw ? ; handle
38Category dw ? ; device category
39Function dw ? ; device function
40Parmlist dd ? ; command arguments
41Data dd ? ; data area
42str ends
43
44dosdevioctl proc far
45 Enter dosdevioctl ; push registers
46
47 mov bx,[bp].handle ; get handle
48
49 cmp bx,0ffe5h ; is it a device handle ??
50 jl filehandle ; branch if not
51
52; Convert DASD device handle to drive number as follows:
53; Drive Open IOCTL
54; Letter Handle DASD #
55; -----------------------------
56; A -2 1
57; B -3 2
58; C -4 3
59; D -5 4
60; E -6 5
61 neg bx ; convert dev handle to
62 dec bx ; drive number
63
64filehandle:
65 mov ax,[bp].function ; get function code
66 cmp ax,020H ; check for right function
67 je continue1 ; continue if right function code
68 mov ax,01H ; else, load error code
69 jmp exit ; return
70
71continue1: ; only category 8 is supported
72 mov ax,[bp].category ; set category
73
74 mov ah,44h
75 int 21h ; do ioctl
76 jnc continue ; check for error
77
78 cmp ax,1 ; if error and return code = 1
79 jne exit ; then it is network drive
80 ; therefore continue
81continue:
82 lds si,[bp].data ; media changable
83 mov byte ptr [si],al ; save in data area
84 xor ax,ax ; set no error coe
85
86exit: mexit ; pop registers
87 ret size str - 6 ; return
88
89dosdevioctl endp
90
91dosxxx ends
92
93 end
diff --git a/v4.0/src/MAPPER/KBD.INC b/v4.0/src/MAPPER/KBD.INC
new file mode 100644
index 0000000..8c74eed
--- /dev/null
+++ b/v4.0/src/MAPPER/KBD.INC
@@ -0,0 +1,35 @@
1; KeyData
2
3KeyData struc
4
5Char_Code db ?
6Scan_Code db ?
7Status db ?
8Shift_State dw ?
9Time dd ?
10
11KeyData ends
12
13
14
15KbdStatus struc
16
17KS_Length dw ?
18Bit_mask dw ?
19Turn_Around_Char dw ?
20Interim_Char_Flags dw ?
21Status_Shift_State dw ?
22
23KbdStatus ends
24
25; Bit_Mask equates
26
27CookedModeOn equ 8
28RawModeOn equ 4
29EchoOff equ 2
30EchoOn equ 1
31
32
33 include macros.inc
34
35 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/KBDGSTAT.ASM b/v4.0/src/MAPPER/KBDGSTAT.ASM
new file mode 100644
index 0000000..078fd5d
--- /dev/null
+++ b/v4.0/src/MAPPER/KBDGSTAT.ASM
@@ -0,0 +1,76 @@
1;0
2page 80,132
3;
4title CP/DOS KbdGetStatus
5;
6 .sall
7 .xlist
8 include kbd.inc
9 .list
10
11kbddata segment word public 'kbddata'
12
13 public KbdBitMask
14KbdBitMask dw CookedModeOn or EchoOn
15
16 public KbdTurnAroundCharacter
17KbdTurnAroundCharacter dw 0dh
18
19 public KbdInterimCharFlags
20KbdInterimCharFlags dw 0
21
22kbddata ends
23
24kbdxxx segment byte public 'kbd'
25 assume cs:kbdxxx,ds:nothing,es:nothing,ss:nothing
26;
27; ************************************************************************* *
28; *
29; * MODULE: kbdGetStatus
30; *
31; * CALLING SEQUENCE:
32; *
33; *
34; *************************************************************************
35
36 public kbdgetstatus
37
38str struc
39old_bp dw ?
40return dd ?
41handle dw ? ; kbd handle
42data dd ? ; data area pointer
43str ends
44
45kbdgetstatus proc far
46
47 Enter KbdGetStatus ; push registers
48
49 les di,[bp].data ; setup area where status is
50 ; returned
51 mov ax,seg kbddata
52 mov ds,ax
53 assume ds:kbddata
54
55 mov ax,KbdBitMask ; save kbd bit mask in
56 mov es:[di].Bit_Mask,ax ; return data area
57
58 mov ax,KbdTurnAroundCharacter ; save turn around character
59 mov es:[di].Turn_Around_Char,ax
60
61 mov ax,KbdInterimCharFlags ; save interim character flag
62 mov es:[di].Interim_Char_Flags,ax
63
64 mov ah,2
65 int 16h ; get kbd shift status
66
67 xor ah,ah
68 mov es:[di].Status_Shift_State,ax ; save it in return data
69 ; area
70 Mexit ; restore registers
71
72 ret size str - 6 ; return
73
74kbdgetstatus endp
75kbdxxx ends
76 end
diff --git a/v4.0/src/MAPPER/KBDSSTAT.ASM b/v4.0/src/MAPPER/KBDSSTAT.ASM
new file mode 100644
index 0000000..1e76ffc
--- /dev/null
+++ b/v4.0/src/MAPPER/KBDSSTAT.ASM
@@ -0,0 +1,129 @@
1;
2page 80,132
3;
4title CP/DOS KbdSetStatus
5
6 .sall
7 .xlist
8 include kbd.inc ; kbd set status data structure
9 .list
10
11kbddata segment word public 'kbddata'
12
13 extrn KbdBitMask:word
14 extrn KbdTurnAroundCharacter:word
15 extrn KbdInterimCharFlags:word
16
17kbddata ends
18
19
20
21kbdxxx segment byte public 'kbd'
22 assume cs:kbdxxx,ds:nothing,es:nothing,ss:nothing
23;
24; ************************************************************************* *
25; *
26; * MODULE: kbdsetStatus
27; *
28; *
29; * CALLING SEQUENCE:
30; *
31; * PUSH@ DWORD data ; kbd data structure
32; * PUSH WORD handle ; kbd handle
33; *
34; * CALL kbdsetstatus
35; *
36; * RETURN SEQUENCE:
37; *
38; *
39; *
40; *************************************************************************
41;
42 public kbdsetstatus
43
44str struc
45old_bp dw ?
46return dd ?
47handle dw ? ; kbd handle
48data dd ? ; kbd data strructure pointer
49str ends
50
51kbdsetstatus proc far
52
53 Enter KbdSetStatus ; save registers
54
55 les di,[bp].data ; set up kbd data structure
56 mov ax,seg kbddata
57 mov ds,ax
58 assume ds:kbddata
59
60 mov ax,es:[di].Bit_Mask ; get bit mask
61
62CheckTurnAround:
63 test ax,040h ; define turnaround character ??
64 jz CheckInterimFlags ; jump if not
65
66 mov bx,es:[di].Turn_Around_Char ; else, save turnaround character
67 mov KbdTurnAroundCharacter,bx
68
69CheckInterimFlags:
70 test ax,020h ; check for interim character flag ??
71 jz CheckShiftState ; if not jump
72
73 mov bx,es:[di].Interim_Char_Flags ; save interim character flag
74 mov KbdInterimCharFlags,bx
75
76CheckShiftState:
77 test ax,010h ; check for shift state ??
78 jz CheckCookedOn ; jump if not
79
80 push ds ; setup for shift state
81 mov bx,040h
82 mov ds,bx
83 assume ds:nothing
84
85 mov bx,es:[di].Status_Shift_State ; save shift state data
86 mov ds:018h,bl
87
88 pop ds
89 assume ds:kbddata
90
91CheckCookedOn: ; check for cooked mode ??
92 test ax,008h
93 jz CheckRawOn
94
95 and KbdBitMask,not RawModeOn ; setup cooked mode status
96 or KbdBitMask,CookedModeOn
97
98CheckRawOn:
99 test ax,004h ; check for raw mdoe ??
100 jz CheckEchoOff
101
102 and KbdBitMask,not CookedModeOn ; setup for raw mode
103 or KbdBitMask,RawModeOn
104
105CheckEchoOff:
106 test ax,002h ; check for echo on
107 jz CheckEchoOn ; branch if so
108
109 and KbdBitMask,not EchoOn ; else setup echo off
110 or KbdBitMask,EchoOff
111
112CheckEchoOn:
113 test ax,001h
114 jz EverythingSet
115
116 and KbdBitMask,not EchoOff ; setup echo on
117 or KbdBitMask,EchoOn
118
119EverythingSet:
120 Mexit ; pop registers
121
122 ret size str - 6 ; return
123
124KbdSetStatus endp
125
126kbdxxx ends
127
128 end
129
diff --git a/v4.0/src/MAPPER/LSEEK.ASM b/v4.0/src/MAPPER/LSEEK.ASM
new file mode 100644
index 0000000..450f8c7
--- /dev/null
+++ b/v4.0/src/MAPPER/LSEEK.ASM
@@ -0,0 +1,68 @@
1;
2page 80,132
3;0
4title CP/DOS DosChgFilePtr mapper * * *
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8
9;**********************************************************************
10;*
11;* MODULE: doschgfileptr
12;*
13;* FILE NAME: dos007.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push word file handle
18;* push dword distance
19;* push word move type
20;* push@ dword new pointer
21;* call doschgfileptr
22;*
23;* MODULES CALLED: PC-DOS Int 21h, ah=42h, move file pointer
24;*
25;*********************************************************************
26
27 public doschgfileptr
28 .sall
29 .xlist
30 include macros.inc
31 .list
32
33str struc
34old_bp dw ?
35return dd ?
36newptr dd ? ; new file pointer
37movtyp dw ? ; move type
38dstnce dd ? ; distance to be moved
39handle dw ? ; file handle
40str ends
41
42doschgfileptr proc far
43 Enter doschgfileptr ; push registers
44
45 push es
46 les dx,[bp].dstnce
47 mov cx,es ; set distance
48 pop es
49 mov ax,[bp].movtyp ; get move type
50 mov bx,[bp].handle ; get handle
51
52 mov ah,42h
53 int 21h ; move file pointer
54 jc exit ; return if error
55
56 lds si,[bp].newptr ; set pointer
57 mov word ptr [si],ax ; save the new pointer
58 mov word ptr [si]+2,dx ;
59 sub ax,ax ; set godd return code
60
61exit: mexit ;pop registers
62 ret size str - 6 ;return
63
64doschgfileptr endp
65
66dosxxx ends
67
68 end
diff --git a/v4.0/src/MAPPER/MACROS.INC b/v4.0/src/MAPPER/MACROS.INC
new file mode 100644
index 0000000..0fdf4c3
--- /dev/null
+++ b/v4.0/src/MAPPER/MACROS.INC
@@ -0,0 +1,46 @@
1;
2 if1
3 %out macros.inc
4 endif
5
6
7pushal macro
8 push bx
9 push cx
10 push dx
11 push si
12 push di
13 push ds
14 push es
15 push ss
16 push bp
17 endm
18;
19popal macro
20 pop bp
21 pop ss
22 pop es
23 pop ds
24 pop di
25 pop si
26 pop dx
27 pop cx
28 pop bx
29 endm
30;
31Enter macro Routine
32
33 push bp
34 mov bp,sp
35 pushal
36
37 endm
38;
39Mexit macro
40
41 popal
42 mov sp,bp
43 pop bp
44
45 endm
46 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/MAKEFILE b/v4.0/src/MAPPER/MAKEFILE
new file mode 100644
index 0000000..f0cc850
--- /dev/null
+++ b/v4.0/src/MAPPER/MAKEFILE
@@ -0,0 +1,132 @@
1#************************** makefile for mapper ***************************
2
3msg =..\messages
4dos =..\dos
5inc =..\inc
6hinc =..\h
7
8#
9####################### dependencies begin here. #########################
10#
11
12all: mapper.lib
13
14chdir.obj: chdir.asm makefile macros.inc
15
16getver.obj: getver.asm makefile macros.inc
17
18f_first.obj: f_first.asm makefile macros.inc find.inc
19
20set_tod.obj: set_tod.asm makefile macros.inc
21
22write.obj: write.asm makefile macros.inc
23
24beep.obj: beep.asm makefile macros.inc
25
26mkdir.obj: mkdir.asm makefile macros.inc
27
28exit.obj: exit.asm makefile macros.inc
29
30delete.obj: delete.asm makefile macros.inc
31
32getcntry.obj: getcntry.asm makefile macros.inc
33
34f_close.obj: f_close.asm makefile macros.inc find.inc
35
36open.obj: open.asm makefile macros.inc
37
38read.obj: read.asm makefile macros.inc
39
40rmdir.obj: rmdir.asm makefile macros.inc
41
42qcurdir.obj: qcurdir.asm makefile macros.inc
43
44qcurdsk.obj: qcurdsk.asm makefile macros.inc
45
46qverify.obj: qverify.asm makefile macros.inc
47
48qfilemod.obj: qfilemod.asm makefile macros.inc
49
50sverify.obj: sverify.asm makefile macros.inc
51
52sfilemod.obj: sfilemod.asm makefile macros.inc
53
54lseek.obj: lseek.asm makefile macros.inc
55
56sfileinf.obj: sfileinf.asm makefile macros.inc
57
58close.obj: close.asm makefile macros.inc
59
60allocseg.obj: allocseg.asm makefile macros.inc
61
62freeseg.obj: freeseg.asm makefile macros.inc
63
64sel_disk.obj: sel_disk.asm makefile macros.inc
65
66qfsinfo.obj: qfsinfo.asm makefile macros.inc
67
68f_next.obj: f_next.asm makefile macros.inc find.inc
69
70getmsg.obj: getmsg.asm makefile macros.inc
71
72get_tod.obj: get_tod.asm makefile macros.inc
73
74charin.obj: charin.asm makefile macros.inc
75
76flushbuf.obj: flushbuf.asm makefile macros.inc
77
78devconfg.obj: devconfg.asm makefile macros.inc
79
80reallseg.obj: reallseg.asm makefile macros.inc
81
82putmsg.obj: putmsg.asm makefile macros.inc
83
84execpgm.obj: execpgm.asm makefile macros.inc
85
86qhandtyp.obj: qhandtyp.asm makefile macros.inc
87
88cwait.obj: cwait.asm makefile macros.inc
89
90kbdgstat.obj: kbdgstat.asm makefile macros.inc
91
92kbdsstat.obj: kbdsstat.asm makefile macros.inc
93
94casemap.obj: casemap.asm makefile macros.inc
95
96dbcs.obj: dbcs.asm makefile macros.inc
97
98ioctl.obj: ioctl.asm makefile macros.inc
99
100sighand.obj: sighand.asm makefile macros.inc
101
102error.obj: error.asm makefile macros.inc
103
104setint24.obj: setint24.asm makefile macros.inc
105
106qfileinf.obj: qfileinf.asm makefile macros.inc
107
108scurpos.obj: scurpos.asm makefile macros.inc
109
110scrollup.obj: scrollup.asm makefile macros.inc
111
112wchstra.obj: wchstra.asm makefile macros.inc
113
114scntry.obj: scntry.asm makefile macros.inc
115
116setfsinf.obj: setfsinf.asm makefile macros.inc
117
118gmachmod.obj: gmachmod.asm makefile macros.inc
119
120mapper.lib: makefile chdir.obj getver.obj f_first.obj set_tod.obj \
121 write.obj beep.obj mkdir.obj exit.obj delete.obj getcntry.obj \
122 f_close.obj open.obj read.obj rmdir.obj qcurdir.obj qcurdsk.obj \
123 qverify.obj qfilemod.obj sverify.obj sfilemod.obj lseek.obj \
124 sfileinf.obj close.obj allocseg.obj freeseg.obj sel_disk.obj \
125 qfsinfo.obj f_next.obj getmsg.obj get_tod.obj charin.obj \
126 flushbuf.obj devconfg.obj reallseg.obj putmsg.obj execpgm.obj \
127 qhandtyp.obj cwait.obj kbdgstat.obj kbdsstat.obj casemap.obj \
128 dbcs.obj ioctl.obj sighand.obj error.obj setint24.obj \
129 qfileinf.obj scurpos.obj scrollup.obj wchstra.obj scntry.obj \
130 setfsinf.obj gmachmod.obj
131 del mapper.lib
132 lib @mapper.lbr
diff --git a/v4.0/src/MAPPER/MAPPER.INC b/v4.0/src/MAPPER/MAPPER.INC
new file mode 100644
index 0000000..be295fa
--- /dev/null
+++ b/v4.0/src/MAPPER/MAPPER.INC
@@ -0,0 +1,23 @@
1
2
3_TEXT SEGMENT BYTE PUBLIC 'CODE'
4_TEXT ENDS
5
6CONST SEGMENT WORD PUBLIC 'CONST'
7CONST ENDS
8
9_BSS SEGMENT WORD PUBLIC 'BSS'
10_BSS ENDS
11
12_DATA SEGMENT WORD PUBLIC 'DATA'
13_DATA ENDS
14
15DGROUP GROUP CONST, _BSS, _DATA
16
17 ASSUME CS: _TEXT
18 ASSUME DS: DGROUP
19 ASSUME SS: DGROUP
20 ASSUME ES: DGROUP
21
22
23 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/MAPPER.LBR b/v4.0/src/MAPPER/MAPPER.LBR
new file mode 100644
index 0000000..226075f
--- /dev/null
+++ b/v4.0/src/MAPPER/MAPPER.LBR
@@ -0,0 +1,57 @@
1mapper.lib
2y
3+CHDIR&
4+GETVER&
5+F_FIRST&
6+SET_TOD.obj&
7+WRITE.obj&
8+BEEP.obj&
9+MKDIR.obj&
10+EXIT.obj&
11+DELETE.obj&
12+GETCNTRY.obj&
13+F_CLOSE.obj&
14+OPEN.obj&
15+READ.obj&
16+RMDIR.obj&
17+QCURDIR.obj&
18+QCURDSK.obj&
19+QVERIFY.obj&
20+QFILEMOD.obj&
21+SVERIFY.obj&
22+SFILEMOD.obj&
23+LSEEK.obj&
24+SFILEINF.obj&
25+CLOSE.obj&
26+ALLOCSEG.obj&
27+FREESEG.obj&
28+SEL_DISK.obj&
29+QFSINFO.obj&
30+F_NEXT.obj&
31+GETMSG.obj&
32+GET_TOD.obj&
33+CHARIN.obj&
34+FLUSHBUF.obj&
35+DEVCONFG.obj&
36+REALLSEG.obj&
37+PUTMSG.obj&
38+EXECPGM.obj&
39+QHANDTYP.obj&
40+CWAIT.obj&
41+KBDGSTAT.obj&
42+KBDSSTAT.obj&
43+CASEMAP.obj&
44+DBCS.obj&
45+IOCTL.obj&
46+SIGHAND.obj&
47+ERROR.obj&
48+setint24.obj&
49+QFILEINF.obj&
50+SCURPOS.obj&
51+SCROLLUP.obj&
52+WCHSTRA.obj&
53+SCNTRY.obj&
54+SETFSINF.obj&
55+GMACHMOD.obj
56mapper.lst;
57 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/MESSAGES.INC b/v4.0/src/MAPPER/MESSAGES.INC
new file mode 100644
index 0000000..e2286e0
--- /dev/null
+++ b/v4.0/src/MAPPER/MESSAGES.INC
@@ -0,0 +1,88 @@
1 page
2
3; Restore Messages 0
4
5MSG0 equ 0
6INSERT_SOURCE_DISK equ 1635 ;925
7SOURCE_TARGET_SAME equ 1642 ;932
8INVALID_NUM_PARM equ 1643 ;933
9INVALID_DRIVE equ 1644 ;934
10NO_FILE_TO_RESTORE equ 1645 ;935
11INVALID_PARM equ 1646 ;936
12LAST_FILE_NOT_RESTORED equ 1648 ;938
13SOURCE_NO_BACKUP_FILE equ 1649 ;939
14INSUFFICIENT_MEMORY equ 8 ;8
15FILE_SEQUENCE_ERROR equ 1651 ;941
16FILE_CREATION_ERROR equ 1652 ;942
17TARGET_IS_FULL equ 1653 ;943
18NOT_ABLE_TO_RESTORE_FILE equ 1655 ;945
19INVALID_DOS_VER equ 1210 ;500
20FILE_SHARING_ERROR equ 1647 ;937
21FILE_WAS_CHANGED equ 1638 ;928
22DISK_OUT_OF_SEQUENCE equ 1636 ;926
23FILE_IS_READONLY equ 1637 ;927
24SYSTEM_FILE_RESTORED equ 1639 ;929
25FILES_WERE_BACKUP_ON equ 1640 ;930
26RESTORE_FILE_FROM_DRIVE equ 1634 ;924
27INSERT_TARGET_DISK equ 1657 ;947
28FILE_TO_BE_RESTORED equ 1641 ;931
29DISKETTE_NUM equ 1656 ;946
30INVALID_PATH equ 1670 ;960
31
32 db ' The Microsoft MS DOS (R) Restore Utility'
33 db ' Version 4.00 Copyright 1988 Microsoft '
34 db ' Licensed Material - Property of Microsoft '
35 db ' Author - ** **** '
36
37
38 msg %MSG0,<"Y N A R I",0dh,0ah>
39 Msg %SOURCE_TARGET_SAME,<0dh,0ah,"Source and target drives are the same",0dh,0ah>
40 Msg %INVALID_NUM_PARM,<0dh,0ah,"Invalid number of parameters",0dh,0ah>
41 Msg %INVALID_PATH,<0dh,0ah,"Invalid path",0dh,0ah>
42 Msg %INVALID_DRIVE,<0dh,0ah,"Invalid drive specification",0dh,0ah>
43 Msg %NO_FILE_TO_RESTORE,<0dh,0ah,"Warning! No files were found to restore",0dh,0ah>
44 msg %INVALID_PARM,<0dh,0ah,"Invalid parameter %s",0dh,0ah>
45 Msgstart %INSERT_SOURCE_DISK,<0dh,0ah,"Insert backup diskette %s in drive">
46 MsgContinue <" %c:",0dh,0ah>
47 MsgContinue <"Strike any key when ready ",0dh,0ah>
48 MsgEnd
49
50 MsgStart %DISK_OUT_OF_SEQUENCE,<0dh,0ah,"Warning! Diskette is out of sequence",0dh,0ah>
51 MsgContinue <"Replace diskette or continue if okay",0dh,0ah>
52 MsgContinue <"Strike any key when ready ",0dh,0ah>
53 MsgEnd
54
55 Msg %LAST_FILE_NOT_RESTORED,<0dh,0ah,"The last file was not restored",0dh,0ah>
56 Msg %FILES_WERE_BACKUP_ON,<0dh,0ah,"*** Files were backed up %s *** ",0dh,0ah>
57 Msg %SOURCE_NO_BACKUP_FILE,<0dh,0ah,"Source does not contain backup files",0dh,0ah>
58 Msg %INSUFFICIENT_MEMORY,<0dh,0ah,"Insufficient memory",0dh,0ah>
59 MsgStart %FILE_IS_READONLY,<0dh,0ah,"Warning! File %s",0dh,0ah>
60 MsgContinue <"is a read-only file",0dh,0ah>
61 MsgContinue <"Replace the file (Y/N)? ",0dh,0ah>
62 MsgEnd
63
64 Msg %FILE_SEQUENCE_ERROR,<0dh,0ah,"Restore file sequence error",0dh,0ah>
65 Msg %FILE_CREATION_ERROR,<0dh,0ah,"File creation error",0dh,0ah>
66 Msg %TARGET_IS_FULL,<0dh,0ah,"Target is full",0dh,0ah>
67 Msg %NOT_ABLE_TO_RESTORE_FILE,<0dh,0ah,"*** Not able to restore file ***",0dh,0ah>
68 MsgStart %INSERT_TARGET_DISK,<0dh,0ah,"Insert restore target in " >
69 MsgContinue <"drive %s:",0dh,0ah>
70 MsgContinue <"Strike any key when ready ",0dh,0ah>
71 MsgEnd
72 msg %INVALID_DOS_VER,<0dh,0ah,"Incorrect DOS version",0dh,0ah>
73 msg %FILE_TO_BE_RESTORED,<0dh,0ah,"%s",0>
74
75 msg %RESTORE_FILE_FROM_DRIVE,<0dh,0ah,"*** Restoring files from drive %s: ***",0>
76
77 Msg %FILE_SHARING_ERROR,<0dh,0ah,"Unrecoverable file sharing error",0dh,0ah>
78
79 MsgStart %SYSTEM_FILE_RESTORED,<0dh,0ah,"System files restored",0dh,0ah>
80 MsgContinue <"Target disk may not be bootable",0dh,0ah>
81 MsgEnd
82
83 MsgStart %FILE_WAS_CHANGED,<0dh,0ah,"Warning! File %s",0dh,0ah>
84 MsgContinue <"was changed after it was backed up",0dh,0ah>
85 MsgContinue <"Replace the file (Y/N)? ",0dh,0ah>
86 MsgEnd
87 msg %DISKETTE_NUM,<0dh,0ah,"Diskette: %s",0>
88
diff --git a/v4.0/src/MAPPER/MKDIR.ASM b/v4.0/src/MAPPER/MKDIR.ASM
new file mode 100644
index 0000000..3444435
--- /dev/null
+++ b/v4.0/src/MAPPER/MKDIR.ASM
@@ -0,0 +1,53 @@
1page 80,132
2
3title CP/DOS DosMkDir mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7;
8;**********************************************************************
9;*
10;* MODULE: dosmkdir
11;*
12;* FUNCTION: Create a new directory
13;*
14;* CALLING SEQUENCE:
15;*
16;* push@ asciiz directory name
17;* push dword reserved (must be zero)
18;* call dosmkdir
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=39h
21;*
22;*********************************************************************
23
24 public dosmkdir
25 .sall
26 include macros.inc
27
28str struc
29old_bp dw ?
30return dd ?
31rsrvd dd ?
32Asciiz dd ? ; new directory name pointer
33str ends
34
35dosmkdir proc far
36
37 Enter DosMkdir ; push registers
38 lds dx,[bp].asciiz ; set pointer to directory name
39
40 mov ah,39h ; load opcode
41 int 21h ; create new directory
42 jc exit ; jump if error
43
44 sub ax,ax ; else, set good return code
45
46exit: mexit ; pop registers
47 ret size str - 6 ; return
48
49dosmkdir endp
50
51dosxxx ends
52
53 end
diff --git a/v4.0/src/MAPPER/MSC.INC b/v4.0/src/MAPPER/MSC.INC
new file mode 100644
index 0000000..0a22667
--- /dev/null
+++ b/v4.0/src/MAPPER/MSC.INC
@@ -0,0 +1,16 @@
1_DATA SEGMENT WORD PUBLIC 'DATA'
2_DATA ENDS
3
4CONST SEGMENT WORD PUBLIC 'CONST'
5CONST ENDS
6
7_BSS SEGMENT WORD PUBLIC 'BSS'
8_BSS ENDS
9
10STACK SEGMENT PARA PUBLIC 'STACK'
11STACK ENDS
12
13DGROUP GROUP _DATA, CONST, _BSS, STACK
14
15
16 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/NLSAPI.INC b/v4.0/src/MAPPER/NLSAPI.INC
new file mode 100644
index 0000000..e10b441
--- /dev/null
+++ b/v4.0/src/MAPPER/NLSAPI.INC
@@ -0,0 +1,17 @@
1; SCCSID = @(#)nlsapi.inc 1.1 86/06/03
2SETCOUNTRYINFO equ 1 ; select country info
3SETUCASE equ 2 ; select uppercase tbl
4SETLCASE equ 3 ; select lowercase tbl
5SETUCASEFILE equ 4 ; select uppercase spec table
6SETFILELIST equ 5 ; select valid file character list
7SETCOLLATE equ 6 ; select collating sequence
8SETDBCS equ 7 ; select double byte char set
9
10MAXLBUFFER equ 500 ; max size for local buffer
11
12MAXCASEMAP equ 256 ; max size for ucase table in casemap
13
14MAXDBCS equ 256 ; max size for dbcs table in casemap
15
16NOT_DBCS_CHAR equ 0
17DBCS_CHAR equ 1
diff --git a/v4.0/src/MAPPER/OLDGETCN.ASM b/v4.0/src/MAPPER/OLDGETCN.ASM
new file mode 100644
index 0000000..f3dd5a7
--- /dev/null
+++ b/v4.0/src/MAPPER/OLDGETCN.ASM
@@ -0,0 +1,132 @@
1;
2page 60,132
3;
4title CP/DOS DosGetCtryInfo mapper
5
6Buffer segment word public 'buffer'
7CountryInfo db 64
8Buffer ends
9
10dosxxx segment byte public 'dos'
11 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
12;
13;**********************************************************************
14;*
15;* MODULE: dosgetctryinfo
16;*
17;* FILE NAME: dos024.asm
18;*
19;* CALLING SEQUENCE:
20;*
21;* push word data area length
22;* push word country code
23;* push@ struc data area
24;* call dosgetctryinfo
25;*
26;* MODULES CALLED: PC-DOS Int 21h, ah=38h, get cntry info
27;*
28;*********************************************************************
29;
30 public dosgetctryinfo
31 .sall
32 include macros.inc
33
34;
35str struc
36old_bp dw ?
37return dd ?
38ReturnLength dd ?
39BufferPtr dd ?
40CountryCodePtr dd ?
41BufferLength dw ?
42str ends
43;
44
45cntry struc ;country info. sturctrue
46ctry_code dw ?
47code_page dw ?
48dformat dw ?
49curr_sym db 5 dup(?)
50thous_sep db 2 dup(?)
51decimal_sep db 2 dup(?)
52date_sep db 2 dup(?)
53time_sep db 2 dup(?)
54bit_field dw ?
55curr_cents dw ?
56tformat dw ?
57map_call dd ?
58data_sep dw ?
59ra 5 dup(?)
60cntry ends
61;
62
63Doscntry struc ;country info. sturctrue
64 Ddformat dw ?
65 Dcurr_sym db 5 dup(?)
66 Dthous_sep db 2 dup(?)
67 Ddecimal_sep db 2 dup(?)
68 Ddate_sep db 2 dup(?)
69 Dtime_sep db 2 dup(?)
70 Dbit_field db ?
71 Dsig_digit db ?
72 Dtformat db ?
73 Dmap_call dd ?
74 Ddata_sep dw ?
75 DResv 5 dup(?)
76Doscntry ends
77
78
79dosgetctryinfo proc far
80
81 Enter Dosgetcntryinfo
82
83 lds si,[bp].CountryCodePtr
84 mov ax,ds:[si]
85
86 cmp ax,256 ;16 bit country code
87 jc getinfo
88
89 mov bx,ax ;if so, load into bx
90 mov al,0ffH ;and tell DOS
91
92getinfo:
93 mov dx,seg buffer
94 mov ds,dx
95 assume ds:buffer
96 mov dx,offset buffer:CountryInfo
97
98 mov ah,38h ; remember: the al value was set above!!!
99 int 21h
100 jc ErrorExit
101;
102 mov si,offset buffer:CountryInfo
103 les di,[bp].BufferPtr
104 cld ;string move op.
105
106 mov cx,[bp].BufferLength ;length to move
107
108 rep movsb ;copy all to output area
109
110 mov cx,[bp].BufferLength ;was buffer larger than pc-dos gave us?
111 sub cx,34
112 jc NoFillNecessary
113
114 les di,[bp].BufferPtr
115 add di,34
116
117 mov al,0 ;fill with zeroes
118 rep stosb
119;
120NoFillNecessary:
121 sub ax,ax
122
123ErrorExit:
124 Mexit
125
126 ret size str - 6
127;
128dosgetctryinfo endp
129
130dosxxx ends
131
132 end
diff --git a/v4.0/src/MAPPER/OPEN.ASM b/v4.0/src/MAPPER/OPEN.ASM
new file mode 100644
index 0000000..dec1f72
--- /dev/null
+++ b/v4.0/src/MAPPER/OPEN.ASM
@@ -0,0 +1,289 @@
1page 80,132
2;0
3title CP/DOS DosOpen mapper
4
5
6FileAttributeSegment segment word public 'fat'
7
8 public FileAttributeTable
9
10FileAttributeTable dw 100 dup(0)
11
12FileAttributeSegment ends
13
14
15dosxxx segment byte public 'dos'
16 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
17;
18; ************************************************************************* *
19; *
20; * MODULE: DosOpen
21; *
22; * FILE NAME: DosOpen.ASM
23; *
24; * FUNCTION: This module creates the specified file (if necessary),
25; * and opens it. If the file name is a device then the
26; * handle returned will be a device handle. The high order
27; * byte of the open flag is ignored because PC/DOS does not
28; * support a word long open mode. Invalid parameters are
29; * reported as general failures because there are no error
30; * codes defined at this time.
31; *
32; * CALLING SEQUENCE:
33; *
34; * PUSH@ ASCIIZ FileName ; File path name
35; * PUSH@ WORD FileHandle ; New file's handle
36; * PUSH@ WORD ActionTaken ; Action taken
37; * PUSH DWORD FileSize ; File primary allocation
38; * PUSH WORD FileAttribute ; File attribute
39; * PUSH WORD OpenFlag ; Open function type
40; * PUSH WORD OpenMode ; Open mode of the file
41; * PUSH@ DWORD 0 ; Reserved (must be zero)
42; * CALL DosOpen
43; *
44; * RETURN SEQUENCE:
45; *
46; * IF ERROR (AX not = 0)
47; *
48; * AX = Error Code:
49; *
50; * o Invalid parameter(s)
51; *
52; * o Insufficient disk space available
53; *
54; * o Insufficient resources (i.e., file handles)
55; *
56; *
57; * MODULES CALLED: DOS int 21H function 3DH
58; * DOS int 21H function 3EH
59; * DOS int 21H function 40H
60; * DOS int 21H function 42H
61; * DOS int 21H function 43H
62; *
63; *************************************************************************
64;
65 public DosOpen
66 .sall
67 .xlist
68 include macros.inc
69 .list
70
71ACT_FileExisted equ 1
72ACT_FileCreated equ 2
73
74
75str struc
76old_bp dw ?
77return dd ?
78resrv34 dd ? ; reserved
79OpenMode dw ? ; open mode
80OpenFlag dw ? ; open function type (1=Open only if already exist)
81OpenFileAttr dw ? ; file attribute
82FileSize dd ? ; file allocation size
83acttak34 dd ? ; action taken
84FileHandlePtr dd ? ; New file handler
85FileNamePtr dd ? ; file name pointer
86str ends
87
88;
89DosOpen proc far
90 Enter DosOpen ; save registers
91 sub sp,2 ; allocate space on the stack
92SaveArea equ -2
93
94; Check to see if we are trying to open a DASD device. If so, we must do
95; something unique as PC-DOS does not support this behavior.
96; Return a dummy DASD file handle. This used by IOCTL category 8 option.
97
98 test [bp].OpenMode,08000h ; DASD open ?
99 jz FileOpenRequest ; branch if file open
100
101 lds si,[bp].FileNamePtr ; convert device name to upper case
102 mov al,ds:[si]
103 cmp al,'a'
104 jc NoFold
105 cmp al,'z'+1
106 jnc NoFold
107
108 add al,'A' - 'a'
109
110NoFold:
111 sub al,'A'
112 jc BadDASDName ; jump if bad DASD name
113
114 cmp al,27
115 jnc BadDASDName
116
117 xor ah,ah ; drive number from 0 to 25
118 inc ax ; 1 to 26
119 inc ax ; 2 to 27
120 neg ax ; -2 to -27
121
122 lds si,[bp].FileHandlePtr
123 mov ds:[si],ax ; save dasd dummy device handle
124 jmp GoodExit ; in return data area and return
125
126BadDASDName:
127 mov ax,3 ; set error code
128 jmp ErrorExit ; return
129
130
131; Query the file attribute to determine if file exists
132
133
134FileOpenRequest:
135 lds dx,dword ptr [bp].FileNamePtr ; load asciiz string address
136 mov ax,04300h ; query file mode
137 int 21h ; get file mode
138 jnc SaveAttribute ; file does exist
139
140 cmp ax,00002h ; check if file does not exist error
141 je dne34 ; go here if does not exist
142
143 jmp erret34 ; error return
144
145SaveAttribute:
146 mov [bp].SaveArea,cx
147
148; File exists - determine what to do
149
150 lds si,dword ptr [bp].acttak34 ; Load action taken pointer
151 mov word ptr[si],ACT_FileExisted ; Indicate that file existed
152 mov ax,[bp].OpenFlag ; load open flag
153 and ax,00003h ; mask off the replace and open flags
154 cmp ax,00003h ; check if both are requested
155 je nxt134 ; error - invalid parm
156
157 cmp ax,00001h ; check if file is to be opened
158 je opn34 ; file should be opened
159
160 cmp ax,00002h ; check if file should be replaced
161 je creat34 ; file should be replaced
162
163nxt134:;
164 mov ax,0000ch ; report general
165 jmp erret34 ; failure
166
167;
168opn34:;
169
170; set the file attribute ( *** commented to fix mapper problem Pylee 6/10
171;
172; lds dx,dword ptr [bp].FileNamePtr ; load asciiz string address
173; mov cx,[bp].OpenFileAttr ; load the file attribute
174; mov ax,04301h ; change file mode
175; int 21h ; get file mode
176; jnc nxto34 ; continue good return
177; jmp erret34 ; error retrun
178
179nxto34:;
180
181; open the file
182
183 lds si,dword ptr [bp].acttak34 ; load action taken pointer
184 mov word ptr [si],00h ; clear action reported flag
185 lds dx,dword ptr [bp].FileNamePtr ; load asciiz string address
186 mov ax,[bp].OpenMode ; load the file mode
187
188 mov ah,03dh ; load opcode
189 int 21h ; open file
190 jc ErrorExit ; error return
191
192FileWasThere:
193 lds si,dword ptr [bp].FileHandlePtr ; load file handle address
194 mov [si],ax ; save file handle
195 jmp PutAwayAttribute ; normal return
196
197dne34:;
198
199; File does not exist - determine what to do
200
201 mov ax,[bp].OpenFlag ; load open flag
202 and ax,00010h ; check create
203 cmp ax,00010h ; and open file flag
204 je creat34 ; go create the file
205
206 mov ax,0000ch ; report general failure
207 jmp erret34 ; if create not requested
208
209creat34:;
210
211; file did not exist so it was created or replacement was requested
212
213 lds si,dword ptr [bp].acttak34 ; load action taken pointer
214 mov word ptr [si],ACT_FileCreated ; file created - action reported
215 lds dx,dword ptr [bp].FileNamePtr ; load asciiz string address
216 mov cx,[bp].OpenFileAttr ; set file attribute
217
218 mov ah,03ch
219 int 21h ; create the file
220 jc erret34 ; error return
221
222 lds si,dword ptr [bp].FileHandlePtr ; load file handle address
223 mov [si],ax ; save file handle
224;
225; set file length
226;
227 les dx,[bp].FileSize
228 mov cx,es
229 mov bx,ax ; load file handle
230
231 mov ax,04202h ; load opcode
232 int 21h ; move file pointer
233 jc erret34 ; error return
234
235len134:;
236 lds si,dword ptr [bp].FileHandlePtr ; load file handle address
237 mov bx,[si] ; load file handle
238 lds dx,dword ptr [bp].acttak34
239 sub cx,cx
240
241 mov ah,040h
242 int 21h ; write 0 length record
243 jc erret34 ; error return
244
245;
246len234:;
247;
248; close and reopen the file to make the length permanent
249;
250 lds si,dword ptr [bp].FileHandlePtr ; load file handle address
251 mov bx,[si] ; load file handle
252 mov ah,03eh
253 int 21h
254 jc erret34 ; error return
255
256 lds dx,dword ptr [bp].FileNamePtr ; load asciiz string address
257 mov ax,[bp].OpenMode ; load the file mode
258 mov ah,03dh ;
259 int 21h ; open the file
260 jc erret34 ; error return
261
262 lds si,dword ptr [bp].FileHandlePtr ; load file handle address
263 mov [si],ax ; save file handle
264
265PutAwayAttribute: ; save file attribute for other mapper
266 mov bx,ax ; calls
267 add bx,bx
268
269 mov ax,seg FileAttributeSegment
270 mov ds,ax
271 assume ds:FileAttributeSegment
272
273 mov ax,[bp].SaveArea
274 mov FileAttributeTable[bx],ax ; save file attribute
275
276GoodExit:
277 sub ax,ax ; set good return code
278
279erret34:;
280ErrorExit:
281 add sp,2 ; deallocate space
282 mexit ; restore registers
283 ret size str - 6 ; return
284
285DosOpen endp
286
287dosxxx ends
288
289 end
diff --git a/v4.0/src/MAPPER/OPENPTMS.DAT b/v4.0/src/MAPPER/OPENPTMS.DAT
new file mode 100644
index 0000000..ff99b68
--- /dev/null
+++ b/v4.0/src/MAPPER/OPENPTMS.DAT
@@ -0,0 +1,502 @@
1D0000004
2D4
3D0000009
4D9
5D0000013
6D13
7D0000039
8D39
9D0000043
10D43
11D0000047
12D47
13D0000058
14D58
15D0000064
16D64
17D0000069
18D69
19D0000072
20D72
21D0000074
22D74
23D0000075
24D75
25D0000079
26D79
27D0000088
28D88
29D0000089
30D89
31D0000091
32D91
33D0000093
34D93
35D0000096
36D96
37D0000097
38D97
39D0000102
40D102
41D0000107
42D107
43D0000112
44D112
45D0000113
46D113
47D0000115
48D115
49D0000120
50D120
51D0000134
52D134
53D0000136
54D136
55D0000137
56D137
57D0000138
58D138
59D0000143
60D143
61D0000146
62D146
63D0000149
64D149
65D0000150
66D150
67D0000151
68D151
69D0000152
70D152
71D0000156
72D156
73D0000157
74D157
75D0000158
76D158
77D0000159
78D159
79D0000160
80D160
81D0000161
82D161
83D0000162
84D162
85D0000163
86D163
87D0000164
88D164
89D0000165
90D165
91D0000166
92D166
93D0000167
94D167
95D0000171
96D171
97D0000172
98D172
99D0000173
100D173
101D0000174
102D174
103D0000175
104D175
105D0000176
106D176
107D0000177
108D177
109D0000178
110D178
111D0000180
112D180
113D0000181
114D181
115D0000182
116D182
117D0000183
118D183
119D0000184
120D184
121D0000185
122D185
123P0000004
124P4
125P0000020
126P20
127P0000021
128P21
129P0000023
130P23
131P0000025
132P25
133P0000026
134P26
135P0000032
136P32
137P0000037
138P37
139P0000044
140P44
141P0000046
142P46
143P0000047
144P47
145P0000063
146P63
147P0000068
148P68
149P0000071
150P71
151P0000073
152P73
153P0000074
154P74
155P0000075
156P75
157P0000084
158P84
159P0000086
160P86
161P0000088
162P88
163P0000097
164P97
165P0000103
166P103
167P0000112
168P112
169P0000134
170P134
171P0000160
172P160
173P0000163
174P163
175P0000164
176P164
177P0000169
178P169
179P0000170
180P170
181P0000171
182P171
183P0000172
184P172
185P0000177
186P177
187P0000178
188P178
189P0000188
190P188
191P0000189
192P189
193P0000191
194P191
195P0000200
196P200
197P0000209
198P209
199P0000218
200P218
201P0000219
202P219
203P0000220
204P220
205P0000222
206P222
207P0000227
208P227
209P0000231
210P231
211P0000232
212P232
213P0000233
214P233
215P0000237
216P237
217P0000242
218P242
219P0000244
220P244
221P0000246
222P246
223P0000254
224P254
225P0000255
226P255
227P0000256
228P256
229P0000258
230P258
231P0000259
232P259
233P0000260
234P260
235P0000262
236P262
237P0000264
238P264
239P0000265
240P265
241P0000270
242P270
243P0000271
244P271
245P0000272
246P272
247P0000282
248P282
249P0000284
250P284
251P0000285
252P285
253P0000295
254P295
255P0000296
256P296
257P0000297
258P297
259P0000298
260P298
261P0000301
262P301
263P0000302
264P302
265P0000303
266P303
267P0000304
268P304
269P0000305
270P305
271P0000306
272P306
273P0000308
274P308
275P0000312
276P312
277P0000314
278P314
279P0000315
280P315
281P0000320
282P320
283P0000321
284P321
285P0000322
286P322
287P0000323
288P323
289P0000324
290P324
291P0000325
292P325
293P0000326
294P326
295P0000327
296P327
297P0000328
298P328
299P0000332
300P332
301P0000333
302P333
303P0000334
304P334
305P0000335
306P335
307P0000339
308P339
309P0000341
310P341
311P0000342
312P342
313P0000343
314P343
315P0000345
316P345
317P0000347
318P347
319P0000348
320P348
321P0000349
322P349
323P0000350
324P350
325P0000351
326P351
327P0000352
328P352
329P0000354
330P354
331P0000355
332P355
333P0000359
334P359
335P0000360
336P360
337P0000363
338P363
339P0000365
340P365
341P0000366
342P366
343P0000367
344P367
345P0000368
346P368
347P0000369
348P369
349P0000370
350P370
351P0000371
352P371
353P0000373
354P373
355P0000374
356P374
357P0000376
358P376
359P0000377
360P377
361P0000378
362P378
363P0000379
364P379
365P0000380
366P380
367P0000381
368P381
369P0000382
370P382
371P0000383
372P383
373P0000384
374P384
375P0000385
376P385
377P0000386
378P386
379P0000387
380P387
381P0000388
382P388
383P0000389
384P389
385P0000390
386P390
387P0000391
388P391
389P0000392
390P392
391P0000393
392P393
393P0000394
394P394
395P0000395
396P395
397P0000397
398P397
399P0000398
400P398
401P0000400
402P400
403P0000401
404P401
405P0000402
406P402
407P0000404
408P404
409P0000405
410P405
411P0000406
412P406
413P0000407
414P407
415P0000408
416P408
417P0000409
418P409
419P0000410
420P410
421P0000411
422P411
423P0000412
424P412
425P0000413
426P413
427P0000414
428P414
429P0000415
430P415
431P0000416
432P416
433P0000417
434P417
435P0000418
436P418
437P0000419
438P419
439P0000420
440P420
441P0000421
442P421
443P0000422
444P422
445P0000424
446P424
447P0000425
448P425
449P0000426
450P426
451P0000427
452P427
453P0000428
454P428
455P0000430
456P430
457P0000431
458P431
459P0000432
460P432
461P0000433
462P433
463P0000434
464P434
465P0000435
466P435
467P0000436
468P436
469P0000437
470P437
471P0000438
472P438
473P0000441
474P441
475P0000442
476P442
477P0000443
478P443
479P0000444
480P444
481P0000445
482P445
483P0000446
484P446
485P0000447
486P447
487P0000448
488P448
489P0000449
490P449
491P0000450
492P450
4930000443
494P443
495P0000444
496P444
497P0000445
498P445
499P0000446
500P446
501P0000447
502P \ No newline at end of file
diff --git a/v4.0/src/MAPPER/PUTMSG.ASM b/v4.0/src/MAPPER/PUTMSG.ASM
new file mode 100644
index 0000000..ef1bef9
--- /dev/null
+++ b/v4.0/src/MAPPER/PUTMSG.ASM
@@ -0,0 +1,67 @@
1page 60,132
2
3title CP/DOS DOSPutMessage mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7;
8; ************************************************************************* *
9; *
10; * MODULE: DosPutMessage
11; *
12; * FILE NAME: dos035.asm
13; *
14; * FUNCTION: diplay message
15; *
16; * CALLING SEQUENCE:
17; *
18; * push handle ; file handle
19; * push messlgth ; message length
20; * push messbuff ; message buffer
21; * call dosputmessage
22; *
23; * RETURN SEQUENCE: AX = return code
24; *
25; *
26; *
27; * MODULES CALLED: INT 21H function 4
28; *
29; *************************************************************************
30
31 public dosputmessage
32 .sall
33 .xlist
34 include macros.inc
35 .list
36
37str struc
38old_bp dw ?
39return dd ?
40MessagePtr dd ? ; message pointer
41MessageLength dw ? ; message length
42Handle dw ? ; file handle
43str ends
44
45dosputmessage proc far
46
47 Enter dosputmessage ; save registers
48
49 mov bx,[bp].Handle ; get handle
50 mov cx,[bp].MessageLength ; get message length
51 lds dx,[bp].MessagePtr ; setup message buffer
52
53 mov ah,40h ; load opcode
54 int 21h ; display message
55 jc ErrorExit ; jump if error
56
57 xor ax,ax ; else set good return code
58
59ErrorExit:
60 Mexit ; pop registers
61 ret size str - 6 ; return
62
63dosputmessage endp
64
65dosxxx ends
66
67 end
diff --git a/v4.0/src/MAPPER/QCURDIR.ASM b/v4.0/src/MAPPER/QCURDIR.ASM
new file mode 100644
index 0000000..9853d89
--- /dev/null
+++ b/v4.0/src/MAPPER/QCURDIR.ASM
@@ -0,0 +1,104 @@
1;
2page 80,132
3;
4title CP/DOS DosQCurDir mapper
5
6buffer segment word public 'buffer'
7CurrentDirectoryBuffer db 128 dup(?)
8buffer ends
9
10dosxxx segment byte public 'dos'
11 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
12
13;**********************************************************************
14;*
15;* MODULE: dosqcurdir
16;*
17;* FILE NAME: dos036.asm
18;*
19;* CALLING SEQUENCE:
20;*
21;* push word drive number (0=default, 1=a, etc.)
22;* push@ other dirpath
23;* push@ other dirpathlen
24;*
25;* call doqcurdir
26;*
27;* MODULES CALLED: PC-DOS Int 21h, ah=47h, get current directory
28;*
29;*********************************************************************
30
31 public dosqcurdir
32 .sall
33 include macros.inc
34
35str struc
36old_bp dw ?
37return dd ?
38BufferLengthPtr dd ? ; directory path buffer length pointer
39BufferPtr dd ? ; directory path buffer pointer
40Drive dw ? ; driver number
41str ends
42
43
44dosqcurdir proc far
45
46 Enter Dosqcurdir ; push registers
47
48 mov ax,seg buffer ; set temporary buffer to receive
49 mov ds,ax ; dircetory path information
50 assume ds:buffer
51 mov si,offset buffer:CurrentDirectoryBuffer
52 mov dx,[bp].drive ; set driver number
53
54 mov ah,47h
55 int 21h ; get directory path information
56 jc ErrorExit ; check for error
57
58 mov di,ds
59 mov es,di
60 assume es:buffer
61
62; next calculate the size of the path name just received
63
64 mov di,offset buffer:CurrentDirectoryBuffer
65 mov cx,128
66 mov al,0 ; look for the non-ascii chara
67 cld ; in the buffer indciates the
68 repne scasb ; end of the path.
69
70 mov dx,128
71 sub dx,cx ; calculate actual path length
72
73 les di,[bp].BufferLengthPtr ; set path buffer lenght pointer
74 assume es:nothing
75 mov cx,es:[di] ; check for directory path
76 ; buffe size
77 cmp cx,dx ; compare with needed length
78 jnc HaveThePathLength ; branch if length is ok
79
80 mov ax,8 ; else, set error code
81 jmp ErrorExit ; return
82
83HaveThePathLength:
84 mov cx,dx
85 mov es:[di],dx ; return path length
86
87 les di,[bp].BufferPtr ; prepare to move directory path name
88 ; into return buffer
89 mov si,offset buffer:CurrentDirectoryBuffer
90
91 rep movsb ; copy dir path to return buffer
92
93 sub ax,ax ; set good return
94
95ErrorExit:
96 mexit ; pop registers
97 ret size str - 6 ; return
98
99dosqcurdir endp
100
101dosxxx ends
102
103 end
104
diff --git a/v4.0/src/MAPPER/QCURDSK.ASM b/v4.0/src/MAPPER/QCURDSK.ASM
new file mode 100644
index 0000000..7abf22e
--- /dev/null
+++ b/v4.0/src/MAPPER/QCURDSK.ASM
@@ -0,0 +1,148 @@
1;0
2page 80,132
3;
4title CP/DOS DosQCurDisk mapper
5
6 extrn dosqcurdir:far
7 extrn dosdevconfig:far
8
9buffer segment word public 'buffer'
10drive dw ? ; driver number
11buffr db 20 dup(?) ; buffer
12bufflng dw 20 ; buffer length
13map dw 2 dup(?) ; map area
14dsket db ? ;
15buffer ends
16
17
18
19dosxxx segment byte public 'dos'
20 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
21
22;
23;**********************************************************************
24;*
25;* MODULE: dosqcurdisk
26;*
27;* FILE NAME: dos037.asm
28;*
29;* CALLING SEQUENCE:
30;*
31;* push@ dword drive number return location pointer
32;* push@ dword drive map area pointer
33;* call dosqcurdisk
34;*
35;* MODULES CALLED: PC-DOS Int 21h, AH=19h, get current disk
36;* Rom Bios Int 11 (called by DosDevConfig)
37;*
38;*********************************************************************
39;
40 public dosqcurdisk
41 .sall
42 .xlist
43 include macros.inc
44 .list
45
46str struc
47old_bp dw ?
48return dd ?
49Drvmap dd ? ; drive map pointer
50Drvnbr dd ? ; drive number
51str ends
52
53
54defdrive db ? ; Save area for default drive -->RW
55
56
57
58dosqcurdisk proc far
59
60 Enter Dosqcurdisk ; push registers
61
62 mov ah,19h ; get current default drive
63 int 21h
64 mov defdrive,al ; Save default drive
65
66 cbw ; fill ax with drive #
67 lds si,[bp].drvnbr ; output address
68 inc ax ; set drive A = 1
69 mov word ptr [si],ax ; drive number
70
71 mov ax,buffer ; prepare data segment
72 mov ds,ax ; register for calls
73
74 assume ds:buffer
75
76 lea di,dsket ; diskette address
77 push ds
78 push di
79 mov ax,2 ; request diskette count
80 push ax
81 sub ax,ax ; reserved parm
82 push ax
83
84 call dosdevconfig ; get number of drives
85
86 cmp dsket,0 ; if none, jump
87 je nodisk
88 stc ; else set flag
89 jmp short dskbits
90
91nodisk: clc ; clear flag
92
93dskbits: mov map+2,0 ; clear output areas
94 mov map,0
95 pushf ; save carry status, then
96 rcr map+2,1 ; set flags for devices
97 popf ; A and B
98 rcr map+2,1
99
100 mov drive,2 ; start at C -->RW --> Changed 3 to 2
101 mov di,2 ; start with low-order
102loopx:
103 mov ah,0eh ; DOS Select Disk -->RW
104 mov dx,drive ; Drive number in DL -->RW
105 int 021h ; -->RW
106
107 mov ah,019h ; DOS Get Current Disk -->RW
108 int 021h ; -->RW
109 xor ah,ah ; Clear AH -->RW
110 cmp ax,drive ; Drive now in AX -->RW
111
112 je driveok ; drive at this number
113 clc ; else drive no good
114 jmp short rotate
115
116driveok: stc
117
118rotate: rcr map[di],1 ; shift bit in
119 inc drive
120 cmp drive,17 ; finished first word?
121 jl loopx ; if no, jump
122 mov di,0 ; if so, switch to high
123 cmp drive,26 ; order word, and check
124 jle loopx ; for last drive.
125 ;restore current drive
126 mov ah,0eh ; DOS Select Disk -->RW
127 mov dl,defdrive ; Drive number in DL -->RW
128 int 021h ; -->RW
129
130 mov cl,6 ; only ten bits used
131 shr map,cl ; in high-order word.
132 mov ax,map ; Now put in registers
133 mov bx,map+2 ; for shift into output
134 push cs ; area.
135 pop ds
136 lds si,[bp].drvmap ;
137 mov [si],ax
138 mov [si]+2,bx ;
139 ; Set good return code -->RW
140 xor ax,ax
141exit: mexit ; pop registers
142 ret size str - 6 ; return
143
144dosqcurdisk endp
145
146dosxxx ends
147
148 end
diff --git a/v4.0/src/MAPPER/QFILEINF.ASM b/v4.0/src/MAPPER/QFILEINF.ASM
new file mode 100644
index 0000000..b35bdbb
--- /dev/null
+++ b/v4.0/src/MAPPER/QFILEINF.ASM
@@ -0,0 +1,146 @@
1; 0
2page 80,132
3;
4title CP/DOS DosQFileInfo mapper
5;
6
7FileAttributeSegment segment word public 'fat'
8
9 extrn FileAttributeTable:word
10
11FileAttributeSegment ends
12
13dosxxx segment byte public 'dos'
14 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
15;
16;**********************************************************************
17;*
18;* MODULE: dosQfileinfo
19;*
20;* FILE NAME: dos052.asm
21;*
22;* CALLING SEQUENCE:
23;*
24;* push word filehandle
25;* push word fileinfolevel
26;* push@ other fileinfobuffer
27;* push word filebuffersize
28;* call dossetfileinfo
29;*
30;* MODULES CALLED: PC-DOS Int 21h, ah=57h, set file's date/time
31;*
32;*********************************************************************
33
34 public dosQfileinfo
35 .sall
36 .xlist
37 include macros.inc
38 .list
39
40
41FileInfo struc
42CreateDate dw ?
43CreateTime dw ?
44LastAccessDate dw ?
45LastAccessTime dw ?
46LastWriteDate dw ?
47LastWriteTime dw ?
48DataLength dd ? ; File size
49FileSpace dd ? ; falloc_size
50Attributes dw ? ; attributes
51FileInfo ends
52
53
54str struc
55old_bp dw ?
56return dd ?
57BufferSize dw ? ; file data buffer size
58BufferPtr dd ? ; file data buffer
59Level dw ? ; file data info level
60Handle dw ? ; file handle
61str ends
62
63dosQfileinfo proc far
64 Enter dosQfileinfo ; save registers
65
66 mov bx,[bp].handle ;fill registers for function call
67
68 mov ax,05700h
69 int 21h ; get file date and time
70 jc ErrorExit ; jump if error
71
72 lds si,[bp].BufferPtr ; copy date and time to
73 mov ds:[si].CreateDate,dx ; file info return data area
74 mov ds:[si].CreateTime,cx
75 mov ds:[si].LastAccessDate,dx
76 mov ds:[si].LastAccessTime,cx
77 mov ds:[si].LastWriteDate,dx
78 mov ds:[si].LastWriteTime,cx
79
80; Calculate the file length and file space and save in the file info data area
81
82 mov cx,0 ; get the current position
83 mov dx,0
84 mov bx,[bp].handle ; get file handle
85
86 mov ax,04201h
87 int 21h ; move file pointer to the
88 jc ErrorExit ; current position
89
90 push dx
91 push ax
92
93 mov cx,0
94 mov dx,0
95 mov bx,[bp].Handle
96
97 mov ax,04202h ; move file pointer to end-of-file
98 int 21h
99
100 lds si,[bp].BufferPtr ; save the file length in
101 mov ds:word ptr DataLength[si+0],ax ; file info data area
102 mov ds:word ptr DataLength[si+2],dx
103
104 test ax,511
105 jz HaveSpace
106
107 and ax,not 511
108 add ax,512
109 adc dx,0
110
111HaveSpace:
112 mov ds:word ptr FileSpace[si+0],ax ; save file space
113 mov ds:word ptr FileSpace[si+2],dx ; in return data area
114
115; calculate the file attribute and save
116
117 pop dx
118 pop cx
119
120 mov bx,[bp].Handle
121
122 mov ax,04200h
123 int 21h ; move the file pointer
124 jc ErrorExit
125
126 mov ax,seg FileAttributeSegment
127 mov ds,ax
128 assume ds:FileAttributeSegment
129
130 mov bx,[bp].Handle
131 add bx,bx
132
133 mov ax,FileAttributeTable[bx]
134 mov [bp].Attributes,ax ; save file attribute
135
136 sub ax,ax ; set good return code
137
138ErrorExit:
139 mexit ; restore registers
140 ret size str - 6 ; return
141
142dosqfileinfo endp
143
144dosxxx ends
145
146 end
diff --git a/v4.0/src/MAPPER/QFILEMOD.ASM b/v4.0/src/MAPPER/QFILEMOD.ASM
new file mode 100644
index 0000000..59fc70c
--- /dev/null
+++ b/v4.0/src/MAPPER/QFILEMOD.ASM
@@ -0,0 +1,64 @@
1page 80,132
2
3title CP/DOS DosQFileMode mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7;
8;**********************************************************************
9;*
10;* MODULE: dosqfilemode Read file attribute
11;*
12;* FUNCTION: Query file mode
13;*
14;* CALLING SEQUENCE:
15;*
16;* push@ asciiz file path name
17;* push@ word attribute return area
18;* push dword reserved
19;* call dosqfilemode
20;*
21;* MODULES CALLED: PC-DOS Int 21h, ah=43h, change file mode
22;*
23;*********************************************************************
24
25 public dosqfilemode
26 .sall
27 .xlist
28 include macros.inc
29 .list
30
31error_code equ 0002h
32
33str struc
34old_bp dw ?
35return dd ?
36rsrvd dd ?
37Attrib dd ? ; current attribute pointer
38Path dd ? ; file path name pointer
39str ends
40
41dosqfilemode proc far
42 Enter dosqfilemode ; push registers
43
44 lds dx,[bp].path ; set path name
45
46 mov ax,4300h ; set op code
47 int 21h ; get file mode
48 jc error ; jump if error
49
50 lds si,[bp].attrib ; setup return data area
51 mov word ptr [si],cx ; save attribute there
52 sub ax,ax ; set good return code
53 jmp short exit ; return
54
55error: mov ax,error_code ; set error code
56
57exit: mexit ; pop registers
58 ret size str - 6 ; return
59
60dosqfilemode endp
61
62dosxxx ends
63
64 end
diff --git a/v4.0/src/MAPPER/QFSINFO.ASM b/v4.0/src/MAPPER/QFSINFO.ASM
new file mode 100644
index 0000000..fe0fdba
--- /dev/null
+++ b/v4.0/src/MAPPER/QFSINFO.ASM
@@ -0,0 +1,136 @@
1page 80,132
2
3title CP/DOS DosQFsInfo mapper
4
5buffer segment word public 'buffer'
6
7clsdr40 dw ?
8avlcls40 dw ?
9secalc40 dw ?
10bytsec40 dw ?
11
12buffer ends
13
14dosxxx segment byte public 'dos'
15 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
16;
17; ************************************************************************* *
18; *
19; * MODULE: DosQFsInfo
20; *
21; * FILE NAME: DOS040.ASM
22; *
23; * FUNCTION: This module will return the information for a file
24; * system device.
25; *
26; * CALLING SEQUENCE:
27; *
28; * PUSH WORD DriveNumber ; Drive Number
29; * PUSH OTHER FSInfoLevel ; File system info required
30; * PUSH@ OTHER FSInfoBuf ; File system info buffer
31; * PUSH WORD FSInfoBufSize ; file system info buffer size
32; * Call DosQFsInfo
33; *
34; *
35; * RETURN SEQUENCE:
36; *
37; * IF ERROR (AX not = 0)
38; *
39; * AX = Error Code:
40; *
41; * o Invalid parameter
42; *
43; *
44; * MODULES CALLED: DOS int 21H function 19H
45; * DOS int 25H
46; *
47; *
48; *************************************************************************
49
50 public DosQFsInfo
51 .sall
52 .xlist
53 include macros.inc
54 include error.inc
55 .list
56
57str struc
58old_bp dw ?
59return dd ?
60FSIBS40 dw ? ; info buffer size
61FSIB40 dd ? ; info buffer
62ILL40 dw ? ; info level
63DRNUM40 dw ? ; driver number
64str ends
65
66DosQFsInfo proc far
67 Enter Dosqfsinfo ; push registers
68
69 mov dx,[bp].drnum40 ; load drive number
70 mov ah,036h
71 int 21h ; get disk space
72
73 cmp ax,0ffffh ; check if valid drive number
74 jne valdr40 ; jump if drive is ok
75
76 mov ax,error_invalid_parameter ; esle set error code
77 jmp erret40 ; error return
78
79valdr40:;
80 push ax
81 mov ax,buffer ; set the data segment and save
82 push ax ; space information in the data area
83 pop ds
84 assume ds:buffer
85 mov avlcls40,bx ; save available cluster
86 mov clsdr40,dx ; save clusters per drive
87 mov bytsec40,cx ; save bytes per sector
88 pop ax ;
89 mov secalc40,ax ; save sectors per allocation unit
90 mov ax,[bp].ill40 ; get info level
91 cmp al,01 ; valid level ??
92 je getinfo40 ; jump if valid
93
94 mov ax,error_invalid_parameter ; else invalid parameter
95 jmp erret40 ; error return
96
97getinfo40:;
98 mov ax,[bp].fsibs40 ; get info buffer size address
99 cmp ax,18 ; check if valid
100 jge bufok40 ; jump if valid
101
102 mov ax,error_buffer_overflow ; move buffer not big enough
103 jmp erret40 ; error return
104
105bufok40:;
106 les di,[bp].fsib40 ; get FSI buffer pointer
107 sub ax,ax ; return
108 mov es:[di],ax ; null
109 mov es:[di]+2,ax ; File system ID
110 add di,4 ; set pointer to number of sectors in alloc
111 sub ax,ax ;
112 mov es:[di]+2,ax ; set high order # of sectors in alloc to 0
113 mov ax,secalc40 ;
114 mov es:[di],ax ; store low order # of sectors in alloc
115 add di,4 ; set pointer to number of allocation units
116 mov ax,clsdr40 ; load low order number
117 mov es:[di],ax ; of alloc units
118 sub ax,ax ;
119 mov es:[di]+2,ax ; set high order # of alloc units to 0
120 mov ax,avlcls40 ; load low order number
121 mov es:[di]+4,ax ; of avail alloc units
122 sub ax,ax ;
123 mov es:[di]+6,ax ; set high order # of avail alloc to 0
124 mov ax,bytsec40 ; get number
125 mov es:[di]+8,ax ; of bytes per sector
126 sub ax,ax ; set good return code
127
128erret40:;
129 mexit ; pop registers
130 ret size str - 6 ; return
131
132DosQFsInfo endp
133
134dosxxx ends
135
136 end
diff --git a/v4.0/src/MAPPER/QHANDTYP.ASM b/v4.0/src/MAPPER/QHANDTYP.ASM
new file mode 100644
index 0000000..e9fcaaf
--- /dev/null
+++ b/v4.0/src/MAPPER/QHANDTYP.ASM
@@ -0,0 +1,76 @@
1;
2page 60,132
3;
4title CP/DOS DOSQhandtype mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosQhandtype
12; *
13; * FILE NAME: DosQhandtype
14; *
15; * FUNCTION: Determine whether a handle is file or device
16; *
17; * CALLING SEQUENCE:
18; *
19; * push handle ; file handle
20; * push@ handtype ; handle type
21; * push@ flagword ; device descriptor word
22; * call dosqhandtype
23; *
24; * RETURN SEQUENCE:
25; *
26; * handle type: 0 - if a file
27; * 1 - if a device
28; * MODULES CALLED:
29; *
30; *
31; *************************************************************************
32
33 public dosqhandtype
34 .sall
35 .xlist
36 include macros.inc
37 .list
38
39
40str struc
41old_bp dw ?
42return dd ?
43AttributePtr dd ? ; Device descriptor word returned if device
44HandleTypePtr dd ? ; handle type; 0 = file handle, 1 = device handle
45Handle dw ? ; file handle
46str ends
47
48
49dosqhandtype proc far
50
51 Enter dosqhandtype ; push registers
52
53 mov bx,[bp].Handle ; get file handle
54 mov ax,4400h
55 int 21h ; get handle type
56
57 lds si,[bp].AttributePtr ; setup area for attribute return
58 mov ds:[si],dx
59
60 lds si,[bp].HandleTypePtr
61 mov ds:word ptr [si],0 ; assume it is a file
62
63 test dx,00080h ; test for file
64 jz ItIsAFile ; jump if true
65
66 mov ds:word ptr [si],1 ; else, it is a device, set flag
67
68ItIsAFile:
69 Mexit ; pop registers
70 ret size str - 6 ; return
71
72dosqhandtype endp
73
74dosxxx ends
75
76 end
diff --git a/v4.0/src/MAPPER/QVERIFY.ASM b/v4.0/src/MAPPER/QVERIFY.ASM
new file mode 100644
index 0000000..4ebd154
--- /dev/null
+++ b/v4.0/src/MAPPER/QVERIFY.ASM
@@ -0,0 +1,54 @@
1;
2page 80,132
3;
4title CP/DOS DosQVerify mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosqverify Returns the value of the verify flag
12;*
13;* FILE NAME: dos041.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ word verify setting
18;* call dosqverify
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=54h, get verify setting
21;*
22;*********************************************************************
23
24 public dosqverify
25 .sall
26 .xlist
27 include macros.inc
28 .list
29
30str struc
31old_bp dw ?
32return dd ?
33verify dd ? ; return data area pointer
34str ends
35
36dosqverify proc far
37 Enter dosqverify ; save registers
38
39 mov ah,54h
40 int 21h ; get verify flag setting
41
42 lds si,[bp].verify ; setup return data area
43 cbw ; fill word
44 mov word ptr [si],ax ; save verify flag setting
45 sub ax,ax ; set good return code
46
47exit: Mexit ; pop registers
48 ret size str - 6 ; return
49
50dosqverify endp
51
52dosxxx ends
53
54 end
diff --git a/v4.0/src/MAPPER/READ.ASM b/v4.0/src/MAPPER/READ.ASM
new file mode 100644
index 0000000..ec2367b
--- /dev/null
+++ b/v4.0/src/MAPPER/READ.ASM
@@ -0,0 +1,63 @@
1page 80,132
2
3title CP/DOS DosRead mapper * * *
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7
8;**********************************************************************
9;*
10;* MODULE: dosreade
11;*
12;* FUNCTION: Read a specified number of bytes from the file
13;*
14;* CALLING SEQUENCE:
15;*
16;* push word file handle
17;* push@ other buffer area
18;* push word buffer length
19;* push@ word bytes read
20;* call dosread
21;*
22;* MODULES CALLED: PC-DOS Int 21h, ah=3fh,
23;*
24;*********************************************************************
25
26 public dosread
27 .sall
28 .xlist
29 include macros.inc
30 .list
31
32str struc
33old_bp dw ?
34return dd ?
35Written dd ? ; number of bytes actually read
36Bufflng dw ? ; number of bytes to be read
37Buffer dd ? ; read buffer
38Handle dw ? ; handle
39str ends
40
41dosread proc far
42 Enter Dosread ; save registers
43
44 mov bx,[bp].handle ; fill registers for
45 lds dx,[bp].buffer ; function call
46 mov cx,[bp].bufflng ; number of bytes to read
47
48 mov ah,3fh ; load opcode
49 int 21h ; read from file
50 jc exit ; jump if error
51
52 lds si,[bp].written ; else, set return data area
53 mov word ptr [si],ax ; save number of bytes read
54 sub ax,ax ; set good return code
55
56exit: mexit ; pop registers
57 ret size str - 6 ; rturn
58
59dosread endp
60
61dosxxx ends
62
63 end
diff --git a/v4.0/src/MAPPER/REALLSEG.ASM b/v4.0/src/MAPPER/REALLSEG.ASM
new file mode 100644
index 0000000..352a091
--- /dev/null
+++ b/v4.0/src/MAPPER/REALLSEG.ASM
@@ -0,0 +1,81 @@
1;
2page 60,132
3;
4title CP/DOS DosReallocSeg mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: DosReallocSeg
12; *
13; * FILE NAME: dos043.asm
14; *
15; * FUNCTION: This module changes the size of a segment already
16; * allocated
17; *
18; * CALLING SEQUENCE:
19; *
20; * push size ; new segment size requested in bytes
21; * push selector ; selector
22; * call dosreallocseg
23; *
24; * RETURN SEQUENCE:
25; *
26; *
27; *
28; * MODULES CALLED: DOS Int 21, AH=4A
29; *
30; *
31; *
32; *************************************************************************
33;
34 public dosreallocseg
35 .sall
36 .xlist
37 include macros.inc
38 .list
39
40str struc
41old_bp dw ?
42return dd ?
43Selector dw ? ; segment selector
44SegmentSize dw ? ; new segment size in bytes
45str ends
46
47dosreallocseg proc far
48 Enter dosreallocseg ; save registers
49
50 mov bx,[bp].SegmentSize ; Get new segment size
51 cmp bx,0 ; check for 0
52 je AllocateMax ; jmp to full seg
53
54 shr bx,1 ; else convert segment in bytes
55 shr bx,1 ; paragraph
56 shr bx,1
57 shr bx,1
58 jmp HaveSize
59
60AllocateMax:
61 mov bx,4096 ; default segment size in paragraph
62
63HaveSize:
64 mov es,[bp].Selector ; set up segment for new size
65
66 mov ah,4ah ; set up for DOS realloc call
67 int 21h ; realloc segment
68 jc ErrorExit ; jump if error
69
70 sub ax,ax ; else set good return code
71
72ErrorExit:
73 Mexit ; restore registers
74
75 ret size str - 6 ; return
76
77dosreallocseg endp
78
79dosxxx ends
80
81 end
diff --git a/v4.0/src/MAPPER/RMDIR.ASM b/v4.0/src/MAPPER/RMDIR.ASM
new file mode 100644
index 0000000..4925ac5
--- /dev/null
+++ b/v4.0/src/MAPPER/RMDIR.ASM
@@ -0,0 +1,53 @@
1page 80,132
2
3title CP/DOS DosRmDir mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7
8;**********************************************************************
9;*
10;* MODULE: dosrmdir
11;*
12;* FUNCTION: remove directory
13;*
14;* CALLING SEQUENCE:
15;*
16;* push@ asciiz directory name
17;* push dword reserved (must be zero)
18;* call dosrmdir
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=3ah, remove subdirectory
21;*
22;*********************************************************************
23
24 public dosrmdir
25 .sall
26 include macros.inc
27
28str struc
29old_bp dw ?
30return dd ?
31rsrvd dd ? ; reserved
32asciiz dd ? ; directory name pointer
33str ends
34
35dosrmdir proc far
36
37 Enter dosrmdir ; push registers
38
39 lds dx,[bp].asciiz ; set pointer to directory name
40
41 mov ah,3ah ; load opcode
42 int 21h ; remove directory
43 jc exit ; check for error
44
45 sub ax,ax ; set good return code
46exit: Mexit ; pop registers
47 ret size str - 6 ; return
48
49dosrmdir endp
50
51dosxxx ends
52
53 end
diff --git a/v4.0/src/MAPPER/SCNTRY.ASM b/v4.0/src/MAPPER/SCNTRY.ASM
new file mode 100644
index 0000000..2d17ce9
--- /dev/null
+++ b/v4.0/src/MAPPER/SCNTRY.ASM
@@ -0,0 +1,57 @@
1;
2page 60,132
3;
4title CP/DOS DosSetCtryCode mapper
5;
6dosxxx segment
7 assume cs:dosxxx,ds:dosxxx,es:dosxxx,ss:dosxxx
8;
9;**********************************************************************
10;*
11;* MODULE: dossetctrycode
12;*
13;* FILE NAME: dos049.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ dword country code
18;* call dossetctrycode
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=38h, set country code
21;*
22;*********************************************************************
23
24 public dossetctrycode
25 .sall
26 include macros.inc
27
28str struc
29Old_bp dw ?
30Return dd ?
31Ccode dd ? ; country code
32str ends
33
34dossetctrycode proc far
35 Enter dossetctrycode ; push registers
36
37 lds si,[bp].ccode
38 mov ax,word ptr [si] ; get country code
39 mov cx,255
40 cmp ax,cx ; check for country code >= 255
41 jl okay ; branch if less
42
43 mov bx,ax ; if so, load into bx
44 mov al,cl ; and set flag
45okay: mov dx,0ffffh ; Set DX
46
47 mov ah,38h ; DOS INT function code
48 int 21h ; set country information
49 jc exit ; branch if error
50
51 sub ax,ax ; set good return
52exit: mexit ; pop registers
53 ret size str - 6 ; return
54
55dossetctrycode endp
56dosxxx ends
57 end
diff --git a/v4.0/src/MAPPER/SCROLLUP.ASM b/v4.0/src/MAPPER/SCROLLUP.ASM
new file mode 100644
index 0000000..cb92e8c
--- /dev/null
+++ b/v4.0/src/MAPPER/SCROLLUP.ASM
@@ -0,0 +1,103 @@
1;
2page 60,132
3;
4title CP/DOS VioScrollUp mapper
5;
6vioxxx segment byte public 'vio'
7 assume cs:vioxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: VioScrollUp
12; *
13; * FILE NAME: scrollup.asm
14; *
15; * CALLING SEQUENCE:
16; *
17; *
18; * push word toprow
19; * push word leftcol
20; * push word botrow
21; * push word rightcol
22; * push word lines
23; * push@ dword cell
24; * push word vio handle
25; * call vioscrollup
26; *
27; * MODULES CALLED: BIOS Int 10h
28; *
29; *
30; *
31; *************************************************************************
32
33 public vioscrollup
34 .sall
35 .xlist
36 include macros.inc
37 .list
38
39error_bvs_parameter equ 0002h
40
41str struc
42old_bp dw ?
43return dd ?
44handle dw ? ; vio handle
45cell dd ? ; cell to be written
46lines dw ? ; number of blank lines
47rightcol dw ? ; right column
48botrow dw ? ; bottom row
49leftcol dw ? ; left column
50toprow dw ? ; top row
51str ends
52
53vioscrollup proc far
54 Enter VioScrollUp ; save registers
55
56 mov bx,[bp].lines ; get number of blank lines
57 cmp bl,25 ; check for validity
58 jg error ; jump if invalid
59
60 mov al,bl
61 jmp ar02
62
63ar01: mov al,00h
64ar02: mov ah,06h ; set scroll up function code
65
66 mov bx,[bp].rightcol ; get right col number
67 cmp bl,80 ; check the validity
68 jg error ; branch if error
69 mov dl,bl ; right column number in DL
70
71 mov bx,[bp].botrow ; get bottom row
72 cmp bl,25 ; check for validity
73 jg error ; branch if error
74 mov dh,bl ; bottom row in DH
75
76 mov bx,[bp].leftcol ; get left column number
77 mov cl,bl ; left column in CL
78
79 mov bx,[bp].toprow ; get top row number
80 mov ch,bl ; top row in CH
81
82 lds si,[bp].cell ; Set up cell in BX
83 mov bx,ds:[si] ; *****************
84; cmp bl,15 ; check validity ** assume good **
85; jg error ; branch if error ** attribute! **
86 ; *****************
87 mov bh,bl ; filler attribute in BH
88 pushal ; Save registers in case int 10h
89 ; messes them up
90 int 10h ; scrollup the display
91
92 popal
93 sub ax,ax ; set no error code
94 jmp exit ; return
95
96error: mov ax,error_bvs_parameter ; set error code
97
98exit: Mexit ; pop registers
99 ret size str - 6 ; return
100
101vioscrollup endp
102vioxxx ends
103 end
diff --git a/v4.0/src/MAPPER/SCURPOS.ASM b/v4.0/src/MAPPER/SCURPOS.ASM
new file mode 100644
index 0000000..e7af7a6
--- /dev/null
+++ b/v4.0/src/MAPPER/SCURPOS.ASM
@@ -0,0 +1,72 @@
1;
2page 60,132
3;
4title CP/DOS VioSetCurPos mapper
5;
6vioxxx segment byte public 'vio'
7 assume cs:vioxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: viosetcurpos
12; *
13; * FILE NAME: scurpos.asm
14; *
15; * CALLING SEQUENCE:
16; *
17; * push word row value
18; * push word column value
19; * push word vio handle
20; * call viosetcurpos
21; *
22; *
23; * MODULES CALLED: BIOS Int 10h
24; *
25; *************************************************************************
26
27 public viosetcurpos
28 .sall
29 .xlist
30 include macros.inc
31 .list
32
33error_bvs_parameter equ 0002h
34
35str struc
36old_bp dw ?
37return dd ?
38handle dw ? ; vio handle
39column dw ? ; column value
40row dw ? ; row value
41str ends
42
43viosetcurpos proc far
44 Enter viosetcurpos ; push registers
45
46 mov bh,0
47 mov ax,[bp].row ; get column number
48 cmp al,25 ; compare with maximum size allowed
49 jg error ; branch if illegal size
50 mov dh,al ; load row in dh
51
52 mov ax,[bp].column ; get column number
53 cmp al,80 ; check for upper boundry
54 jg error ; branch if illegal size
55 mov dl,al ; load column in dl
56
57 mov ah,02 ; set BIOS function code
58 pushal ; Save registers in case int 10h
59 ; messes them up
60 int 10h ; set cursor position
61 popal
62
63 sub ax,ax ; set good return code
64 jmp exit ; return
65
66error: mov ax,error_bvs_parameter ; set error return code
67exit: Mexit ; pop registers
68 ret size str - 6 ; return
69
70viosetcurpos endp
71vioxxx ends
72 end
diff --git a/v4.0/src/MAPPER/SEL_DISK.ASM b/v4.0/src/MAPPER/SEL_DISK.ASM
new file mode 100644
index 0000000..ab3bbc9
--- /dev/null
+++ b/v4.0/src/MAPPER/SEL_DISK.ASM
@@ -0,0 +1,54 @@
1;
2page 80,132
3;
4title CP/DOS DosSelectDisk mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dosselectdisk
12;*
13;* FILE NAME: dos048.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push word drive drive number
18;* call dosselectdisk
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=0eh, select disk
21;*
22;*********************************************************************
23
24 public dosselectdisk
25 .sall
26 .xlist
27 include macros.inc
28 .list
29
30str struc
31old_bp dw ?
32Return dd ?
33Drive dw ? ; drive number
34str ends
35
36dosselectdisk proc far
37 Enter Dosselectdisk ; push registers
38
39 mov dx,[bp].drive ; load drive number
40 dec dx ; adjust for cp/dos incompatibility
41
42 mov ah,0eh
43 int 21h ; select the drive
44
45 sub ax,ax ; set good return code
46
47 mexit ; pop registers
48 ret size str - 6 ; return
49
50dosselectdisk endp
51
52dosxxx ends
53
54 end
diff --git a/v4.0/src/MAPPER/SETFSINF.ASM b/v4.0/src/MAPPER/SETFSINF.ASM
new file mode 100644
index 0000000..fb45a26
--- /dev/null
+++ b/v4.0/src/MAPPER/SETFSINF.ASM
@@ -0,0 +1,105 @@
1
2page 80,132
3;0
4title CP/DOS DosSetFsInfo mapper
5
6
7dosxxx segment byte public 'dos'
8 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
9;
10; ************************************************************************* *
11; *
12; * MODULE: DosSetFsInfo
13; *
14; * FUNCTION: This module will delete the volume label on a specified
15; * drive.
16; *
17; * CALLING SEQUENCE:
18; *
19; * PUSH WORD DriveNumber ; Drive Number
20; * PUSH OTHER FSInfoLevel ; File system info required
21; * PUSH@ OTHER FSInfoBuf ; File system info buffer
22; * PUSH WORD FSInfoBufSize ; file system info buffer size
23; * Call DosSetFsInfo
24; *
25; *
26; * MODULES CALLED: DOS int 21H function 13H
27; *
28; *************************************************************************
29
30 public DosSetFsInfo
31 .sall
32 .xlist
33 include macros.inc
34 include error.inc
35 .list
36
37str struc
38old_bp dw ?
39return dd ?
40sbufsize dw ? ; info buffer size
41sbuffoff dw ? ; info buffer offset
42sbuffseg dw ? ; info buffer segment
43slevel dw ? ; info level
44sdrive dw ? ; drive number
45str ends
46
47
48;-----------------------------------------------
49;--- Extended FCB, used to delete Volume Labels.
50;-----------------------------------------------
51Ext_FCB db 0FFh ;Indicates extended FCB
52 db 0,0,0,0,0 ;Reserved
53FCB_Attr db 08 ;Attribute for vol label
54FCBDrive db 0 ;Drive number
55VLabel db "???????????" ;Match any vol name found
56 db 25 dup (0) ;Rest of the opened FCB
57
58
59
60
61
62
63
64
65DosSetFsInfo proc far
66 Enter DosSetfsinfo ; push registers
67 mov ax,[bp].sdrive ; Get drive number
68 mov FCBDrive,al ; Place it in the extended FCB
69;--------------------------
70;-- FCB Delete old volume label
71;--------------------------
72 mov ah,013h ; FCB Delete
73 push cs
74 pop ds
75 mov dx,offset Ext_FCB
76 int 021h ; Call DOS to delete volume label
77;---------------------------------
78;-- Handle_Create new Volume label
79;---------------------------------
80 mov cx,08h ; Volume label attribute
81 mov ah,03ch ; Handle create new volume label
82 mov dx,[bp].sbuffoff
83 push [bp].sbuffseg
84 pop ds
85 int 021h ; Do it
86 jc retrn ; Oops, there was an error. Not surprised...
87;--------------------------
88;-- Close the Volume Label
89;--------------------------
90 mov bx,ax ; Place handle in BX
91 mov ah,03eh ; Close the volume label
92 int 021h ; Do IT!
93
94
95deleted:
96 sub ax,ax ; set good return code
97retrn:
98 mexit ; pop registers
99 ret size str - 6 ; return
100
101DosSetFsInfo endp
102
103dosxxx ends
104
105 end
diff --git a/v4.0/src/MAPPER/SETINT24.ASM b/v4.0/src/MAPPER/SETINT24.ASM
new file mode 100644
index 0000000..9e3e8d8
--- /dev/null
+++ b/v4.0/src/MAPPER/SETINT24.ASM
@@ -0,0 +1,94 @@
1;0
2page 80,132
3
4;**********************************************************************
5;*
6;* MODULE: set_int24_vector
7;*
8;* Critical error handler for C programs BACKUP and RESTORE
9;*
10;*********************************************************************
11;------------------------------------------------------------;;;;AN000;
12databuff segment public 'databuff' ;;;;AN000;
13databuff ends ;;;;AN000;
14;------------------------------------------------------------;;;;AN000;
15
16
17dosxxx segment byte public 'dos' ;AN000;
18 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing ;AN000;
19
20
21 public set_int24_vector ;AN000;
22 .sall ;AN000;
23 .xlist ;AN000;
24 include macros.inc ;AN000;
25 .list ;AN000;
26
27str struc ;AN000;
28old_bp dw ? ;AN000;
29Return dd ? ;AN000;
30Flag dw ? ;AN000;
31str ends ;AN000;
32
33
34set_int24_vector proc far ;AN000;
35 Enter set_int24_vector ;AN000;
36
37 mov ax,seg databuff ;AN000;
38 mov ds,ax ;AN000;
39 assume ds:databuff ;AN000;
40
41 mov ax,03524h ;Get Int24 Vector ;AN000;
42 int 21h ;AN000;
43 ;Save it
44 mov word ptr cs:OldInt24,bx ;AN000;
45 mov word ptr cs:OldInt24+2,es ;AN000;
46
47 ;Get address of my Int24 Handler
48 mov dx,cs ;AN000;
49 mov ds,dx ;AN000;
50 mov dx,offset AppErrorHandler ;AN000;
51
52 mov ax,02524H ;Set new INT24 vector ;AN000;
53 int 21h ;AN000;
54
55 xor ax,ax ;Set good error return ;AN000;
56
57exit: mexit ; pop all registers ;AN000;
58 ret size str - 6 ; return ;AN000;
59
60set_int24_vector endp ;AN000;
61
62
63
64
65
66;-------------------------------------------------------
67;
68; **** Error Handler ******
69;
70;-------------------------------------------------------
71Ignore equ 0 ;AN000;
72Retry equ 1 ;AN000;
73Abort equ 2 ;AN000;
74Fail equ 3 ;AN000;
75
76OldInt24 dd ? ;AN000; ;save old interrupt handler address ;;;
77
78AppErrorHandler proc near ;AN000;
79 pushf ;AN000;
80 call dword ptr cs:OldInt24 ;AN000; Get user to respond
81 cmp al,Abort ;AN000; For any resonse other than Abort
82 jne rett ;AN000; retry the operation
83
84 int 023h ;AN000;
85
86rett: ;AN000;
87 iret ;AN000; return to caller
88AppErrorHandler endp ;AN000;
89;-------------------------------------------------------
90;-------------------------------------------------------
91
92dosxxx ends ;AN000;
93 end ;AN000;
94 \ No newline at end of file
diff --git a/v4.0/src/MAPPER/SET_TOD.ASM b/v4.0/src/MAPPER/SET_TOD.ASM
new file mode 100644
index 0000000..2cc058b
--- /dev/null
+++ b/v4.0/src/MAPPER/SET_TOD.ASM
@@ -0,0 +1,76 @@
1;
2page 80,132
3;
4title CP/DOS DosSetDateTime mapper
5;
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8;
9;**********************************************************************
10;*
11;* MODULE: dossetdatetime
12;*
13;* FILE NAME: dos050.asm
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ struc date/time
18;* call dossetdatetime
19;*
20;* MODULES CALLED: PC-DOS Int 21h, ah=2bh, set date
21;* ah=2dh, set time
22;*
23;*********************************************************************
24
25 public dossetdatetime
26 .sall
27 include macros.inc
28
29error_ts_datetime equ 0002h
30
31str struc
32old_bp dw ?
33return dd ?
34Data dd ? ; TOD data pointer
35str ends
36
37dossetdatetime proc far
38 Enter dossetdatetime ; push registers
39
40 lds si,[bp].data ; set TOD data pointer and load
41 ; info into registers
42 mov ch,byte ptr [si] ; load hour
43 mov cl,byte ptr [si]+1 ; minutes
44 mov dh,byte ptr [si]+2 ; seconds
45 mov dl,byte ptr [si]+3 ; hundredths
46
47 mov ah,2dh ; set time opcode
48 int 21h ; set new time
49 push ax ; check for error later
50
51 mov dl,byte ptr [si]+4 ; load day
52 mov dh,byte ptr [si]+5 ; month
53 mov cx,word ptr [si]+6 ; year
54
55 mov ah,2bh ; new date opcode
56 int 21h ; set new date
57
58 pop bx
59 mov cl,0
60 cmp bl,cl ; return code from time set
61 jnz error
62 cmp al,0 ; return code from date set
63 jz exit
64
65error: mov ax,error_ts_datetime ; set error code
66 jmp short exit1
67
68exit: sub ax,ax ; set good return code
69exit1: Mexit ; pop registers
70 ret size str - 6 ; return
71
72dossetdatetime endp
73
74dosxxx ends
75
76 end
diff --git a/v4.0/src/MAPPER/SFILEINF.ASM b/v4.0/src/MAPPER/SFILEINF.ASM
new file mode 100644
index 0000000..e057da3
--- /dev/null
+++ b/v4.0/src/MAPPER/SFILEINF.ASM
@@ -0,0 +1,89 @@
1; 0
2page 80,132
3
4title CP/DOS DosSetFileInfo mapper
5
6
7FileAttributeSegment segment word public 'fat'
8
9 extrn FileAttributeTable:word
10
11FileAttributeSegment ends
12
13
14dosxxx segment byte public 'dos'
15 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
16;
17;**********************************************************************
18;*
19;* MODULE: dossetfileinfo
20;*
21;* FUNCTION: set file information
22;*
23;* CALLING SEQUENCE:
24;*
25;* push word file handle
26;* push word info level
27;* push@ other file info buffer
28;* push word file buffer size
29;* call dossetfileinfo
30;*
31;* MODULES CALLED: PC-DOS Int 21h, ah=57h, set file's date/time
32;*
33;*********************************************************************
34
35 public dossetfileinfo
36 .sall
37 .xlist
38 include macros.inc
39 .list
40
41
42
43str struc
44old_bp dw ?
45return dd ?
46BufferSize dw ? ; file info buufer size
47BufferPtr dd ? ; file info buffer
48Level dw ? ; file info level
49Handle dw ? ; file handle
50str ends
51
52dossetfileinfo proc far
53 Enter dossetfileinfo ; push registers
54
55 mov bx,[bp].Handle ; fill registers for function call
56 lds si,[bp].BufferPtr ; date/time pointer
57 mov dx,word ptr [si]+8 ; date to be set
58 mov cx,word ptr [si]+10 ; time to be set
59
60 mov ax,5701h
61 int 21h
62 jc ErrorExit ; check for error
63
64; This code should be un-commented when the attribute can be set from
65; the setfileinfo call
66
67; lds si,[bp].BufferPtr
68; mov ax,ds:[si].the offset to the attribute word
69
70; mov bx,seg FileAttributeSegment
71; mov ds,bx
72; assume ds:FileAttributeSegment
73
74; mov bx,[bp].Handle
75; add bx,bx
76
77; mov FileAttributeTable[bx],ax
78
79 sub ax,ax ; set good return code
80
81ErrorExit:
82 mexit ; pop registers
83 ret size str - 6 ; return
84
85dossetfileinfo endp
86
87dosxxx ends
88
89 end
diff --git a/v4.0/src/MAPPER/SFILEMOD.ASM b/v4.0/src/MAPPER/SFILEMOD.ASM
new file mode 100644
index 0000000..ecc3009
--- /dev/null
+++ b/v4.0/src/MAPPER/SFILEMOD.ASM
@@ -0,0 +1,61 @@
1;0
2page 80,132
3
4title CP/DOS DosSetFileMode mapper
5
6dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8
9;**********************************************************************
10;*
11;* MODULE: dossetfilemode
12;*
13;* FUNCTION: Set file mode
14;*
15;* CALLING SEQUENCE:
16;*
17;* push@ asciiz file path name
18;* push word new attribute
19;* push dword reserved
20;* call dossetfilemode
21;*
22;* MODULES CALLED: PC-DOS Int 21h, ah=43h, change file mode
23;*
24;*********************************************************************
25
26 public dossetfilemode
27 .sall
28 .xlist
29 include macros.inc
30 .list
31
32
33str struc
34old_bp dw ?
35return dd ?
36Rsrvd dd ? ; reserved
37Attrib dw ? ; file attribute
38Path dd ? ; path name pointer pointer
39str ends
40
41dossetfilemode proc far
42 Enter dossetfilemode ; push registers
43
44 lds dx,[bp].path ; set pointer to path
45 mov cx,[bp].attrib
46
47 mov ax,4301h
48 int 21h ; change file mode
49 jc exit ; jump if error, return DOS error in ax
50
51 xor ax,ax ; set good return code
52 jmp short exit ; return
53
54exit: mexit ; pop registers
55 ret size str - 6 ; return
56
57dossetfilemode endp
58
59dosxxx ends
60
61 end
diff --git a/v4.0/src/MAPPER/SIGHAND.ASM b/v4.0/src/MAPPER/SIGHAND.ASM
new file mode 100644
index 0000000..2258d1c
--- /dev/null
+++ b/v4.0/src/MAPPER/SIGHAND.ASM
@@ -0,0 +1,204 @@
1page 80,132
2
3title CP/DOS DosSetSigHandler mapper
4
5 include msc.inc
6
7dosxxx segment byte public 'dos'
8 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
9
10;**********************************************************************
11;*
12;* MODULE: dossetsighandler
13;*
14;* FILE NAME: dos007.asm
15;*
16;* CALLING SEQUENCE:
17;*
18;* push word file handle
19;* push dword distance
20;* push word move type
21;* push@ dword new pointer
22;* call doschgfileptr
23;*
24;* MODULES CALLED: PC-DOS Int 21h, ah=42h
25;*
26;*********************************************************************
27
28 public dossetsighandler
29 .sall
30 .xlist
31 include macros.inc
32 .list
33
34str struc
35old_bp dw ?
36return dd ?
37Signumber dw ? ; signal number
38Action dw ? ; action code
39Prevaction dd ? ; previous action code
40Prevadrs dd ? ; previous vector address
41Routineadrs dd ? ; interrupt handler address
42str ends
43
44; While we hate to do this, we have to. The following data areas are
45; expected to be in the CODE segment.
46
47NextControlBreakHandler label dword
48NextControlBreakHandlerOffset dw DummyControlBreakHandler
49NextControlBreakHandlerSegment dw dosxxx
50
51NextCriticalErrorHandler label dword
52NextCriticalErrorHandlerOffset dw DummyCriticalErrorHandler
53NextCriticalErrorHandlerSegment dw dosxxx
54
55dossetsighandler proc far
56
57 Enter dossetsighandler ; push registers
58
59 mov ax,[bp].action ; get action code
60 cmp ax,2 ; action code 2 ??
61 je continue1 ; branch if true
62 mov ax,1 ; else, set error code
63 jmp exit ; return
64
65continue1:
66 mov ax,[bp].signumber ; get signel number
67 cmp ax,1 ; signal 1 (cntrl chara) ??
68 je cntrlc ; jump if true
69 cmp ax,4 ; signal 4 (cntrl chara) ??
70 je cntrlc ; jump if true
71 mov ax,2 ; else, set error code
72 jmp exit ; return
73
74cntrlc: mov ax,03523h
75 int 21h ; get old vector address
76
77 lds si,[bp].prevadrs ; previous handler pointer
78 mov word ptr [si],bx ; save it in prevsdrs
79 mov word ptr [si]+2,es
80
81 lds dx,[bp].routineadrs ; get address of signal handler
82
83 mov NextControlBreakHandlerOffset,dx ; save it
84 mov NextControlBreakHandlerSegment,ds
85
86 mov dx,cs
87 mov ds,dx
88 mov dx,offset RealControlBreakHandler
89
90 mov ax,02523H
91 int 21h ; set signal handler addrs in vector
92
93 sub ax,ax ; set good return code
94
95exit: mexit ; pop registers
96 ret size str - 6 ; return
97
98dossetsighandler endp
99
100 page
101
102;------------------------------------------------------------------------------
103
104; This routine will get control on control break, and it will make
105; sure that the environment is acceptable prior to calling the new
106; handler. NOTE: we expect the new handler to be written in MicroSoft 'C'
107
108RealControlBreakHandler proc far
109
110 push ds
111 push es
112 push di
113 push si
114 push bp
115 push dx
116 push cx
117 push bx
118 push ax
119
120; reestablish the es and ds segment registers before going to 'C'
121
122 mov ax,seg DGroup
123 mov ds,ax
124 mov es,ax
125
126 call NextControlBreakHandler
127
128 pop ax
129 pop bx
130 pop cx
131 pop dx
132 pop bp
133 pop si
134 pop di
135 pop es
136 pop ds
137
138 iret
139
140RealControlBreakHandler endp
141
142 page
143
144;------------------------------------------------------------------------------
145
146; This routine will get control on the control break, and it will make
147; sure that the environment is acceptable prior to calling the new
148; handler. NOTE: we expect the new handler to be written in MicroSoft 'C'
149
150RealCriticalErrorHandler proc far
151
152 push ds
153 push es
154 push di
155 push si
156 push bp
157 push dx
158 push cx
159 push bx
160 push ax
161
162; reestablish the es and ds segment registers before going to 'C'
163
164 mov ax,seg DGroup
165 mov ds,ax
166 mov es,ax
167
168 call NextControlBreakHandler
169
170 pop ax
171 pop bx
172 pop cx
173 pop dx
174 pop bp
175 pop si
176 pop di
177 pop es
178 pop ds
179
180 iret
181
182RealCriticalErrorHandler endp
183
184 page
185
186;------------------------------------------------------------------------------
187
188DummyControlBreakHandler proc far
189
190 iret
191
192DummyControlBreakHandler endp
193
194DummyCriticalErrorHandler proc far
195
196 iret
197
198DummyCriticalErrorHandler endp
199
200
201
202dosxxx ends
203
204 end
diff --git a/v4.0/src/MAPPER/SVERIFY.ASM b/v4.0/src/MAPPER/SVERIFY.ASM
new file mode 100644
index 0000000..97495ed
--- /dev/null
+++ b/v4.0/src/MAPPER/SVERIFY.ASM
@@ -0,0 +1,59 @@
1page 80,132
2
3title CP/DOS DosSetVerify mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7
8;**********************************************************************
9;*
10;* MODULE: dossetverify Set new verify switch value
11;*
12;* FILE NAME: dos054.asm
13;*
14;* CALLING SEQUENCE:
15;*
16;* push word verify setting
17;* call dossetverify
18;*
19;* MODULES CALLED: PC-DOS Int 21h, ah=2eh, get verify setting
20;*
21;*********************************************************************
22
23 public dossetverify
24 .sall
25 .xlist
26 include macros.inc
27 .list
28
29error_code equ 0002h
30
31str struc
32old_bp dw ?
33return dd ?
34verify dw ? ; new verify settings value
35str ends
36
37dossetverify proc far
38 Enter dossetverify ; push registers
39
40 mov ax,[bp].verify ; check request
41 cmp al,1 ; for validity
42 jg error
43
44 mov ah,2eh ; setup new verify value
45 int 21h
46
47 sub ax,ax ; set good return code
48 jmp short exit ; return
49
50error: mov ax,error_code ; set error return code
51
52exit: Mexit ; pop registers
53 ret size str - 6 ; return
54
55dossetverify endp
56
57dosxxx ends
58
59 end
diff --git a/v4.0/src/MAPPER/WCHSTRA.ASM b/v4.0/src/MAPPER/WCHSTRA.ASM
new file mode 100644
index 0000000..2f42822
--- /dev/null
+++ b/v4.0/src/MAPPER/WCHSTRA.ASM
@@ -0,0 +1,115 @@
1;
2page 60,132
3;
4title CP/DOS VioWrtCharStrAtt mapper
5;
6vioxxx segment byte public 'vio'
7 assume cs:vioxxx,ds:nothing,es:nothing,ss:nothing
8;
9; ************************************************************************* *
10; *
11; * MODULE: viowrtcharstratt Write character string with attribute
12; *
13; * FILE NAME: wchstra.asm
14; *
15; * CALLING SEQUENCE:
16; *
17; * push@ dword char_str
18; * push word length
19; * push word row
20; * push word column
21; * push@ dword attribute
22; * push word vio handle
23; * call viowrtcharstr
24; *
25; *
26; * MODULES CALLED: BIOS int 10h
27; *
28; *************************************************************************
29
30 public viowrtcharstratt
31 .sall
32 .xlist
33 include macros.inc
34 .list
35
36full_scr_err equ 0001h
37error_bvs_parameter equ 0002h
38
39str struc
40old_bp dw ?
41return dd ?
42handle dw ? ; vio handle
43attr dd ? ; attribute pointer
44column dw ? ; column number
45row dw ? ; starting position for output
46lngth dw ? ; length of the string
47addr dd ? ; string to be written (pointer)
48str ends
49
50viowrtcharstratt proc far
51 Enter viowrtcharstratt ; push registers
52
53 sub bh,bh
54 sub ax,ax ; Start with clean error condition
55 mov dx,[bp].column ; get column number
56 cmp dl,80 ; check for upper boundry
57 jg error ; branch if illegal number
58
59 mov ax,[bp].row ; get row number
60 cmp al,25 ; check for upper boundry
61 jg error ; branch if illegal number
62 mov dh,al
63 mov ah,02h
64 pushal ; Save registers in case int 10h
65 ; messes them up
66 int 10h ; Set start cursor position
67
68 popal
69 lds si,[bp].attr ; Set up attribute in BL
70 mov bl,byte ptr ds:[si]
71 lds si,[bp].addr ; DS:SI is pointer to string
72 mov di,[bp].lngth
73 ; ****************************
74; cmp bl,15 ; ** assume good attribute! **
75; jg error ; ****************************
76
77top: mov al,byte ptr [si]
78 mov ah,09h ; set write char/attrib function code
79 mov cx,1 ; write only one character
80 pushal ; Save registers in case int 10h
81 ; messes them up
82 int 10h ; Output one character
83
84 popal ; restore registers
85 inc si
86 dec di
87 inc dl
88 cmp dl,80 ; Handle end of line condition
89 jne around ; |
90 inc dh ; |
91 mov dl,00 ; V
92 cmp dh,25 ; Handle end of screen condition
93 jne around ; |
94 mov ax,full_scr_err ; Error in AX
95 jmp exit
96
97around: mov ah,02h
98 pushal ; Save registers in case int 10h
99 ; messes them up
100 int 10h ; Increment cursor position
101
102 popal
103 cmp di,0 ; check if complete string is written
104 jne top ; else, go and write next character
105
106 sub ax,ax ; set no error code
107
108error: mov ax,error_bvs_parameter
109
110exit: Mexit ; return
111 ret size str - 6
112;
113viowrtcharstratt endp
114vioxxx ends
115 end
diff --git a/v4.0/src/MAPPER/WRITE.ASM b/v4.0/src/MAPPER/WRITE.ASM
new file mode 100644
index 0000000..24ebcde
--- /dev/null
+++ b/v4.0/src/MAPPER/WRITE.ASM
@@ -0,0 +1,64 @@
1page 80,132
2
3title CP/DOS DosWrite mapper
4
5dosxxx segment byte public 'dos'
6 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
7
8;**********************************************************************
9;*
10;* MODULE: doswrite
11;*
12;* FUNCTION: Write a specified number of bytes to a file
13;*
14;* CALLING SEQUENCE:
15;*
16;* push word file handle
17;* push@ other buffer area
18;* push word buffer length
19;* push@ word bytes written
20;* call doswrite
21;*
22;* MODULES CALLED: PC-DOS Int 21h, ah=40h, write
23;*
24;*********************************************************************
25
26 public doswrite
27 .sall
28 .xlist
29 include macros.inc
30 .list
31
32str struc
33old_bp dw ?
34return dd ?
35Written dd ? ; number of bytes actually written
36Bufflng dw ? ; number of bytes to be written
37Buffer dd ? ; write buffer address
38Handle dw ? ; file handle
39str ends
40
41doswrite proc far
42
43 Enter doswrite ; push registers
44
45 mov bx,[bp].handle ; get handle
46 lds dx,[bp].buffer ; set write buffer
47 mov cx,[bp].bufflng ; number of bytes to be written
48
49 mov ah,40h ; load opcode
50 int 21h ; write bytes to the file
51 jc exit ; jump if error
52
53 lds si,[bp].written ; pointer to return data
54 mov word ptr [si],ax ; save actual number of bytes written
55 sub ax,ax ; set good return code
56
57exit: mexit ; pop registers
58 ret size str - 6 ; return
59
60doswrite endp
61
62dosxxx ends
63
64 end