summaryrefslogtreecommitdiff
path: root/v4.0/src/CMD/KEYB/KEYBCPSD.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/CMD/KEYB/KEYBCPSD.ASM')
-rw-r--r--v4.0/src/CMD/KEYB/KEYBCPSD.ASM128
1 files changed, 128 insertions, 0 deletions
diff --git a/v4.0/src/CMD/KEYB/KEYBCPSD.ASM b/v4.0/src/CMD/KEYB/KEYBCPSD.ASM
new file mode 100644
index 0000000..2cae9fe
--- /dev/null
+++ b/v4.0/src/CMD/KEYB/KEYBCPSD.ASM
@@ -0,0 +1,128 @@
1 PAGE ,132
2 TITLE DOS - KEYB Command - Copy Shared_Data_Area
3
4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5;; DOS - NLS Support - KEYB Command
6;; (C) Copyright 1988 Microsoft
7;;
8;; File Name: KEYBCPSD.ASM
9;; ----------
10;;
11;; Description:
12;; ------------
13;; Copies the SHARED_DATA_AREA into a part of memory that
14;; can be left resident. All relative pointers must already
15;; be recalculated to this new position.
16;; THIS FILE MUST BE THE LAST OF THE RESIDENT FILES WHEN KEYB IS LINKED.
17;;
18;; Documentation Reference:
19;; ------------------------
20;; PC DOS 3.3 Detailed Design Document - May ?? 1986
21;;
22;; Procedures Contained in This File:
23;; ----------------------------------
24;;
25;; Include Files Required:
26;; -----------------------
27;; INCLUDE KEYBSHAR.INC
28;; INCLUDE KEYBCMD.INC
29;; INCLUDE KEYBTBBL.INC
30;;
31;; External Procedure References:
32;; ------------------------------
33;; FROM FILE ????????.ASM:
34;; procedure - description????????????????????????????????
35;;
36;; Linkage Information: Refer to file KEYB.ASM
37;; --------------------
38;;
39;; Change History:
40;; ---------------
41;; PTMP3955 ;AN004;KEYB component to free environment and close handles 0 - 4
42;; 3/24/88
43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44 ;;
45 PUBLIC SD_DEST_PTR ;;
46 PUBLIC COPY_SD_AREA ;;
47 PUBLIC SHARED_DATA ;;
48 ;;
49 INCLUDE STRUC.INC
50 INCLUDE KEYBSHAR.INC ;;
51 INCLUDE KEYBCMD.INC ;;
52 INCLUDE KEYBTBBL.INC ;;
53 ;;
54CODE SEGMENT PUBLIC 'CODE' ;;
55 ;;
56 ASSUME CS:CODE,DS:CODE ;;
57 ;;
58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59;;
60;; Module: COPY_SD_AREA
61;;
62;; Description:
63;;
64;; Input Registers:
65;;
66;; Output Registers:
67;; N/A
68;;
69;; Logic:
70;;
71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
72 ;;
73SD EQU SHARED_DATA ;;
74TSD EQU TEMP_SHARED_DATA ;;
75 ;;
76;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77;;
78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79 ;;
80COPY_SD_AREA PROC NEAR ;;
81 ;;
82 REP MOVS ES:BYTE PTR [DI],DS:[SI] ;; Copy SHARED_DATA_AREA to
83
84 push ax ;AN004;save existing values
85 push es ;AN004;;
86 xor ax,ax ;AN004;clear out ax
87 mov ax,cs:[2ch] ;AN004;check offset for address containin environ.
88 cmp ax,0 ;AN004;
89 je NO_FREEDOM ;AN004;
90 mov es,ax ;AN004;
91 mov ax,4900H ;AN004;make the free allocate mem func
92 int 21h ;AN004;;
93
94
95NO_FREEDOM:
96 pop es ;AN004;restore existing values
97 pop ax ;AN004;;
98
99 push ax ;AN004;
100 push bx ;AN004;
101
102 ;AN004; ;Terminate and stay resident
103 mov bx,4 ;AN004; ;1st close file handles
104 .REPEAT ;AN004; ;STDIN,STDOUT,STDERR
105 mov ah,3eh ;AN004; ;
106 int 21h ;AN004; ;
107 dec bx ;AN004; ;
108 .UNTIL <BX eq 0> ;AN004; ;
109
110 pop bx ;AN004;
111 pop ax ;AN004;
112 ;AN004; new part of memory
113 MOV BYTE PTR ES:SD.TABLE_OK,1 ;; Activate processing flag
114 INT 21H ;; Exit
115 ;;
116 ;;
117COPY_SD_AREA ENDP ;;
118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
119;;
120;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
121 ;;
122 db 'SHARED DATA' ;;
123SD_DEST_PTR LABEL BYTE ;;
124 ;;
125SHARED_DATA SHARED_DATA_STR <> ;;
126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
127CODE ENDS
128 END