summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/QHANDTYP.ASM
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/MAPPER/QHANDTYP.ASM')
-rw-r--r--v4.0/src/MAPPER/QHANDTYP.ASM76
1 files changed, 76 insertions, 0 deletions
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