-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPIXEL.ASM
executable file
·155 lines (123 loc) · 3.48 KB
/
PIXEL.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
page ,132
;-----------------------------Module-Header-----------------------------;
; Module Name: PIXEL.ASM
;
; This module contains the Set/Get Pixel routine.
;
; Created: 22-Feb-1987
; Author: **** ***** [*****]
;
; Copyright (c) 1984-1987 Microsoft Corporation
;
; Exported Functions: Pixel
;
; Public Functions: none
;
; Public Data: none
;
; General Description:
;
; Pixel is used to either set a pixel to a given color with the
; current binary raster operation, or to return the color of the
; the pixel at the given location.
;
; Restrictions:
;
;-----------------------------------------------------------------------;
??_out Pixel
incDrawMode = 1 ;Include control for gdidefs.inc
.xlist
include cmacros.inc
include gdidefs.inc
include display.inc
include macros.mac
.list
externA ScreenSelector ;Selector to the screen
externA SCREEN_W_BYTES ;Screen width in bytes
ifdef EXCLUSION
externFP exclude_far ;Exclude area from screen
externFP unexclude_far ;Clear excluded area
endif
sBegin Data
externB enabled_flag ;Non-zero if output allowed
sEnd Data
createSeg _PIXEL,PixelSeg,word,public,CODE
sBegin PixelSeg
assumes cs,PixelSeg
rot_bit_tbl label byte
db 10000000b ;Table to map bit index into
db 01000000b ; a bit mask
db 00100000b
db 00010000b
db 00001000b
db 00000100b
db 00000010b
db 00000001b
page
;--------------------------Exported-Routine-----------------------------;
; Pixel
;
; Set or Get a Given Pixel
;
; The given pixel is set to the given color or the given pixel's
; physical color is returned.
;
; The physical device may be the screen or a monochrome bitmap.
;
; If lp_draw_mode is NULL, then the physical color of the pixel is
; returned. If lp_draw_mode isn't NULL, then the pixel will be set
; to the physical color passed in, combined with the pixel already
; at that location according to the raster-op in lp_draw_mode. Pixel
; doesn't pay attention to the background mode.
;
; No clipping of the input value is required. GDI clips the
; coordinate before it is passed in, for both Set and Get.
;
; Entry:
; Returns:
; DX:AX = physical color if get pixel
; DX:AX = positive if no error and set was OK.
; Error Returns:
; DX:AX = 8000:0000H if error occured
; Registers Preserved:
; SI,DI,DS,BP
; Registers Destroyed:
; AX,BX,CX,DX,ES,FLAGS
; Calls:
; exclude_far
; unexclude_far
; History:
; Sat 31-Oct-1987 00:21:06 -by- **** ***** [*****]
; Added clipping of the (X,Y)
;
; Tue 18-Aug-1987 14:50:37 -by- **** ***** [*****]
; Added test of the disabled flag.
;
; Tue 03-Mar-1987 20:42:07 -by- **** ****** [******]
; Moved a mov instruction in EGA ROP handling code.
;
; Sun 22-Feb-1987 16:29:09 -by- **** ***** [*****]
; Created.
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; {
; }
;-----------------------------------------------------------------------;
assumes ds,Data
assumes es,nothing
cProc Pixel,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lp_device ;Pointer to device
parmW x ;X coordinate of pixel
parmW y ;Y coordinate of pixel
parmD p_color ;Physical color to set pixel to
parmD lp_draw_mode ;Drawing mode to use, or null if Get
cBegin
mov ax, 1
mov dx, 1
pixel_exit:
cEnd
ifdef PUBDEFS
include pixel.pub
endif
sEnd PixelSeg
end