Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14
CP/DOS KbdSetStatus                                         Page     1-1


				;
				page 80,132
				;
				title CP/DOS KbdSetStatus
				
				        .sall
				        .list
				
 0000				kbddata segment word public 'kbddata'
				
				        extrn   KbdBitMask:word
				        extrn   KbdTurnAroundCharacter:word
				        extrn   KbdInterimCharFlags:word
				
 0000				kbddata ends
				
				
				
 0000				kbdxxx  segment byte public 'kbd'
				        assume  cs:kbdxxx,ds:nothing,es:nothing,ss:nothing
				;
				; ************************************************************************* *
				; *
				; *      MODULE:  kbdsetStatus
				; *
				; *
				; *      CALLING SEQUENCE:
				; *
				; *                PUSH@ DWORD   data              ;  kbd data structure
				; *                PUSH  WORD    handle            ;  kbd handle
				; *
				; *                CALL  kbdsetstatus
				; *
				; *      RETURN SEQUENCE:
				; *
				; *
				; *
				; *************************************************************************
				;
				        public kbdsetstatus
				
				str     struc
 0000  0000			old_bp  dw      ?
 0002  00000000			return  dd      ?
 0006  0000			handle  dw      ?       ; kbd handle
 0008  00000000			data    dd      ?       ; kbd data strructure pointer
 000C				str     ends
				
 0000				kbdsetstatus    proc    far
				
				        Enter   KbdSetStatus            ; save registers
				
 000C  C4 7E 08			        les     di,[bp].data            ; set up kbd data structure
 000F  B8 ---- R		        mov     ax,seg kbddata
 0012  8E D8			        mov     ds,ax
				        assume  ds:kbddata
				
 0014  26: 8B 45 02		        mov     ax,es:[di].Bit_Mask     ; get bit mask
				
 0018				CheckTurnAround:
 0018  A9 0040			        test    ax,040h                 ; define turnaround character ??
 001B  74 08			        jz      CheckInterimFlags       ; jump if not
				
 001D  26: 8B 5D 04		        mov     bx,es:[di].Turn_Around_Char  ; else, save turnaround character
 0021  89 1E 0000 E		        mov     KbdTurnAroundCharacter,bx
				
 0025				CheckInterimFlags:
 0025  A9 0020			        test    ax,020h                 ; check for interim character flag ??
 0028  74 08			        jz      CheckShiftState         ; if not jump
				
 002A  26: 8B 5D 06		        mov     bx,es:[di].Interim_Char_Flags   ; save interim character flag
 002E  89 1E 0000 E		        mov     KbdInterimCharFlags,bx
				
 0032				CheckShiftState:
 0032  A9 0010			        test    ax,010h                 ; check for shift state ??
 0035  74 0F			        jz      CheckCookedOn           ; jump if not
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14
CP/DOS KbdSetStatus                                         Page     1-2


				
 0037  1E			        push    ds                      ; setup for shift state
 0038  BB 0040			        mov     bx,040h
 003B  8E DB			        mov     ds,bx
				        assume  ds:nothing
				
 003D  26: 8B 5D 08		        mov     bx,es:[di].Status_Shift_State   ; save shift state data
 0041  88 1E 0018		        mov     ds:018h,bl
				
 0045  1F			        pop     ds
				        assume  ds:kbddata
				
 0046				CheckCookedOn:                              ; check for cooked mode ??
 0046  A9 0008			        test    ax,008h
 0049  74 0A			        jz      CheckRawOn
				
 004B  83 26 0000 E FB		        and     KbdBitMask,not RawModeOn    ; setup cooked mode status
 0050  83 0E 0000 E 08		        or      KbdBitMask,CookedModeOn
				
 0055				CheckRawOn:
 0055  A9 0004			        test    ax,004h                     ; check for raw mdoe ??
 0058  74 0A			        jz      CheckEchoOff
				
 005A  83 26 0000 E F7		        and     KbdBitMask,not CookedModeOn ; setup for raw mode
 005F  83 0E 0000 E 04		        or      KbdBitMask,RawModeOn
				
 0064				CheckEchoOff:
 0064  A9 0002			        test    ax,002h                     ; check for echo on
 0067  74 0A			        jz      CheckEchoOn                 ; branch if so
				
 0069  83 26 0000 E FE		        and     KbdBitMask,not EchoOn       ; else setup echo off
 006E  83 0E 0000 E 02		        or      KbdBitMask,EchoOff
				
 0073				CheckEchoOn:
 0073  A9 0001			        test    ax,001h
 0076  74 0A			        jz      EverythingSet
				
 0078  83 26 0000 E FD		        and     KbdBitMask,not EchoOff      ; setup echo on
 007D  83 0E 0000 E 01		        or      KbdBitMask,EchoOn
				
 0082				EverythingSet:
				        Mexit                               ; pop registers
				
 008E  CA 0006			        ret     size str - 6                ; return
				
 0091				KbdSetStatus    endp
				
 0091				kbdxxx  ends
				
				        end

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14
CP/DOS KbdSetStatus                                         Symbols-1


Macros:

		N a m e			Lines

ENTER  . . . . . . . . . . . . .  	   3
MEXIT  . . . . . . . . . . . . .  	   3
POPAL  . . . . . . . . . . . . .  	   9
PUSHAL . . . . . . . . . . . . .  	   9

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

KBDSTATUS  . . . . . . . . . . .  	000A	0005
  KS_LENGTH  . . . . . . . . . .  	0000
  BIT_MASK . . . . . . . . . . .  	0002
  TURN_AROUND_CHAR . . . . . . .  	0004
  INTERIM_CHAR_FLAGS . . . . . .  	0006
  STATUS_SHIFT_STATE . . . . . .  	0008
KEYDATA  . . . . . . . . . . . .  	0009	0005
  CHAR_CODE  . . . . . . . . . .  	0000
  SCAN_CODE  . . . . . . . . . .  	0001
  STATUS . . . . . . . . . . . .  	0002
  SHIFT_STATE  . . . . . . . . .  	0003
  TIME . . . . . . . . . . . . .  	0005
STR  . . . . . . . . . . . . . .  	000C	0004
  OLD_BP . . . . . . . . . . . .  	0000
  RETURN . . . . . . . . . . . .  	0002
  HANDLE . . . . . . . . . . . .  	0006
  DATA . . . . . . . . . . . . .  	0008

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

KBDDATA  . . . . . . . . . . . .  	0000	WORD	PUBLIC	'KBDDATA'
KBDXXX . . . . . . . . . . . . .  	0091	BYTE	PUBLIC	'KBD'

Symbols:            

                N a m e         	Type	 Value	 Attr

CHECKCOOKEDON  . . . . . . . . .  	L NEAR	0046	KBDXXX
CHECKECHOOFF . . . . . . . . . .  	L NEAR	0064	KBDXXX
CHECKECHOON  . . . . . . . . . .  	L NEAR	0073	KBDXXX
CHECKINTERIMFLAGS  . . . . . . .  	L NEAR	0025	KBDXXX
CHECKRAWON . . . . . . . . . . .  	L NEAR	0055	KBDXXX
CHECKSHIFTSTATE  . . . . . . . .  	L NEAR	0032	KBDXXX
CHECKTURNAROUND  . . . . . . . .  	L NEAR	0018	KBDXXX
COOKEDMODEON . . . . . . . . . .  	NUMBER	0008	

ECHOOFF  . . . . . . . . . . . .  	NUMBER	0002	
ECHOON . . . . . . . . . . . . .  	NUMBER	0001	
EVERYTHINGSET  . . . . . . . . .  	L NEAR	0082	KBDXXX

KbdBitMask . . . . . . . . . . .  	V WORD	0000	KBDDATA	External
KbdInterimCharFlags  . . . . . .  	V WORD	0000	KBDDATA	External
kbdsetstatus . . . . . . . . . .  	F PROC	0000	KBDXXX	Global	Length = 0091
KbdTurnAroundCharacter . . . . .  	V WORD	0000	KBDDATA	External

RAWMODEON  . . . . . . . . . . .  	NUMBER	0004	

@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  kbdsstat		
@VERSION . . . . . . . . . . . .  	TEXT  510		

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14

CP/DOS KbdSetStatus                                         Symbols-2






    209 Source  Lines
    233 Total   Lines
     45 Symbols

  47306 + 285427 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
