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


				;
				page 60,132
				;
				title CP/DOS  DOSQhandtype  mapper
				;
 0000				dosxxx  segment byte public 'dos'
				        assume  cs:dosxxx,ds:nothing,es:nothing,ss:nothing
				;
				; ************************************************************************* *
				; *
				; *      MODULE: DosQhandtype
				; *
				; *      FILE NAME: DosQhandtype
				; *
				; *      FUNCTION: Determine whether a handle is file or device
				; *
				; *      CALLING SEQUENCE:
				; *
				; *             push    handle          ; file handle
				; *             push@   handtype        ; handle type
				; *             push@   flagword        ; device descriptor word
				; *             call    dosqhandtype
				; *
				; *      RETURN SEQUENCE:
				; *
				; *             handle type:   0  - if a file
				; *                            1  - if a device
				; *      MODULES CALLED:
				; *
				; *
				; *************************************************************************
				
				        public  dosqhandtype
				        .sall
				        .list
				
				
				str     struc
 0000  0000			old_bp          dw    ?
 0002  00000000			return          dd    ?
 0006  00000000			AttributePtr    dd    ?      ; Device descriptor word returned if device
 000A  00000000			HandleTypePtr   dd    ?      ; handle type; 0 = file handle, 1 = device handle
 000E  0000			Handle          dw    ?      ; file handle
 0010				str     ends
				
				
 0000				dosqhandtype proc   far
				
				        Enter   dosqhandtype            ; push registers
				
 000C  8B 5E 0E			        mov     bx,[bp].Handle          ; get file handle
 000F  B8 4400			        mov     ax,4400h
 0012  CD 21			        int     21h                     ; get handle type
				
 0014  C5 76 06			        lds     si,[bp].AttributePtr    ; setup area for attribute return
 0017  89 14			        mov     ds:[si],dx
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14
CP/DOS  DOSQhandtype  mapper                                Page     1-2


				
 0019  C5 76 0A			        lds     si,[bp].HandleTypePtr
 001C  C7 04 0000		        mov     ds:word ptr [si],0      ; assume it is a file
				
 0020  F7 C2 0080		        test    dx,00080h               ; test for file
 0024  74 04			        jz      ItIsAFile               ; jump if true
				
 0026  C7 04 0001		        mov     ds:word ptr [si],1      ; else, it is a device, set flag
				
 002A				ItIsAFile:
				        Mexit                           ; pop registers
 0036  CA 000A			        ret     size str - 6            ; return
				
 0039				dosqhandtype  endp
				
 0039				dosxxx  ends
				
				        end

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:14
CP/DOS  DOSQhandtype  mapper                                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

STR  . . . . . . . . . . . . . .  	0010	0005
  OLD_BP . . . . . . . . . . . .  	0000
  RETURN . . . . . . . . . . . .  	0002
  ATTRIBUTEPTR . . . . . . . . .  	0006
  HANDLETYPEPTR  . . . . . . . .  	000A
  HANDLE . . . . . . . . . . . .  	000E

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

DOSXXX . . . . . . . . . . . . .  	0039	BYTE	PUBLIC	'DOS'

Symbols:            

                N a m e         	Type	 Value	 Attr

dosqhandtype . . . . . . . . . .  	F PROC	0000	DOSXXX	Global	Length = 0039

ITISAFILE  . . . . . . . . . . .  	L NEAR	002A	DOSXXX

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


    122 Source  Lines
    146 Total   Lines
     19 Symbols

  47474 + 294473 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
