]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/DEVCONFG.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / DEVCONFG.ASM
1 ;\ f\e0
2 page 60,132
3 ;
4 title CP/DOS DosDevConfig mapper
5 ;
6 dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8 ;
9 ;**********************************************************************
10 ;*
11 ;* MODULE: dosdevconfig
12 ;*
13 ;* FILE NAME: dos013.asm
14 ;*
15 ;* CALLING SEQUENCE:
16 ;*
17 ;* push@ other returned info address
18 ;* push word item type being queried
19 ;* push word reserved parm(must be 0)
20 ;* call dosdevconfig
21 ;*
22 ;* MODULES CALLED: ROM BIOS Int 11, Equipment check
23 ;*
24 ;*********************************************************************
25
26 public dosdevconfig
27 .sall
28 include macros.inc
29
30 inv_parm equ 0002h
31 model_byte equ 0fffeh
32
33 str struc
34 old_bp dw ?
35 return dd ?
36 rsrvd dw ? ; reserved
37 item dw ? ; item number
38 data dd ? ; returned information
39 str ends
40
41 dosdevconfig proc far
42 Enter dosdevconfig ; push registers
43
44 mov ax,[bp].rsrvd ; reserved parm must
45 cmp ax,0 ; be zero
46 jne error ; if not zero, jump
47
48 mov ax,[bp].item ; range check
49 cmp ax,0
50 jl error ; if not zero, jump
51
52 cmp ax,3 ; covered by Int 11?
53 jg notint11
54 mov bx,ax ; ax destroyed by int
55
56 int 11h ; get peripherals on the system
57
58 xchg ax,bx ; restore ax
59
60 cmp ax,0 ; check number of printers??
61 jg notprint ; jump if not
62 mov cl,14 ; else, setup print bits
63 shr bx,cl ; in returned data
64 jmp short exit ; then return
65
66 notprint: cmp ax,1 ; check for RS232 adapters??
67 jg diskchk ; jump if not
68 mov cl,4 ; else, setup RS232 bits
69 shl bx,cl ; clear top bits
70 mov cl,13
71 shr bx,cl ; shift back
72 jmp short exit
73
74 diskchk: cmp ax,2 ; check for disk request??
75 jg math ; jump, if not
76 mov cl,8 ; else setup disk bits
77 shl bx,cl ; clear top bits
78 mov cl,14
79 shr bx,cl ; and shift back
80 inc bl ; 0=1 drive, etc.
81 jmp short exit
82
83 math: cmp ax,3 ; check for math coprocessor
84 jg notint11 ; jump, if not
85 mov cl,14 ; else, setup math coprocessor
86 shl bx,cl ; bits in return data
87 mov cl,15
88 shr bx,cl
89 jmp short exit
90
91 notint11: cmp ax,4 ; check for other valid item
92 je error
93 cmp ax,5 ; check for PC type ??
94 jg error ; jump if not so
95 push es ; else check for PC type
96 mov dx,0f000h ; read model byte from RAM
97 mov es,dx
98 mov al,es:model_byte ;model byte
99 pop es
100 sub al,0fch ;AT value = FC
101 jmp short exit ;all done, return
102
103 error: mov ax,inv_parm
104 jmp short exit1
105
106 exit: sub ax,ax ; set good return code
107 lds si,[bp].data ; set return data area address
108 mov byte ptr [si],bl ; save bit pattern in return
109 ; data area
110 exit1: Mexit ; pop registers
111 ret size str - 6 ; return
112
113 dosdevconfig endp
114
115 dosxxx ends
116
117 end