Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Page     1-1


					PAGE	,132
					TITLE	DOS - KEYB Command  -  Copy Shared_Data_Area
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;; DOS - NLS Support - KEYB Command
				;; (C) Copyright 1988 Microsoft
				;;
				;; File Name:  KEYBCPSD.ASM
				;; ----------
				;;
				;; Description:
				;; ------------
				;;	 Copies the SHARED_DATA_AREA into a part of memory that
				;;	 can be left resident. All relative pointers must already
				;;	 be recalculated to this new position.
				;;	 THIS FILE MUST BE THE LAST OF THE RESIDENT FILES WHEN KEYB IS LINKED.
				;;
				;; Documentation Reference:
				;; ------------------------
				;;	 PC DOS 3.3 Detailed Design Document - May ?? 1986
				;;
				;; Procedures Contained in This File:
				;; ----------------------------------
				;;
				;; Include Files Required:
				;; -----------------------
				;;	INCLUDE KEYBSHAR.INC
				;;	INCLUDE KEYBCMD.INC
				;;	INCLUDE KEYBTBBL.INC
				;;
				;; External Procedure References:
				;; ------------------------------
				;;	 FROM FILE  ????????.ASM:
				;;	      procedure - description????????????????????????????????
				;;
				;; Linkage Information:  Refer to file KEYB.ASM
				;; --------------------
				;;
				;; Change History:
				;; ---------------
				;; PTMP3955 ;AN004;KEYB component to free environment and close handles 0 - 4
				;; 3/24/88
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
								       ;;
					PUBLIC	SD_DEST_PTR	       ;;
					PUBLIC	COPY_SD_AREA	       ;;
					PUBLIC	SHARED_DATA	       ;;
								       ;;
					INCLUDE STRUC.INC
			     C	;;STRUC--Stucture Macro Library
			     C	;;Optimizing Version 2.30  03/31/87
			     C	
			     C	else	       ;else for if1
			     C	$Pop	$Temp
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Page     1-2


			     C	;;if	   $Temp ne $NoType
			     C	.xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist
			     C	.xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType
			     C	.xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz
			     C	.xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType
			     C	.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
			     C	.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump
			     C	.xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test
			     C	.xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand
			     C	.xcref jnnonzero,jnonzero,jnzero,jzero
			     C	.xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist
			     C	.xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz
			     C	endif
			     C	
			     C	
 = 0000                      C	$st	= 0
 = 0000                      C	$sn	= 0
 = 0000                      C	$OrFound = 0
 = 0000                      C	$LoopEnd = 0
 = 0000                      C	$LeaveFound = 0
 =-0001                      C	$LastLabel = -1
 = 0000                      C	$LastLabelOrg = $
 = 0003                      C	$DefDist= $Short
			     C	$Push	%$NoType
					INCLUDE KEYBSHAR.INC	       ;;
			     C	.LIST
					INCLUDE KEYBCMD.INC	       ;;
			     C	.LIST
			     C	
			     C	
					INCLUDE KEYBTBBL.INC	       ;;
			     C	
			     C	.LIST
								       ;;
 0000				CODE	SEGMENT PUBLIC 'CODE'          ;;
								       ;;
					ASSUME	CS:CODE,DS:CODE        ;;
								       ;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;;
				;; Module: COPY_SD_AREA
				;;
				;; Description:
				;;
				;; Input Registers:
				;;
				;; Output Registers:
				;;     N/A
				;;
				;; Logic:
				;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
								       ;;
 =				SD		EQU   SHARED_DATA      ;;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Page     1-3


 =				TSD		EQU  TEMP_SHARED_DATA  ;;
								       ;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
									       ;;
 0000				COPY_SD_AREA	PROC   NEAR		       ;;
									       ;;
 0000  F3/ A4				REP	MOVS ES:BYTE PTR [DI],DS:[SI]  ;; Copy SHARED_DATA_AREA to
				
 0002  50					  push	  ax			  ;AN004;save existing values
 0003  06					  push	  es			  ;AN004;;
 0004  33 C0					  xor	  ax,ax 		  ;AN004;clear out ax
 0006  2E: A1 002C				  mov	  ax,cs:[2ch]		  ;AN004;check offset for address containin environ.
 000A  3D 0000					  cmp	  ax,0			  ;AN004;
 000D  74 07					  je	  NO_FREEDOM		  ;AN004;
 000F  8E C0					  mov	  es,ax 		  ;AN004;
 0011  B8 4900					  mov	  ax,4900H		  ;AN004;make the free allocate mem func
 0014  CD 21					  int	  21h			  ;AN004;;
				
				
 0016				NO_FREEDOM:
 0016  07					  pop	  es			  ;AN004;restore existing values
 0017  58					  pop	  ax			  ;AN004;;
				
 0018  50					  push	  ax			  ;AN004;
 0019  53					  push	  bx			  ;AN004;
				
										  ;AN004;     ;Terminate and stay resident
 001A  BB 0004				     mov     bx,4			  ;AN004;     ;1st close file handles
					 .REPEAT				  ;AN004;     ;STDIN,STDOUT,STDERR
 001D                        2	$l1: 
 001D  B4 3E				     mov  ah,3eh			  ;AN004;     ;
 001F  CD 21				     int  21h				  ;AN004;     ;
 0021  4B				     dec  bx				  ;AN004;     ;
					.UNTIL <BX eq 0>			  ;AN004;     ;
 0022  83 FB 00              3						cmp BX,0 
 0025  75 F6                 6						jne $l1 
				
 0027  5B					 pop	 bx			  ;AN004;
 0028  58					 pop	 ax			  ;AN004;
										  ;AN004;	 new part of memory
 0029  26: C6 06 004C R 01		MOV	BYTE PTR ES:SD.TABLE_OK,1	  ;; Activate processing flag
 002F  CD 21				INT	21H				  ;; Exit
									       ;;
									       ;;
 0031				COPY_SD_AREA	ENDP			       ;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
				;;
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
								       ;;
 0031  53 48 41 52 45 44	 db 'SHARED DATA'                      ;;
       20 44 41 54 41		
 003C				SD_DEST_PTR	LABEL	BYTE	       ;;
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Page     1-4


								       ;;
 003C  00000000			SHARED_DATA   SHARED_DATA_STR <>       ;;
 0040  00000000			
 0044  00000000			
 0048  0000			
 004A  0000			
 004C  00			
 004D  00			
 004E  0100			
 0050  0002[			
	   00			
			 ]	
 0052  5553			
 0054  B501			
 0056  0000			
 0058  FFFF			
 005A  FFFF			
 005C  FFFF			
 005E  FFFF			
 0060  FFFF			
 0062  0000			
 0064  00			
 0065  00			
 0066  00			
 0067  0004[			
	   00			
			 ]	
 006B  00			
				
				;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 006C				CODE   ENDS
				       END

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Symbols-1


Macros:

		N a m e			Lines

.ELSE  . . . . . . . . . . . . .  	  21
.ELSEIF  . . . . . . . . . . . .  	  16
.ENDIF . . . . . . . . . . . . .  	  11
.ENDSELECT . . . . . . . . . . .  	  15
.ENDWHILE  . . . . . . . . . . .  	  10
.FOR . . . . . . . . . . . . . .  	  23
.IF  . . . . . . . . . . . . . .  	  13
.LEAVE . . . . . . . . . . . . .  	   1
.LOOP  . . . . . . . . . . . . .  	  12
.NEXT  . . . . . . . . . . . . .  	  20
.OTHERWISE . . . . . . . . . . .  	  21
.REPEAT  . . . . . . . . . . . .  	   9
.SELECT  . . . . . . . . . . . .  	   4
.THEN  . . . . . . . . . . . . .  	   6
.UNTIL . . . . . . . . . . . . .  	   1
.WHEN  . . . . . . . . . . . . .  	  24
.WHILE . . . . . . . . . . . . .  	  14

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

SET_FLAG_STR . . . . . . . . . .  	0004	0004
  SF_NUM . . . . . . . . . . . .  	0000
  SF_SCAN_CODE . . . . . . . . .  	0001
  SF_FLAG_ID . . . . . . . . . .  	0002
  SF_FLAG_MASK . . . . . . . . .  	0003
SHARED_DATA_STR  . . . . . . . .  	0030	0017
  OLD_INT_9  . . . . . . . . . .  	0000
  OLD_INT_2F . . . . . . . . . .  	0004
  OLD_INT_48 . . . . . . . . . .  	0008
  KEYB_TYPE  . . . . . . . . . .  	000C
  SYSTEM_FLAG  . . . . . . . . .  	000E
  TABLE_OK . . . . . . . . . . .  	0010
  JR_KB_FLAG . . . . . . . . . .  	0011
  TIMING_FACTOR  . . . . . . . .  	0012
  ACTIVE_LANGUAGE  . . . . . . .  	0016
  INVOKED_CP_TABLE . . . . . . .  	0018
  INVOKED_KBD_ID . . . . . . . .  	001A
  ACTIVE_XLAT_PTR  . . . . . . .  	001C
  FIRST_XLAT_PTR . . . . . . . .  	001E
  RESIDENT_END . . . . . . . . .  	0020
  LOGIC_PTR  . . . . . . . . . .  	0022
  COMMON_XLAT_PTR  . . . . . . .  	0024
  SPECIAL_FEATURES . . . . . . .  	0026
  TABLE_OVERFLOW . . . . . . . .  	0028
  HOT_KEY_ON_SCAN  . . . . . . .  	0029
  HOT_KEY_OFF_SCAN . . . . . . .  	002A
  TABLE_AREA . . . . . . . . . .  	002F
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Symbols-2


STATE_LOGIC_STR  . . . . . . . .  	0005	0003
  SL_LOGIC_LEN . . . . . . . . .  	0000
  SL_SPECIAL_FEATURES  . . . . .  	0002
  SL_LOGIC_CMDS  . . . . . . . .  	0004
STATE_STR  . . . . . . . . . . .  	0008	0005
  XS_STATE_LEN . . . . . . . . .  	0000
  XS_STATE_ID  . . . . . . . . .  	0002
  XS_KBD_TYPE  . . . . . . . . .  	0003
  XS_ERROR_CHAR  . . . . . . . .  	0005
  XS_FIRST_TAB . . . . . . . . .  	0007
XLAT_SECT_STR  . . . . . . . . .  	0005	0003
  XS_NEXT_SECT_PTR . . . . . . .  	0000
  XS_CP_ID . . . . . . . . . . .  	0002
  XS_FIRST_STATE . . . . . . . .  	0004
XLAT_STR . . . . . . . . . . . .  	0003	0002
  XLAT_TAB_SIZE  . . . . . . . .  	0000
  XLAT_OPTIONS . . . . . . . . .  	0002
XLAT_TYPE_1_STR  . . . . . . . .  	0006	0004
  XLAT_SCAN_LO . . . . . . . . .  	0003
  XLAT_SCAN_HI . . . . . . . . .  	0004
  XLAT_1_BUF_ENTRY . . . . . . .  	0005
XLAT_TYPE_2_STR  . . . . . . . .  	0006	0004
  XLAT_NUM . . . . . . . . . . .  	0003
  XLAT_SCAN  . . . . . . . . . .  	0004
  XLAT_2_BUF_ENTRY . . . . . . .  	0005

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

CODE . . . . . . . . . . . . . .  	006C	PARA	PUBLIC	'CODE'

Symbols:            

                N a m e         	Type	 Value	 Attr

ANDF_COMMAND . . . . . . . . . .  	NUMBER	0010	
ANY_KB . . . . . . . . . . . . .  	NUMBER	FFFF	
ASCII_ONLY . . . . . . . . . . .  	NUMBER	0080	
ASC_ONLY_TAB_2_ENT_SZ  . . . . .  	NUMBER	0002	
AT_KB  . . . . . . . . . . . . .  	NUMBER	2000	

BEEP_COMMAND . . . . . . . . . .  	NUMBER	00A0	

CHECK_CORE_COMMAND . . . . . . .  	NUMBER	00C0	
COMMAND_BITS . . . . . . . . . .  	NUMBER	00F0	
COMMAND_SHIFT  . . . . . . . . .  	NUMBER	0004	
COPY_SD_AREA . . . . . . . . . .  	N PROC	0000	CODE	Global	Length = 0031
CPN_INVALID  . . . . . . . . . .  	V WORD	0000		External
CP_PTR_SIZE  . . . . . . . . . .  	V WORD	0000		External
CP_TAB_OFFSET  . . . . . . . . .  	V DWORD	0000		External

DEFAULT_TAB_2_ENT_SZ . . . . . .  	NUMBER	0003	
DESIG_CP_BUFFER  . . . . . . . .  	V WORD	0000		External
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Symbols-3


DESIG_CP_OFFSET  . . . . . . . .  	V WORD	0000		External

EITHER_ALT . . . . . . . . . . .  	NUMBER	0020	
EITHER_CTL . . . . . . . . . . .  	NUMBER	0040	
EITHER_SHIFT . . . . . . . . . .  	NUMBER	0080	
ELSEF_COMMAND  . . . . . . . . .  	NUMBER	0020	
ENDIFF_COMMAND . . . . . . . . .  	NUMBER	0030	
EXIT_IF_FOUND  . . . . . . . . .  	NUMBER	0080	
EXIT_INT_9_FLAG  . . . . . . . .  	NUMBER	0001	
EXIT_STATE_LOGIC_FLAG  . . . . .  	NUMBER	0002	
EXT_16 . . . . . . . . . . . . .  	NUMBER	8000	
EXT_KB_FLAG_ID . . . . . . . . .  	NUMBER	0004	

F1_SCAN  . . . . . . . . . . . .  	NUMBER	003B	
F2_SCAN  . . . . . . . . . . . .  	NUMBER	003C	
FILE_BUFFER  . . . . . . . . . .  	V WORD	0000		External
FILE_BUFFER_SIZE . . . . . . . .  	NUMBER	0000		Communal
FIND_CP_TABLE  . . . . . . . . .  	L NEAR	0000		External
FLAG_ID_BITS . . . . . . . . . .  	NUMBER	0007	

GOTO_COMMAND . . . . . . . . . .  	NUMBER	0090	
G_KB . . . . . . . . . . . . . .  	NUMBER	1000	

ID_PTR_SIZE  . . . . . . . . . .  	V WORD	0000		External
IFF_COMMAND  . . . . . . . . . .  	NUMBER	0000	
IFKBD_COMMAND  . . . . . . . . .  	NUMBER	0080	

JR_HOT_KEY_1_2 . . . . . . . . .  	NUMBER	4000	
JR_KB  . . . . . . . . . . . . .  	NUMBER	8000	

KB_FLAG_1_ID . . . . . . . . . .  	NUMBER	0001	
KB_FLAG_2_ID . . . . . . . . . .  	NUMBER	0002	
KB_FLAG_3_ID . . . . . . . . . .  	NUMBER	0003	
KB_FLAG_ID . . . . . . . . . . .  	NUMBER	0000	
KEYBCMD_LANG_ENTRY_PTR . . . . .  	V DWORD	0000		External
KEYBSYS_FILE_HANDLE  . . . . . .  	V WORD	0000		External
KEYB_COMMAND . . . . . . . . . .  	L NEAR	0000		External

LANG_MODE  . . . . . . . . . . .  	NUMBER	00FF	
LANG_PTR_SIZE  . . . . . . . . .  	V WORD	0000		External

NLS_FLAG_1_ID  . . . . . . . . .  	NUMBER	0005	
NLS_FLAG_2_ID  . . . . . . . . .  	NUMBER	0006	
NOT_TEST . . . . . . . . . . . .  	NUMBER	0008	
NO_FREEDOM . . . . . . . . . . .  	L NEAR	0016	CODE
NULL_ASCII_CODE  . . . . . . . .  	NUMBER	-0001	
NUM_BIOS_FLAGS . . . . . . . . .  	NUMBER	0004	
NUM_COMMANDS . . . . . . . . . .  	NUMBER	000C	
NUM_CP . . . . . . . . . . . . .  	V WORD	0000		External
NUM_DESIG_CP . . . . . . . . . .  	V WORD	0000		External
NUM_FLAGS  . . . . . . . . . . .  	NUMBER	0007	
NUM_ID . . . . . . . . . . . . .  	V WORD	0000		External
NUM_LANG . . . . . . . . . . . .  	V WORD	0000		External
NUM_NLS_FLAGS  . . . . . . . . .  	NUMBER	0002	
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42
DOS - KEYB Command  -  Copy Shared_Data_Area                Symbols-4



ONE_SCAN . . . . . . . . . . . .  	NUMBER	0002	
OPTION_COMMAND . . . . . . . . .  	NUMBER	0050	

P12_KB . . . . . . . . . . . . .  	NUMBER	0400	
PC_386 . . . . . . . . . . . . .  	NUMBER	0200	
PC_AT  . . . . . . . . . . . . .  	NUMBER	4000	
PC_JR  . . . . . . . . . . . . .  	NUMBER	0800	
PC_LAP . . . . . . . . . . . . .  	NUMBER	2000	
PC_NET . . . . . . . . . . . . .  	NUMBER	0100	
PC_PAL . . . . . . . . . . . . .  	NUMBER	0400	
PC_XT  . . . . . . . . . . . . .  	NUMBER	1000	
PUT_ERROR_COMMAND  . . . . . . .  	NUMBER	0070	
P_KB . . . . . . . . . . . . . .  	NUMBER	0800	

RESET_NLS_COMMAND  . . . . . . .  	NUMBER	00B0	

SCAN_MATCH . . . . . . . . . . .  	NUMBER	0008	
SD . . . . . . . . . . . . . . .  	ALIAS	 SHARED_DATA		
SD_DEST_PTR  . . . . . . . . . .  	L BYTE	003C	CODE	Global
SD_LENGTH  . . . . . . . . . . .  	V WORD	0000		External
SD_SOURCE_PTR  . . . . . . . . .  	V BYTE	0000		External
SET_FLAG_COMMAND . . . . . . . .  	NUMBER	0060	
SF_ENT_SZ  . . . . . . . . . . .  	NUMBER	0003	
SHARED_AREA_PTR  . . . . . . . .  	V DWORD	0000		External
SHARED_DATA  . . . . . . . . . .  	L 	003C	CODE	Global
STATE_LOGIC_OFFSET . . . . . . .  	V DWORD	0000		External
SUB_CMD_BITS . . . . . . . . . .  	NUMBER	000F	
SYS_CODE_PAGE  . . . . . . . . .  	V WORD	0000		External

TABLE_BUILD  . . . . . . . . . .  	L NEAR	0000		External
TB_RETURN_CODE . . . . . . . . .  	V WORD	0000		External
TEMP_SHARED_DATA . . . . . . . .  	V BYTE	0000		External
TSD  . . . . . . . . . . . . . .  	ALIAS	 TEMP_SHARED_DATA		
TWO_SCAN . . . . . . . . . . . .  	NUMBER	0003	
TYPEWRITER_CAPS_LK . . . . . . .  	NUMBER	8000	
TYPE_2_TAB . . . . . . . . . . .  	NUMBER	0040	

US_MODE  . . . . . . . . . . . .  	NUMBER	0000	

XLATT_COMMAND  . . . . . . . . .  	NUMBER	0040	
XT_KB  . . . . . . . . . . . . .  	NUMBER	4000	

ZERO_SCAN  . . . . . . . . . . .  	NUMBER	0020	

$L1  . . . . . . . . . . . . . .  	L NEAR	001D	CODE
@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  keybcpsd		
@VERSION . . . . . . . . . . . .  	TEXT  510		

Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:45:42

DOS - KEYB Command  -  Copy Shared_Data_Area                Symbols-5






   1223 Source  Lines
   1528 Total   Lines
    263 Symbols

  46314 + 194020 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
