-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDISABLE.ASM
executable file
·109 lines (94 loc) · 2.85 KB
/
DISABLE.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
page ,132
;-----------------------------Module-Header-----------------------------;
; Module Name: DISABLE.ASM
;
; This module contains the routine which is called when the device
; is to disable itself.
;
; Created: 16-Jan-1987
; Author: **** ***** [*****]
;
; Copyright (c) 1983-1987 Microsoft Corporation
;
; Exported Functions: Disable
;
; Public Functions: none
;
; Public Data: none
;
; General Description:
;
; The Display is called to diable itself on one of two occasions.
; The first is when an old application is being run (e.g. WORD).
; In this instance, Disable will be called to disable the display
; hardware while the old application runs, then Enable will be
; called at some later time to reenable the device. Any state
; which is being maintained on the device must be saved by the
; driver.
;
; The second situation where the Disable routine is called is
; when Windows is ending the session. In this case, no state
; need be save. The display should return to a character mode.
;
; Unfortunately, there is no way to distinguish these two modes.
;
; Restrictions:
;
;-----------------------------------------------------------------------;
.xlist
include cmacros.inc
.list
externNP restore_int_2Fh ;Restore multiplexed interrupt
externNP physical_disable ;Routine to do the work
createSeg _INIT,InitSeg,word,public,CODE
sBegin InitSeg
assumes cs,InitSeg
page
;--------------------------Exported-Routine-----------------------------;
; INT Disable(lpPDevice)
; DEVICE lpPDevice;
;
; The display driver's physical disable routine is called to disable
; graphics and enter a character mode of operation.
;
; Warnings:
; Destroys AX,BX,CX,DX,ES,FLAGS
; Effects:
; none
; Calls:
; physical_disable
; History:
; Tue 18-Aug-1987 18:06:47 -by- **** ***** [*****]
; Pass ES = Data to physical disable
;
; Wed 12-Aug-1987 17:29:30 -by- **** ***** [*****]
; Made non-resident
;
; Fri 16-Jan-1987 17:52:12 -by- **** ***** [*****]
; Initial version
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; INT Disable(lpPDevice)
; DEVICE lpPDevice;
; {
; physical_disable(lpPDevice); // Do all the work here
; return(-1); // Show success
; }
;-----------------------------------------------------------------------;
cProc Disable,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lp_device
cBegin
push ds ;To break less drivers, pass
pop es ; DGROUP in ES instead of DS
assumes es,Data
lds si,lp_device ;--> logical device
assumes ds,nothing
push es ;physical_disable can destroy ES
; call physical_disable ;Restore device
pop es ;need DGROUP in ES for restore_int_2Fh
assumes es,Data
; call restore_int_2Fh
mov ax,-1 ;Show success
cEnd
sEnd InitSeg
end