Subversion Repositories Kolibri OS

Rev

Rev 5926 | Rev 5967 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5926 Rev 5956
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
9
 
9
 
10
Number of the function is located in the register eax.
10
Number of the function is located in the register eax.
11
The call of the system function is executed by "int 0x40" command.
11
The call of the system function is executed by "int 0x40" command.
12
All registers except explicitly declared in the returned value,
12
All registers except explicitly declared in the returned value,
13
    including eflags, are preserved.
13
    including eflags, are preserved.
14
 
14
 
15
 
15
 
16
======================================================================
16
======================================================================
17
============== Function 0 - define and draw the window. ==============
17
============== Function 0 - define and draw the window. ==============
18
======================================================================
18
======================================================================
19
Defines an application window. Draws a frame of the window, header and
19
Defines an application window. Draws a frame of the window, header and
20
working area. For skinned windows defines standard close and minimize
20
working area. For skinned windows defines standard close and minimize
21
buttons.
21
buttons.
22
Parameters:
22
Parameters:
23
  * eax = 0 - function number
23
  * eax = 0 - function number
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
26
  * edx = 0xXYRRGGBB, where:
26
  * edx = 0xXYRRGGBB, where:
27
    * Y = style of the window:
27
    * Y = style of the window:
28
      * Y=0 - type I - fixed-size window
28
      * Y=0 - type I - fixed-size window
29
      * Y=1 - only define window area, draw nothing
29
      * Y=1 - only define window area, draw nothing
30
      * Y=2 - type II - variable-size window
30
      * Y=2 - type II - variable-size window
31
      * Y=3 - skinned window
31
      * Y=3 - skinned window
32
      * Y=4 - skinned fixed-size window
32
      * Y=4 - skinned fixed-size window
33
      * other possible values (from 5 up to 15) are reserved,
33
      * other possible values (from 5 up to 15) are reserved,
34
        function call with such Y is ignored
34
        function call with such Y is ignored
35
    * RR, GG, BB = accordingly red, green, blue components of a color
35
    * RR, GG, BB = accordingly red, green, blue components of a color
36
      of the working area of the window (are ignored for style Y=1)
36
      of the working area of the window (are ignored for style Y=1)
37
    * X = DCBA (bits)
37
    * X = DCBA (bits)
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
39
                  must be passed in edi, for other styles use
39
                  must be passed in edi, for other styles use
40
                  subfunction 1 of function 71
40
                  subfunction 1 of function 71
41
      * B = 1 - coordinates of all graphics primitives are relative to
41
      * B = 1 - coordinates of all graphics primitives are relative to
42
                  window client area
42
                  window client area
43
      * C = 1 - don't fill working area on window draw
43
      * C = 1 - don't fill working area on window draw
44
      * D = 0 - normal filling of the working area, 1 - gradient
44
      * D = 0 - normal filling of the working area, 1 - gradient
45
    The following parameters are intended for windows
45
    The following parameters are intended for windows
46
    of a type I and II, and ignored for styles Y=1,3:
46
    of a type I and II, and ignored for styles Y=1,3:
47
  * esi = 0xXYRRGGBB - color of the header
47
  * esi = 0xXYRRGGBB - color of the header
48
    * RR, GG, BB define color
48
    * RR, GG, BB define color
49
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
49
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
50
    * X defines a gradient of header: X=0 - no gradient,
50
    * X defines a gradient of header: X=0 - no gradient,
51
      X=8 - usual gradient,
51
      X=8 - usual gradient,
52
      for windows of a type II X=4 - negative gradient
52
      for windows of a type II X=4 - negative gradient
53
    * other values of X and Y are reserved
53
    * other values of X and Y are reserved
54
  * edi = 0x00RRGGBB - color of the frame
54
  * edi = 0x00RRGGBB - color of the frame
55
Returned value:
55
Returned value:
56
  * function does not return value
56
  * function does not return value
57
Remarks:
57
Remarks:
58
  * Position and sizes of the window are installed by the first
58
  * Position and sizes of the window are installed by the first
59
    call of this function and are ignored at subsequent; to change
59
    call of this function and are ignored at subsequent; to change
60
    position and/or sizes of already created window use function 67.
60
    position and/or sizes of already created window use function 67.
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
62
    is set by the first call of this function and is ignored
62
    is set by the first call of this function and is ignored
63
    at subsequent (strictly speaking, is ignored after a call to
63
    at subsequent (strictly speaking, is ignored after a call to
64
    subfunction 2 of function 12 - end redraw); to change caption of
64
    subfunction 2 of function 12 - end redraw); to change caption of
65
    already created window use subfunction 1 of function 71.
65
    already created window use subfunction 1 of function 71.
66
  * If the window has appropriate styles, position and/or sizes can be
66
  * If the window has appropriate styles, position and/or sizes can be
67
    changed by user. Current position and sizes can be obtained
67
    changed by user. Current position and sizes can be obtained
68
    by function 9.
68
    by function 9.
69
  * The window must fit on the screen. If the transferred
69
  * The window must fit on the screen. If the transferred
70
    coordinates and sizes do not satisfy to this condition,
70
    coordinates and sizes do not satisfy to this condition,
71
    appropriate coordinate (or, probably, both) is considered as zero,
71
    appropriate coordinate (or, probably, both) is considered as zero,
72
    and if it does not help too, the appropriate size
72
    and if it does not help too, the appropriate size
73
    (or, probably, both) is installed in a size of the screen.
73
    (or, probably, both) is installed in a size of the screen.
74
 
74
 
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
76
    in ebx,ecx. The coordinates are resulted concerning
76
    in ebx,ecx. The coordinates are resulted concerning
77
    the left upper corner of the window, which, thus, is set as (0,0),
77
    the left upper corner of the window, which, thus, is set as (0,0),
78
    coordinates of the right lower corner essence (xsize,ysize).
78
    coordinates of the right lower corner essence (xsize,ysize).
79
  * The sizes of the window are understood in sence of coordinates
79
  * The sizes of the window are understood in sence of coordinates
80
    of the right lower corner. This concerns all other functions too.
80
    of the right lower corner. This concerns all other functions too.
81
    It means, that the real sizes are on 1 pixel more.
81
    It means, that the real sizes are on 1 pixel more.
82
  * The window of type I looks as follows:
82
  * The window of type I looks as follows:
83
    * draw external frame of color indicated in edi, 1 pixel in width
83
    * draw external frame of color indicated in edi, 1 pixel in width
84
    * draw header - rectangle with the left upper corner (1,1) and
84
    * draw header - rectangle with the left upper corner (1,1) and
85
      right lower (xsize-1,min(20,ysize-1)) color indicated in esi
85
      right lower (xsize-1,min(20,ysize-1)) color indicated in esi
86
      (taking a gradient into account)
86
      (taking a gradient into account)
87
    * if ysize>21, fill the working area of the window -
87
    * if ysize>21, fill the working area of the window -
88
      rectangle with the left upper corner (1,21) and right lower
88
      rectangle with the left upper corner (1,21) and right lower
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
90
      indicated in edx (taking a gradient into account)
90
      indicated in edx (taking a gradient into account)
91
    * if A=1 and caption has been already set by subfunction 1
91
    * if A=1 and caption has been already set by subfunction 1
92
      of function 71, it is drawn in the corresponding place of header
92
      of function 71, it is drawn in the corresponding place of header
93
  * The window of style Y=1 looks as follows:
93
  * The window of style Y=1 looks as follows:
94
    * completely defined by the application
94
    * completely defined by the application
95
  * The window of type II looks as follows:
95
  * The window of type II looks as follows:
96
    * draw external frame of width 1 pixel with the "shaded" color
96
    * draw external frame of width 1 pixel with the "shaded" color
97
      edi (all components of the color decrease twice)
97
      edi (all components of the color decrease twice)
98
    * draw intermediate frame of width 3 pixels with color edi
98
    * draw intermediate frame of width 3 pixels with color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
100
    * draw header - rectangle with the left upper corner (4,4)
100
    * draw header - rectangle with the left upper corner (4,4)
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
102
      (taking a gradient into account)
102
      (taking a gradient into account)
103
    * if ysize>=26, fill the working area of the window -
103
    * if ysize>=26, fill the working area of the window -
104
      rectangle with the left upper corner (5,20) and right lower
104
      rectangle with the left upper corner (5,20) and right lower
105
      (xsize-5,ysize-5) with color indicated in edx
105
      (xsize-5,ysize-5) with color indicated in edx
106
      (taking a gradient into account)
106
      (taking a gradient into account)
107
    * if A=1 and caption has been already set by subfunction 1
107
    * if A=1 and caption has been already set by subfunction 1
108
      of function 71, it is drawn in the corresponding place of header
108
      of function 71, it is drawn in the corresponding place of header
109
  * The skinned window looks as follows:
109
  * The skinned window looks as follows:
110
    * draw external frame of width 1 pixel
110
    * draw external frame of width 1 pixel
111
      with color 'outer' from the skin
111
      with color 'outer' from the skin
112
    * draw intermediate frame of width 3 pixel
112
    * draw intermediate frame of width 3 pixel
113
      with color 'frame' from the skin
113
      with color 'frame' from the skin
114
    * draw internal frame of width 1 pixel
114
    * draw internal frame of width 1 pixel
115
      with color 'inner' from the skin
115
      with color 'inner' from the skin
116
    * draw header (on bitmaps from the skin) in a rectangle
116
    * draw header (on bitmaps from the skin) in a rectangle
117
      (0,0) - (xsize,_skinh-1)
117
      (0,0) - (xsize,_skinh-1)
118
    * if ysize>=26, fill the working area of the window -
118
    * if ysize>=26, fill the working area of the window -
119
      rectangle with the left upper corner (5,_skinh) and right lower
119
      rectangle with the left upper corner (5,_skinh) and right lower
120
      (xsize-5,ysize-5) with color indicated in edx
120
      (xsize-5,ysize-5) with color indicated in edx
121
      (taking a gradient into account)
121
      (taking a gradient into account)
122
    * define two standard buttons: close and minimize
122
    * define two standard buttons: close and minimize
123
      (see function 8)
123
      (see function 8)
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
125
      it is drawn in place in header defined in the skin
125
      it is drawn in place in header defined in the skin
126
    * value _skinh is accessible as the result of call
126
    * value _skinh is accessible as the result of call
127
      subfunction 4 of function 48
127
      subfunction 4 of function 48
128
 
128
 
129
======================================================================
129
======================================================================
130
================ Function 1 - put pixel in the window. ===============
130
================ Function 1 - put pixel in the window. ===============
131
======================================================================
131
======================================================================
132
Parameters:
132
Parameters:
133
  * eax = 1 - function number
133
  * eax = 1 - function number
134
  * ebx = x-coordinate (relative to the window)
134
  * ebx = x-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
136
  * edx = 0x00RRGGBB - color of a pixel
136
  * edx = 0x00RRGGBB - color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
138
          (low 24 bits are ignored)
138
          (low 24 bits are ignored)
139
Returned value:
139
Returned value:
140
  * function does not return value
140
  * function does not return value
141
 
141
 
142
======================================================================
142
======================================================================
143
============ Function 2 - get the code of the pressed key. ===========
143
============ Function 2 - get the code of the pressed key. ===========
144
======================================================================
144
======================================================================
145
Takes away the code of the pressed key from the buffer.
145
Takes away the code of the pressed key from the buffer.
146
Parameters:
146
Parameters:
147
  * eax = 2 - function number
147
  * eax = 2 - function number
148
Returned value:
148
Returned value:
149
  * if the buffer is empty, function returns eax=1
149
  * if the buffer is empty, function returns eax=1
150
  * if the buffer is not empty, function returns al=0,
150
  * if the buffer is not empty, function returns al=0,
151
    ah=code of the pressed key,
151
    ah=code of the pressed key,
152
    bits 16-23 = contain scancode for pressed key in ASCII mode,
152
    bits 16-23 = contain scancode for pressed key in ASCII mode,
153
                 in the scancodes mode this bits cleared.
153
                 in the scancodes mode this bits cleared.
154
    bits 23-31 = zero
154
    bits 23-31 = zero
155
  * if there is "hotkey", function returns al=2,
155
  * if there is "hotkey", function returns al=2,
156
    ah=scancode of the pressed key (0 for control keys),
156
    ah=scancode of the pressed key (0 for control keys),
157
    high word of eax contains a status of control keys at the moment
157
    high word of eax contains a status of control keys at the moment
158
    of pressing a hotkey
158
    of pressing a hotkey
159
Remarks:
159
Remarks:
160
  * There is a common system buffer of the pressed keys
160
  * There is a common system buffer of the pressed keys
161
    by a size of 120 bytes, organized as queue.
161
    by a size of 120 bytes, organized as queue.
162
  * There is one more common system buffer on 120 "hotkeys".
162
  * There is one more common system buffer on 120 "hotkeys".
163
  * If the application with the inactive window calls this function,
163
  * If the application with the inactive window calls this function,
164
    the buffer of the pressed keys is considered to be empty.
164
    the buffer of the pressed keys is considered to be empty.
165
  * By default this function returns ASCII-codes; to switch
165
  * By default this function returns ASCII-codes; to switch
166
    to the scancodes mode (and back) use function 66.
166
    to the scancodes mode (and back) use function 66.
167
    However, hotkeys are always notificated as scancodes.
167
    However, hotkeys are always notificated as scancodes.
168
  * To find out, what keys correspond to what codes, start
168
  * To find out, what keys correspond to what codes, start
169
    the application keyascii and scancode.
169
    the application keyascii and scancode.
170
  * Scancodes come directly from keyboard and are fixed;
170
  * Scancodes come directly from keyboard and are fixed;
171
    ASCII-codes turn out with usage of the conversion tables,
171
    ASCII-codes turn out with usage of the conversion tables,
172
    which can be set by subfunction 2 of function 21
172
    which can be set by subfunction 2 of function 21
173
    and get by subfunction 2 of function 26.
173
    and get by subfunction 2 of function 26.
174
  * As a consequence, ASCII-codes take into account current
174
  * As a consequence, ASCII-codes take into account current
175
    keyboard layout (rus/en) as opposed to scancodes.
175
    keyboard layout (rus/en) as opposed to scancodes.
176
  * This function notifies only about those hotkeys, which were
176
  * This function notifies only about those hotkeys, which were
177
    defined by this thread by subfunction 4 of function 66.
177
    defined by this thread by subfunction 4 of function 66.
178
 
178
 
179
======================================================================
179
======================================================================
180
==================== Function 3 - get system time. ===================
180
==================== Function 3 - get system time. ===================
181
======================================================================
181
======================================================================
182
Parameters:
182
Parameters:
183
  * eax = 3 - function number
183
  * eax = 3 - function number
184
Returned value:
184
Returned value:
185
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
185
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
186
  * each item is BCD-number, for example,
186
  * each item is BCD-number, for example,
187
    for time 23:59:59 function returns 0x00595923
187
    for time 23:59:59 function returns 0x00595923
188
Remarks:
188
Remarks:
189
  * See also subfunction 9 of function 26 - get time from
189
  * See also subfunction 9 of function 26 - get time from
190
    the moment of start of the system; it is more convenient, because
190
    the moment of start of the system; it is more convenient, because
191
    returns simply DWORD-value of the time counter.
191
    returns simply DWORD-value of the time counter.
192
  * System time can be set by function 22.
192
  * System time can be set by function 22.
193
 
193
 
194
======================================================================
194
======================================================================
195
=================== Function 4 - draw text string. ===================
195
=================== Function 4 - draw text string. ===================
196
======================================================================
196
======================================================================
197
Parameters:
197
Parameters:
198
  * eax = 4 - function number
198
  * eax = 4 - function number
199
  * ebx = X*65536+Y, coordinates in the window or buffer
199
  * ebx = X*65536+Y, coordinates in the window or buffer
200
  * ecx = 0xXXRRGGBB, where
200
  * ecx = 0xXXRRGGBB, where
201
    * RR, GG, BB specify text color
201
    * RR, GG, BB specify text color
202
    * XX = ABFFCSSS (bits):
202
    * XX = ABFFCSSS (bits):
203
      * A=1 - output zero terminated string
203
      * A=1 - output zero terminated string
204
      * B=1 - fill background (color = edi)
204
      * B=1 - fill background (color = edi)
205
      * FF specifies the font and encoding:
205
      * FF specifies the font and encoding:
206
        0 = 6x9  cp866
206
        0 = 6x9  cp866
207
        1 = 8x16 cp866
207
        1 = 8x16 cp866
208
        2 = 8x16 UTF-16LE
208
        2 = 8x16 UTF-16LE
209
        3 = 8x16 UTF-8
209
        3 = 8x16 UTF-8
210
      * C=0 - draw to the window,
210
      * C=0 - draw to the window,
211
        C=1 - draw to the user buffer (edi)
211
        C=1 - draw to the user buffer (edi)
212
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
212
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
213
  * edx = pointer to the beginning of the string
213
  * edx = pointer to the beginning of the string
214
  * esi = for A=0 length of the string, for A=1 is ignored
214
  * esi = for A=0 length of the string, for A=1 is ignored
215
  * edi = for B=1 color to fill background,
215
  * edi = for B=1 color to fill background,
216
          for C=1 pointer to user buffer
216
          for C=1 pointer to user buffer
217
 
217
 
218
Returned value:
218
Returned value:
219
  * function does not return value
219
  * function does not return value
220
Remarks:
220
Remarks:
221
  * You can not use B=1 and C=1 at the same time, since both use edi.
221
  * You can not use B=1 and C=1 at the same time, since both use edi.
222
  * When SSS=0, font may be smoothed, depending on system setting.
222
  * When SSS=0, font may be smoothed, depending on system setting.
223
  * User buffer structure:
223
  * User buffer structure:
224
Xsize       dd
224
Xsize       dd
225
Ysize       dd
225
Ysize       dd
226
picture     rb  Xsize*Ysize*4  ; 32 bpp
226
picture     rb  Xsize*Ysize*4  ; 32 bpp
227
 
227
 
228
======================================================================
228
======================================================================
229
========================= Function 5 - delay. ========================
229
========================= Function 5 - delay. ========================
230
======================================================================
230
======================================================================
231
Delays execution of the program on the given time.
231
Delays execution of the program on the given time.
232
Parameters:
232
Parameters:
233
  * eax = 5 - function number
233
  * eax = 5 - function number
234
  * ebx = time in the 1/100 of second
234
  * ebx = time in the 1/100 of second
235
Returned value:
235
Returned value:
236
  * function does not return value
236
  * function does not return value
237
Remarks:
237
Remarks:
238
  * Passing ebx=0 does not transfer control to the next process
238
  * Passing ebx=0 does not transfer control to the next process
239
    and does not make any operations at all. If it is really required
239
    and does not make any operations at all. If it is really required
240
    to transfer control to the next process (to complete a current
240
    to transfer control to the next process (to complete a current
241
    time slice), use subfunction 1 of function 68.
241
    time slice), use subfunction 1 of function 68.
242
 
242
 
243
======================================================================
243
======================================================================
244
============== Function 6 - read the file from ramdisk. ==============
244
============== Function 6 - read the file from ramdisk. ==============
245
======================================================================
245
======================================================================
246
Parameters:
246
Parameters:
247
  * eax = 6 - function number
247
  * eax = 6 - function number
248
  * ebx = pointer to the filename
248
  * ebx = pointer to the filename
249
  * ecx = number of start block, beginning from 1;
249
  * ecx = number of start block, beginning from 1;
250
    ecx=0 - read from the beginning of the file (same as ecx=1)
250
    ecx=0 - read from the beginning of the file (same as ecx=1)
251
  * edx = number of blocks to read;
251
  * edx = number of blocks to read;
252
    edx=0 - read one block (same as edx=1)
252
    edx=0 - read one block (same as edx=1)
253
  * esi = pointer to memory area for the data
253
  * esi = pointer to memory area for the data
254
Returned value:
254
Returned value:
255
  * eax = file size in bytes, if the file was successfully read
255
  * eax = file size in bytes, if the file was successfully read
256
  * eax = -1, if the file was not found
256
  * eax = -1, if the file was not found
257
Remarks:
257
Remarks:
258
  * This function is out-of-date; function 70 allows
258
  * This function is out-of-date; function 70 allows
259
    to fulfil the same operations with the extended possibilities.
259
    to fulfil the same operations with the extended possibilities.
260
  * Block = 512 bytes.
260
  * Block = 512 bytes.
261
  * For reading all file you can specify the certainly large value
261
  * For reading all file you can specify the certainly large value
262
    in edx, for example, edx = -1; but in this case be ready that
262
    in edx, for example, edx = -1; but in this case be ready that
263
    the program will "fall", if the file will appear too large and can
263
    the program will "fall", if the file will appear too large and can
264
    not be placed in the program memory.
264
    not be placed in the program memory.
265
  * The filename must be either in the format 8+3 characters
265
  * The filename must be either in the format 8+3 characters
266
    (first 8 characters - name itself, last 3 - extension,
266
    (first 8 characters - name itself, last 3 - extension,
267
    the short names and extensions are supplemented with spaces),
267
    the short names and extensions are supplemented with spaces),
268
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
268
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
269
    (name no more than 8 characters, dot, extension 3 characters
269
    (name no more than 8 characters, dot, extension 3 characters
270
    supplemented if necessary by spaces).
270
    supplemented if necessary by spaces).
271
    The filename must be written with capital letters. The terminating
271
    The filename must be written with capital letters. The terminating
272
    character with code 0 is not necessary (not ASCIIZ-string).
272
    character with code 0 is not necessary (not ASCIIZ-string).
273
  * This function does not support folders on the ramdisk.
273
  * This function does not support folders on the ramdisk.
274
 
274
 
275
======================================================================
275
======================================================================
276
=============== Function 7 - draw image in the window. ===============
276
=============== Function 7 - draw image in the window. ===============
277
======================================================================
277
======================================================================
278
Paramters:
278
Paramters:
279
  * eax = 7 - function number
279
  * eax = 7 - function number
280
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
280
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
281
  * ecx = [size on axis x]*65536 + [size on axis y]
281
  * ecx = [size on axis x]*65536 + [size on axis y]
282
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
282
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
283
Returned value:
283
Returned value:
284
  * function does not return value
284
  * function does not return value
285
Remarks:
285
Remarks:
286
  * Coordinates of the image are coordinates of the upper left corner
286
  * Coordinates of the image are coordinates of the upper left corner
287
    of the image relative to the window.
287
    of the image relative to the window.
288
  * Size of the image in bytes is 3*xsize*ysize.
288
  * Size of the image in bytes is 3*xsize*ysize.
289
 
289
 
290
======================================================================
290
======================================================================
291
=============== Function 8 - define/delete the button. ===============
291
=============== Function 8 - define/delete the button. ===============
292
======================================================================
292
======================================================================
293
Parameters for button definition:
293
Parameters for button definition:
294
  * eax = 8 - function number
294
  * eax = 8 - function number
295
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
295
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
296
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
296
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
297
  * edx = 0xXYnnnnnn, where:
297
  * edx = 0xXYnnnnnn, where:
298
    * nnnnnn = identifier of the button
298
    * nnnnnn = identifier of the button
299
    * high (31st) bit of edx is cleared
299
    * high (31st) bit of edx is cleared
300
    * if 30th bit of edx is set - do not draw the button
300
    * if 30th bit of edx is set - do not draw the button
301
    * if 29th bit of edx is set - do not draw a frame
301
    * if 29th bit of edx is set - do not draw a frame
302
      at pressing the button
302
      at pressing the button
303
  * esi = 0x00RRGGBB - color of the button
303
  * esi = 0x00RRGGBB - color of the button
304
Parameters for button deleting:
304
Parameters for button deleting:
305
  * eax = 8 - function number
305
  * eax = 8 - function number
306
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
306
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
307
Returned value:
307
Returned value:
308
  * function does not return value
308
  * function does not return value
309
Remarks:
309
Remarks:
310
  * Sizes of the button must be more than 0 and less than 0x8000.
310
  * Sizes of the button must be more than 0 and less than 0x8000.
311
  * For skinned windows definition of the window
311
  * For skinned windows definition of the window
312
    (call of 0th function) creates two standard buttons -
312
    (call of 0th function) creates two standard buttons -
313
    for close of the window with identifier 1 and
313
    for close of the window with identifier 1 and
314
    for minimize of the window with identifier 0xffff.
314
    for minimize of the window with identifier 0xffff.
315
  * The creation of two buttons with same identifiers is admitted.
315
  * The creation of two buttons with same identifiers is admitted.
316
  * The button with the identifier 0xffff at pressing is interpreted
316
  * The button with the identifier 0xffff at pressing is interpreted
317
    by the system as the button of minimization, the system handles
317
    by the system as the button of minimization, the system handles
318
    such pressing independently, not accessing to the application.
318
    such pressing independently, not accessing to the application.
319
    In rest it is usual button.
319
    In rest it is usual button.
320
  * Total number of buttons for all applications is limited to 4095.
320
  * Total number of buttons for all applications is limited to 4095.
321
 
321
 
322
======================================================================
322
======================================================================
323
============ Function 9 - information on execution thread. ===========
323
============ Function 9 - information on execution thread. ===========
324
======================================================================
324
======================================================================
325
Parameters:
325
Parameters:
326
  * eax = 9 - function number
326
  * eax = 9 - function number
327
  * ebx = pointer to 1-Kb buffer
327
  * ebx = pointer to 1-Kb buffer
328
  * ecx = number of the slot of the thread
328
  * ecx = number of the slot of the thread
329
    ecx = -1 - get information on the current thread
329
    ecx = -1 - get information on the current thread
330
Returned value:
330
Returned value:
331
  * eax = maximum number of the slot of a thread
331
  * eax = maximum number of the slot of a thread
332
  * buffer pointed to by ebx contains the following information:
332
  * buffer pointed to by ebx contains the following information:
333
    * +0: dword: usage of the processor (how many time units
333
    * +0: dword: usage of the processor (how many time units
334
      per second leaves on execution of this thread)
334
      per second leaves on execution of this thread)
335
    * +4: word: position of the window of thread in the window stack
335
    * +4: word: position of the window of thread in the window stack
336
    * +6: word: (has no relation to the specified thread)
336
    * +6: word: (has no relation to the specified thread)
337
      number of the thread slot, which window has in the window stack
337
      number of the thread slot, which window has in the window stack
338
      position ecx
338
      position ecx
339
    * +8: word: reserved
339
    * +8: word: reserved
340
    * +10 = +0xA: 11 bytes: name of the process
340
    * +10 = +0xA: 11 bytes: name of the process
341
      (name of the started file - executable file without extension)
341
      (name of the started file - executable file without extension)
342
    * +21 = +0x15: byte: reserved, this byte is not changed
342
    * +21 = +0x15: byte: reserved, this byte is not changed
343
    * +22 = +0x16: dword: address of the process in memory
343
    * +22 = +0x16: dword: address of the process in memory
344
    * +26 = +0x1A: dword: size of used memory - 1
344
    * +26 = +0x1A: dword: size of used memory - 1
345
    * +30 = +0x1E: dword: identifier (PID/TID)
345
    * +30 = +0x1E: dword: identifier (PID/TID)
346
    * +34 = +0x22: dword: coordinate of the thread window on axis x
346
    * +34 = +0x22: dword: coordinate of the thread window on axis x
347
    * +38 = +0x26: dword: coordinate of the thread window on axis y
347
    * +38 = +0x26: dword: coordinate of the thread window on axis y
348
    * +42 = +0x2A: dword: size of the thread window on axis x
348
    * +42 = +0x2A: dword: size of the thread window on axis x
349
    * +46 = +0x2E: dword: size of the thread window on axis y
349
    * +46 = +0x2E: dword: size of the thread window on axis y
350
    * +50 = +0x32: word: status of the thread slot:
350
    * +50 = +0x32: word: status of the thread slot:
351
      * 0 = thread is running
351
      * 0 = thread is running
352
      * 1 = thread is suspended
352
      * 1 = thread is suspended
353
      * 2 = thread is suspended while waiting for event
353
      * 2 = thread is suspended while waiting for event
354
      * 3 = thread is terminating as a result of call to function -1
354
      * 3 = thread is terminating as a result of call to function -1
355
        or under duress as a result of call to subfunction 2
355
        or under duress as a result of call to subfunction 2
356
        of function 18 or termination of the system
356
        of function 18 or termination of the system
357
      * 4 = thread is terminating as a result of exception
357
      * 4 = thread is terminating as a result of exception
358
      * 5 = thread waits for event
358
      * 5 = thread waits for event
359
      * 9 = requested slot is free, all other information on the slot
359
      * 9 = requested slot is free, all other information on the slot
360
        is not meaningful
360
        is not meaningful
361
    * +52 = +0x34: word: reserved, this word is not changed
361
    * +52 = +0x34: word: reserved, this word is not changed
362
    * +54 = +0x36: dword: coordinate of the client area on axis x
362
    * +54 = +0x36: dword: coordinate of the client area on axis x
363
    * +58 = +0x3A: dword: coordinate of the client area on axis y
363
    * +58 = +0x3A: dword: coordinate of the client area on axis y
364
    * +62 = +0x3E: dword: width of the client area
364
    * +62 = +0x3E: dword: width of the client area
365
    * +66 = +0x42: dword: height of the client area
365
    * +66 = +0x42: dword: height of the client area
366
    * +70 = +0x46: byte: state of the window - bitfield
366
    * +70 = +0x46: byte: state of the window - bitfield
367
      * bit 0 (mask 1): window is maximized
367
      * bit 0 (mask 1): window is maximized
368
      * bit 1 (mask 2): window is minimized to panel
368
      * bit 1 (mask 2): window is minimized to panel
369
      * bit 2 (mask 4): window is rolled up
369
      * bit 2 (mask 4): window is rolled up
370
    * +71 = +0x47: dword: event mask
370
    * +71 = +0x47: dword: event mask
371
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
371
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
372
Remarks:
372
Remarks:
373
  * Slots are numbered starting from 1.
373
  * Slots are numbered starting from 1.
374
  * Returned value is not a total number of threads, because there
374
  * Returned value is not a total number of threads, because there
375
    can be free slots.
375
    can be free slots.
376
  * When process is starting, system automatically creates
376
  * When process is starting, system automatically creates
377
    execution thread.
377
    execution thread.
378
  * Function gives information on the thread. Each process has
378
  * Function gives information on the thread. Each process has
379
    at least one thread. One process can create many threads,
379
    at least one thread. One process can create many threads,
380
    in this case each thread has its own slot and the fields
380
    in this case each thread has its own slot and the fields
381
    +10, +22, +26 in these slots coincide.
381
    +10, +22, +26 in these slots coincide.
382
    Applications have no common way to define whether two threads
382
    Applications have no common way to define whether two threads
383
    belong to one process.
383
    belong to one process.
384
  * The active window - window on top of the window stack -
384
  * The active window - window on top of the window stack -
385
    receives the messages on a keyboard input. For such window
385
    receives the messages on a keyboard input. For such window
386
    the position in the window stack coincides with returned value.
386
    the position in the window stack coincides with returned value.
387
  * Slot 1 corresponds to special system thread, for which:
387
  * Slot 1 corresponds to special system thread, for which:
388
    * the window is in the bottom of the window stack, the fields
388
    * the window is in the bottom of the window stack, the fields
389
      +4 and +6 contain value 1
389
      +4 and +6 contain value 1
390
    * name of the process - "OS/IDLE" (supplemented by spaces)
390
    * name of the process - "OS/IDLE" (supplemented by spaces)
391
    * address of the process in memory is 0, size of used memory is
391
    * address of the process in memory is 0, size of used memory is
392
      16 Mb (0x1000000)
392
      16 Mb (0x1000000)
393
    * PID=1
393
    * PID=1
394
    * coordinates and sizes of the window and the client area are by
394
    * coordinates and sizes of the window and the client area are by
395
      convention set to 0
395
      convention set to 0
396
    * status of the slot is always 0 (running)
396
    * status of the slot is always 0 (running)
397
    * the execution time adds of time leaving on operations itself
397
    * the execution time adds of time leaving on operations itself
398
      and idle time in waiting for interrupt (which can be got by call
398
      and idle time in waiting for interrupt (which can be got by call
399
      to subfunction 4 of function 18).
399
      to subfunction 4 of function 18).
400
  * Beginning from slot 2, the normal applications are placed.
400
  * Beginning from slot 2, the normal applications are placed.
401
  * The normal applications are placed in memory at the address
401
  * The normal applications are placed in memory at the address
402
    0 (kernel constant 'std_application_base_address').
402
    0 (kernel constant 'std_application_base_address').
403
    There is no intersection, as each process has its own page table.
403
    There is no intersection, as each process has its own page table.
404
  * At creation of the thread it is assigned the slot
404
  * At creation of the thread it is assigned the slot
405
    in the system table and identifier (Process/Thread IDentifier =
405
    in the system table and identifier (Process/Thread IDentifier =
406
    PID/TID), which do not vary with time for given thread.
406
    PID/TID), which do not vary with time for given thread.
407
    After completion of the thread its slot can be anew used
407
    After completion of the thread its slot can be anew used
408
    for another thread. The thread identifier can not be assigned
408
    for another thread. The thread identifier can not be assigned
409
    to other thread even after completion of this thread.
409
    to other thread even after completion of this thread.
410
    Identifiers, assigned to new threads, grow monotonously.
410
    Identifiers, assigned to new threads, grow monotonously.
411
  * If the thread has not yet defined the window by call to
411
  * If the thread has not yet defined the window by call to
412
    function 0, the position and the sizes
412
    function 0, the position and the sizes
413
    of its window are considered to be zero.
413
    of its window are considered to be zero.
414
  * Coordinates of the client area are relative to the window.
414
  * Coordinates of the client area are relative to the window.
415
  * At the moment only the part of the buffer by a size
415
  * At the moment only the part of the buffer by a size
416
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
416
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
417
    1-Kb buffer for the future compatibility, in the future
417
    1-Kb buffer for the future compatibility, in the future
418
    some fields can be added.
418
    some fields can be added.
419
 
419
 
420
======================================================================
420
======================================================================
421
==================== Function 10 - wait for event. ===================
421
==================== Function 10 - wait for event. ===================
422
======================================================================
422
======================================================================
423
If the message queue is empty, waits for appearance of the message
423
If the message queue is empty, waits for appearance of the message
424
in queue. In this state thread does not consume CPU time.
424
in queue. In this state thread does not consume CPU time.
425
Then reads out the message from queue.
425
Then reads out the message from queue.
426
 
426
 
427
Parameters:
427
Parameters:
428
  * eax = 10 - function number
428
  * eax = 10 - function number
429
Returned value:
429
Returned value:
430
  * eax = event (see the list of events)
430
  * eax = event (see the list of events)
431
Remarks:
431
Remarks:
432
  * Those events are taken into account only which enter into
432
  * Those events are taken into account only which enter into
433
    a mask set by function 40. By default it is
433
    a mask set by function 40. By default it is
434
    redraw, key and button events.
434
    redraw, key and button events.
435
  * To check, whether there is a message in queue, use function 11.
435
  * To check, whether there is a message in queue, use function 11.
436
    To wait for no more than given time, use function 23.
436
    To wait for no more than given time, use function 23.
437
 
437
 
438
======================================================================
438
======================================================================
439
=============== Function 11 - check for event, no wait. ==============
439
=============== Function 11 - check for event, no wait. ==============
440
======================================================================
440
======================================================================
441
If the message queue contains event, function reads out
441
If the message queue contains event, function reads out
442
and return it. If the queue is empty, function returns 0.
442
and return it. If the queue is empty, function returns 0.
443
Parameters:
443
Parameters:
444
  * eax = 11 - function number
444
  * eax = 11 - function number
445
Returned value:
445
Returned value:
446
  * eax = 0 - message queue is empty
446
  * eax = 0 - message queue is empty
447
  * else eax = event (see the list of events)
447
  * else eax = event (see the list of events)
448
Remarks:
448
Remarks:
449
  * Those events are taken into account only, which enter into
449
  * Those events are taken into account only, which enter into
450
    a mask set by function 40. By default it is
450
    a mask set by function 40. By default it is
451
    redraw, key and button events.
451
    redraw, key and button events.
452
  * To wait for event, use function 10.
452
  * To wait for event, use function 10.
453
    To wait for no more than given time, use function 23.
453
    To wait for no more than given time, use function 23.
454
 
454
 
455
======================================================================
455
======================================================================
456
=============== Function 12 - begin/end window redraw. ===============
456
=============== Function 12 - begin/end window redraw. ===============
457
======================================================================
457
======================================================================
458
 
458
 
459
---------------- Subfunction 1 - begin window redraw. ----------------
459
---------------- Subfunction 1 - begin window redraw. ----------------
460
Parameters:
460
Parameters:
461
  * eax = 12 - function number
461
  * eax = 12 - function number
462
  * ebx = 1 - subfunction number
462
  * ebx = 1 - subfunction number
463
Returned value:
463
Returned value:
464
  * function does not return value
464
  * function does not return value
465
 
465
 
466
----------------- Subfunction 2 - end window redraw. -----------------
466
----------------- Subfunction 2 - end window redraw. -----------------
467
Parameters:
467
Parameters:
468
  * eax = 12 - function number
468
  * eax = 12 - function number
469
  * ebx = 2 - subfunction number
469
  * ebx = 2 - subfunction number
470
Returned value:
470
Returned value:
471
  * function does not return value
471
  * function does not return value
472
Remarks:
472
Remarks:
473
  * Subfunction 1 deletes all buttons defined with
473
  * Subfunction 1 deletes all buttons defined with
474
    function 8, they must be defined again.
474
    function 8, they must be defined again.
475
 
475
 
476
======================================================================
476
======================================================================
477
============ Function 13 - draw a rectangle in the window. ===========
477
============ Function 13 - draw a rectangle in the window. ===========
478
======================================================================
478
======================================================================
479
Parameters:
479
Parameters:
480
  * eax = 13 - function number
480
  * eax = 13 - function number
481
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
481
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
482
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
482
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
483
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
483
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
484
Returned value:
484
Returned value:
485
  * function does not return value
485
  * function does not return value
486
Remarks:
486
Remarks:
487
  * Coordinates are understood as coordinates of the left upper corner
487
  * Coordinates are understood as coordinates of the left upper corner
488
    of a rectangle relative to the window.
488
    of a rectangle relative to the window.
489
 
489
 
490
======================================================================
490
======================================================================
491
=================== Function 14 - get screen size. ===================
491
=================== Function 14 - get screen size. ===================
492
======================================================================
492
======================================================================
493
Parameters:
493
Parameters:
494
  * eax = 14 - function number
494
  * eax = 14 - function number
495
Returned value:
495
Returned value:
496
  * eax = [xsize]*65536 + [ysize], where
496
  * eax = [xsize]*65536 + [ysize], where
497
  * xsize = x-coordinate of the right lower corner of the screen =
497
  * xsize = x-coordinate of the right lower corner of the screen =
498
            horizontal size - 1
498
            horizontal size - 1
499
  * ysize = y-coordinate of the right lower corner of the screen =
499
  * ysize = y-coordinate of the right lower corner of the screen =
500
            vertical size - 1
500
            vertical size - 1
501
Remarks:
501
Remarks:
502
  * See also subfunction 5 of function 48 - get sizes of
502
  * See also subfunction 5 of function 48 - get sizes of
503
    working area of the screen.
503
    working area of the screen.
504
 
504
 
505
======================================================================
505
======================================================================
506
== Function 15, subfunction 1 - set a size of the background image. ==
506
== Function 15, subfunction 1 - set a size of the background image. ==
507
======================================================================
507
======================================================================
508
Parameters:
508
Parameters:
509
  * eax = 15 - function number
509
  * eax = 15 - function number
510
  * ebx = 1 - subfunction number
510
  * ebx = 1 - subfunction number
511
  * ecx = width of the image
511
  * ecx = width of the image
512
  * edx = height of the image
512
  * edx = height of the image
513
Returned value:
513
Returned value:
514
  * function does not return value
514
  * function does not return value
515
Remarks:
515
Remarks:
516
  * Before calling subfunctions 2 and 5 you should call this function
516
  * Before calling subfunctions 2 and 5 you should call this function
517
    to set image size!
517
    to set image size!
518
  * For update of the screen (after completion of a series of commands
518
  * For update of the screen (after completion of a series of commands
519
    working with a background) call subfunction 3.
519
    working with a background) call subfunction 3.
520
  * There is a pair function for get size of the background image -
520
  * There is a pair function for get size of the background image -
521
    subfunction 1 of function 39.
521
    subfunction 1 of function 39.
522
 
522
 
523
======================================================================
523
======================================================================
524
=== Function 15, subfunction 2 - put pixel on the background image. ==
524
=== Function 15, subfunction 2 - put pixel on the background image. ==
525
======================================================================
525
======================================================================
526
Parameters:
526
Parameters:
527
  * eax = 15 - function number
527
  * eax = 15 - function number
528
  * ebx = 2 - subfunction number
528
  * ebx = 2 - subfunction number
529
  * ecx = offset
529
  * ecx = offset
530
  * edx = color of a pixel 0xRRGGBB
530
  * edx = color of a pixel 0xRRGGBB
531
Returned value:
531
Returned value:
532
  * function does not return value
532
  * function does not return value
533
Remarks:
533
Remarks:
534
  * Offset for a pixel with coordinates (x,y) is calculated as
534
  * Offset for a pixel with coordinates (x,y) is calculated as
535
    (x+y*xsize)*3.
535
    (x+y*xsize)*3.
536
  * If the given offset exceeds size set by subfunction 1,
536
  * If the given offset exceeds size set by subfunction 1,
537
    the call is ignored.
537
    the call is ignored.
538
  * For update of the screen (after completion of a series of commands
538
  * For update of the screen (after completion of a series of commands
539
    working with a background) call subfunction 3.
539
    working with a background) call subfunction 3.
540
  * There is a pair function for get pixel on the background image -
540
  * There is a pair function for get pixel on the background image -
541
    subfunction 2 of function 39.
541
    subfunction 2 of function 39.
542
 
542
 
543
======================================================================
543
======================================================================
544
=========== Function 15, subfunction 3 - redraw background. ==========
544
=========== Function 15, subfunction 3 - redraw background. ==========
545
======================================================================
545
======================================================================
546
Parameters:
546
Parameters:
547
  * eax = 15 - function number
547
  * eax = 15 - function number
548
  * ebx = 3 - subfunction number
548
  * ebx = 3 - subfunction number
549
Returned value:
549
Returned value:
550
  * function does not return value
550
  * function does not return value
551
 
551
 
552
======================================================================
552
======================================================================
553
== Function 15, subfunction 4 - set drawing mode for the background. =
553
== Function 15, subfunction 4 - set drawing mode for the background. =
554
======================================================================
554
======================================================================
555
Parameters:
555
Parameters:
556
  * eax = 15 - function number
556
  * eax = 15 - function number
557
  * ebx = 4 - subfunction number
557
  * ebx = 4 - subfunction number
558
  * ecx = drawing mode:
558
  * ecx = drawing mode:
559
    * 1 = tile
559
    * 1 = tile
560
    * 2 = stretch
560
    * 2 = stretch
561
Returned value:
561
Returned value:
562
  * function does not return value
562
  * function does not return value
563
Remarks:
563
Remarks:
564
  * For update of the screen (after completion of a series of commands
564
  * For update of the screen (after completion of a series of commands
565
    working with a background) call subfunction 3.
565
    working with a background) call subfunction 3.
566
  * There is a pair function for get drawing mode of the background -
566
  * There is a pair function for get drawing mode of the background -
567
    subfunction 4 of function 39.
567
    subfunction 4 of function 39.
568
 
568
 
569
======================================================================
569
======================================================================
570
===================== Function 15, subfunction 5 =====================
570
===================== Function 15, subfunction 5 =====================
571
============ Put block of pixels on the background image. ============
571
============ Put block of pixels on the background image. ============
572
======================================================================
572
======================================================================
573
Parameters:
573
Parameters:
574
  * eax = 15 - function number
574
  * eax = 15 - function number
575
  * ebx = 5 - subfunction number
575
  * ebx = 5 - subfunction number
576
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
576
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
577
  * edx = offset in data of the background image
577
  * edx = offset in data of the background image
578
  * esi = size of data in bytes = 3 * number of pixels
578
  * esi = size of data in bytes = 3 * number of pixels
579
Returned value:
579
Returned value:
580
  * function does not return value
580
  * function does not return value
581
Remarks:
581
Remarks:
582
  * Offset and size are not checked for correctness.
582
  * Offset and size are not checked for correctness.
583
  * Color of each pixel is stored as 3-bytes value BBGGRR.
583
  * Color of each pixel is stored as 3-bytes value BBGGRR.
584
  * Pixels of the background image are written sequentially
584
  * Pixels of the background image are written sequentially
585
    from left to right, from up to down.
585
    from left to right, from up to down.
586
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
586
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
587
  * For update of the screen (after completion of a series of commands
587
  * For update of the screen (after completion of a series of commands
588
    working with a background) call subfunction 3.
588
    working with a background) call subfunction 3.
589
 
589
 
590
======================================================================
590
======================================================================
591
===================== Function 15, subfunction 6 =====================
591
===================== Function 15, subfunction 6 =====================
592
======== Map background data to the address space of process. ========
592
======== Map background data to the address space of process. ========
593
======================================================================
593
======================================================================
594
Parameters:
594
Parameters:
595
  * eax = 15 - function number
595
  * eax = 15 - function number
596
  * ebx = 6 - subfunction number
596
  * ebx = 6 - subfunction number
597
Returned value:
597
Returned value:
598
  * eax = pointer to background data, 0 if error
598
  * eax = pointer to background data, 0 if error
599
Remarks:
599
Remarks:
600
  * Mapped data are available for read and write.
600
  * Mapped data are available for read and write.
601
  * Size of background data is 3*xsize*ysize. The system blocks
601
  * Size of background data is 3*xsize*ysize. The system blocks
602
    changes of background sizes while process works with mapped data.
602
    changes of background sizes while process works with mapped data.
603
  * Color of each pixel is stored as 3-bytes value BBGGRR.
603
  * Color of each pixel is stored as 3-bytes value BBGGRR.
604
  * Pixels of the background image are written sequentially
604
  * Pixels of the background image are written sequentially
605
    from left to right, from up to down.
605
    from left to right, from up to down.
606
 
606
 
607
======================================================================
607
======================================================================
608
===== Function 15, subfunction 7 - close mapped background data. =====
608
===== Function 15, subfunction 7 - close mapped background data. =====
609
======================================================================
609
======================================================================
610
Parameters:
610
Parameters:
611
  * eax = 15 - function number
611
  * eax = 15 - function number
612
  * ebx = 7 - subfunction number
612
  * ebx = 7 - subfunction number
613
  * ecx = pointer to mapped data
613
  * ecx = pointer to mapped data
614
Returned value:
614
Returned value:
615
  * eax = 1 - success, 0 - error
615
  * eax = 1 - success, 0 - error
616
 
616
 
617
======================================================================
617
======================================================================
618
===================== Function 15, subfunction 8 =====================
618
===================== Function 15, subfunction 8 =====================
619
============= Get coordinates of last draw the background ============
619
============= Get coordinates of last draw the background ============
620
======================================================================
620
======================================================================
621
Parameters:
621
Parameters:
622
  * eax = 15 - function number
622
  * eax = 15 - function number
623
  * ebx = 8 - subfunction number
623
  * ebx = 8 - subfunction number
624
Returned value:
624
Returned value:
625
  * eax = [left]*65536 + [right]
625
  * eax = [left]*65536 + [right]
626
  * ebx = [top]*65536 + [bottom]
626
  * ebx = [top]*65536 + [bottom]
627
Remarks:
627
Remarks:
628
  * (left,top) are coordinates of the left upper corner,
628
  * (left,top) are coordinates of the left upper corner,
629
    (right,bottom) are coordinates of the right lower one.
629
    (right,bottom) are coordinates of the right lower one.
630
  * For receiving more reliable information, call the function
630
  * For receiving more reliable information, call the function
631
    immediately after the event:
631
    immediately after the event:
632
             5 = kernel finished redrawing of the desktop background
632
             5 = kernel finished redrawing of the desktop background
633
 
633
 
634
======================================================================
634
======================================================================
635
===================== Function 15, subfunction 9 =====================
635
===================== Function 15, subfunction 9 =====================
636
============= Redraws a rectangular part of the background ===========
636
============= Redraws a rectangular part of the background ===========
637
======================================================================
637
======================================================================
638
Parameters:
638
Parameters:
639
  * eax = 15 - function number
639
  * eax = 15 - function number
640
  * ebx = 9 - subfunction number
640
  * ebx = 9 - subfunction number
641
  * ecx = [left]*65536 + [right]
641
  * ecx = [left]*65536 + [right]
642
  * edx = [top]*65536 + [bottom]
642
  * edx = [top]*65536 + [bottom]
643
Returned value:
643
Returned value:
644
  * function does not return value
644
  * function does not return value
645
Remarks:
645
Remarks:
646
  * (left,top) are coordinates of the left upper corner,
646
  * (left,top) are coordinates of the left upper corner,
647
    (right,bottom) are coordinates of the right lower one.
647
    (right,bottom) are coordinates of the right lower one.
648
  * If parameters are set incorrectly then background is not redrawn.
648
  * If parameters are set incorrectly then background is not redrawn.
649
 
649
 
650
======================================================================
650
======================================================================
651
=============== Function 16 - save ramdisk on a floppy. ==============
651
=============== Function 16 - save ramdisk on a floppy. ==============
652
======================================================================
652
======================================================================
653
Parameters:
653
Parameters:
654
  * eax = 16 - function number
654
  * eax = 16 - function number
655
  * ebx = 1 or ebx = 2 - on which floppy save
655
  * ebx = 1 or ebx = 2 - on which floppy save
656
Returned value:
656
Returned value:
657
  * eax = 0 - success
657
  * eax = 0 - success
658
  * eax = 1 - error
658
  * eax = 1 - error
659
 
659
 
660
======================================================================
660
======================================================================
661
======= Function 17 - get the identifier of the pressed button. ======
661
======= Function 17 - get the identifier of the pressed button. ======
662
======================================================================
662
======================================================================
663
Takes away the code of the pressed button from the buffer.
663
Takes away the code of the pressed button from the buffer.
664
Parameters:
664
Parameters:
665
  * eax = 17 - function number
665
  * eax = 17 - function number
666
Returned value:
666
Returned value:
667
  * if the buffer is empty, function returns eax=1
667
  * if the buffer is empty, function returns eax=1
668
  * if the buffer is not empty:
668
  * if the buffer is not empty:
669
    * high 24 bits of eax contain button identifier (in particular,
669
    * high 24 bits of eax contain button identifier (in particular,
670
      ah contains low byte of the identifier; if all buttons have
670
      ah contains low byte of the identifier; if all buttons have
671
      the identifier less than 256, ah is enough to distinguish)
671
      the identifier less than 256, ah is enough to distinguish)
672
    * al = 0 - the button was pressed with left mouse button
672
    * al = 0 - the button was pressed with left mouse button
673
    * al = bit corresponding to used mouse button otherwise
673
    * al = bit corresponding to used mouse button otherwise
674
Remarks:
674
Remarks:
675
  * "Buffer" keeps only one button, at pressing the new button the
675
  * "Buffer" keeps only one button, at pressing the new button the
676
    information about old is lost.
676
    information about old is lost.
677
  * The call of this function by an application with inactive window
677
  * The call of this function by an application with inactive window
678
    will return answer "buffer is empty".
678
    will return answer "buffer is empty".
679
  * Returned value for al corresponds to the state of mouse buttons
679
  * Returned value for al corresponds to the state of mouse buttons
680
    as in subfunction 2 of function 37 at the beginning
680
    as in subfunction 2 of function 37 at the beginning
681
    of button press, excluding lower bit, which is cleared.
681
    of button press, excluding lower bit, which is cleared.
682
 
682
 
683
======================================================================
683
======================================================================
684
===================== Function 18, subfunction 1 =====================
684
===================== Function 18, subfunction 1 =====================
685
============= Make deactive the window of the given thread. ==========
685
============= Make deactive the window of the given thread. ==========
686
======================================================================
686
======================================================================
687
Parameters:
687
Parameters:
688
  * eax = 18 - function number
688
  * eax = 18 - function number
689
  * ebx = 1 - subfunction number
689
  * ebx = 1 - subfunction number
690
  * ecx = number of the thread slot
690
  * ecx = number of the thread slot
691
Returned value:
691
Returned value:
692
  * function does not return value
692
  * function does not return value
693
 
693
 
694
======================================================================
694
======================================================================
695
= Function 18, subfunction 2 - terminate process/thread by the slot. =
695
= Function 18, subfunction 2 - terminate process/thread by the slot. =
696
======================================================================
696
======================================================================
697
Parameters:
697
Parameters:
698
  * eax = 18 - function number
698
  * eax = 18 - function number
699
  * ebx = 2 - subfunction number
699
  * ebx = 2 - subfunction number
700
  * ecx = number of the slot of process/thread
700
  * ecx = number of the slot of process/thread
701
Returned value:
701
Returned value:
702
  * function does not return value
702
  * function does not return value
703
Remarks:
703
Remarks:
704
  * It is impossible to terminate system thread OS/IDLE (with
704
  * It is impossible to terminate system thread OS/IDLE (with
705
    number of the slot 1),
705
    number of the slot 1),
706
    it is possible to terminate any normal process/thread.
706
    it is possible to terminate any normal process/thread.
707
  * See also subfunction 18 - terminate
707
  * See also subfunction 18 - terminate
708
    process/thread by the identifier.
708
    process/thread by the identifier.
709
 
709
 
710
======================================================================
710
======================================================================
711
===================== Function 18, subfunction 3 =====================
711
===================== Function 18, subfunction 3 =====================
712
============= Make active the window of the given thread. ============
712
============= Make active the window of the given thread. ============
713
======================================================================
713
======================================================================
714
Parameters:
714
Parameters:
715
  * eax = 18 - function number
715
  * eax = 18 - function number
716
  * ebx = 3 - subfunction number
716
  * ebx = 3 - subfunction number
717
  * ecx = number of the thread slot
717
  * ecx = number of the thread slot
718
Returned value:
718
Returned value:
719
  * function does not return value
719
  * function does not return value
720
Remarks:
720
Remarks:
721
  * If correct, but nonexistent slot is given,
721
  * If correct, but nonexistent slot is given,
722
    some window is made active.
722
    some window is made active.
723
  * To find out, which window is active, use subfunction 7.
723
  * To find out, which window is active, use subfunction 7.
724
 
724
 
725
======================================================================
725
======================================================================
726
===================== Function 18, subfunction 4 =====================
726
===================== Function 18, subfunction 4 =====================
727
=========== Get counter of idle time units per one second. ===========
727
=========== Get counter of idle time units per one second. ===========
728
======================================================================
728
======================================================================
729
Idle time units are units, in which the processor stands idle
729
Idle time units are units, in which the processor stands idle
730
in waiting for interrupt (in the command 'hlt').
730
in waiting for interrupt (in the command 'hlt').
731
 
731
 
732
Parameters:
732
Parameters:
733
  * eax = 18 - function number
733
  * eax = 18 - function number
734
  * ebx = 4 - subfunction number
734
  * ebx = 4 - subfunction number
735
Returned value:
735
Returned value:
736
  * eax = value of the counter of idle time units per one second
736
  * eax = value of the counter of idle time units per one second
737
 
737
 
738
======================================================================
738
======================================================================
739
========== Function 18, subfunction 5 - get CPU clock rate. ==========
739
========== Function 18, subfunction 5 - get CPU clock rate. ==========
740
======================================================================
740
======================================================================
741
Parameters:
741
Parameters:
742
  * eax = 18 - function number
742
  * eax = 18 - function number
743
  * ebx = 5 - subfunction number
743
  * ebx = 5 - subfunction number
744
Returned value:
744
Returned value:
745
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
745
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
746
 
746
 
747
======================================================================
747
======================================================================
748
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
748
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
749
======================================================================
749
======================================================================
750
Parameters:
750
Parameters:
751
  * eax = 18 - function number
751
  * eax = 18 - function number
752
  * ebx = 6 - subfunction number
752
  * ebx = 6 - subfunction number
753
  * ecx = pointer to the full path to file
753
  * ecx = pointer to the full path to file
754
    (for example, "/hd0/1/kolibri/kolibri.img")
754
    (for example, "/hd0/1/kolibri/kolibri.img")
755
Returned value:
755
Returned value:
756
  * eax = 0 - success
756
  * eax = 0 - success
757
  * else eax = error code of the file system
757
  * else eax = error code of the file system
758
Remarks:
758
Remarks:
759
  * All folders in the given path must exist, otherwise function
759
  * All folders in the given path must exist, otherwise function
760
    returns value 5, "file not found".
760
    returns value 5, "file not found".
761
 
761
 
762
======================================================================
762
======================================================================
763
=========== Function 18, subfunction 7 - get active window. ==========
763
=========== Function 18, subfunction 7 - get active window. ==========
764
======================================================================
764
======================================================================
765
Parameters:
765
Parameters:
766
  * eax = 18 - function number
766
  * eax = 18 - function number
767
  * ebx = 7 - subfunction number
767
  * ebx = 7 - subfunction number
768
Returned value:
768
Returned value:
769
  * eax = number of the active window
769
  * eax = number of the active window
770
    (number of the slot of the thread with active window)
770
    (number of the slot of the thread with active window)
771
Remarks:
771
Remarks:
772
  * Active window is at the top of the window stack and receives
772
  * Active window is at the top of the window stack and receives
773
    messages on all keyboard input.
773
    messages on all keyboard input.
774
  * To make a window active, use subfunction 3.
774
  * To make a window active, use subfunction 3.
775
 
775
 
776
======================================================================
776
======================================================================
777
== Function 18, subfunction 8 - disable/enable the internal speaker. =
777
== Function 18, subfunction 8 - disable/enable the internal speaker. =
778
======================================================================
778
======================================================================
779
If speaker sound is disabled, all calls to subfunction 55 of
779
If speaker sound is disabled, all calls to subfunction 55 of
780
function 55 are ignored. If speaker sound is enabled,
780
function 55 are ignored. If speaker sound is enabled,
781
they are routed on builtin speaker.
781
they are routed on builtin speaker.
782
 
782
 
783
------------------- Subsubfunction 1 - get status. -------------------
783
------------------- Subsubfunction 1 - get status. -------------------
784
Parameters:
784
Parameters:
785
  * eax = 18 - function number
785
  * eax = 18 - function number
786
  * ebx = 8 - subfunction number
786
  * ebx = 8 - subfunction number
787
  * ecx = 1 - number of the subsubfunction
787
  * ecx = 1 - number of the subsubfunction
788
Returned value:
788
Returned value:
789
  * eax = 0 - speaker sound is enabled; 1 - disabled
789
  * eax = 0 - speaker sound is enabled; 1 - disabled
790
 
790
 
791
----------------- Subsubfunction 2 - toggle status. ------------------
791
----------------- Subsubfunction 2 - toggle status. ------------------
792
Toggles states of disable/enable.
792
Toggles states of disable/enable.
793
Parameters:
793
Parameters:
794
  * eax = 18 - function number
794
  * eax = 18 - function number
795
  * ebx = 8 - subfunction number
795
  * ebx = 8 - subfunction number
796
  * ecx = 2 - number of the subsubfunction
796
  * ecx = 2 - number of the subsubfunction
797
Returned value:
797
Returned value:
798
  * function does not return value
798
  * function does not return value
799
 
799
 
800
======================================================================
800
======================================================================
801
== Function 18, subfunction 9 - system shutdown with the parameter. ==
801
== Function 18, subfunction 9 - system shutdown with the parameter. ==
802
======================================================================
802
======================================================================
803
Parameters:
803
Parameters:
804
  * eax = 18 - function number
804
  * eax = 18 - function number
805
  * ebx = 9 - subfunction number
805
  * ebx = 9 - subfunction number
806
  * ecx = parameter:
806
  * ecx = parameter:
807
    * 2 = turn off computer
807
    * 2 = turn off computer
808
    * 3 = reboot computer
808
    * 3 = reboot computer
809
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
809
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
810
Returned value:
810
Returned value:
811
  * at incorrect ecx the registers do not change (i.e. eax=18)
811
  * at incorrect ecx the registers do not change (i.e. eax=18)
812
  * by correct call function always returns eax=0
812
  * by correct call function always returns eax=0
813
    as the tag of success
813
    as the tag of success
814
Remarks:
814
Remarks:
815
  * Do not rely on returned value by incorrect call, it can be
815
  * Do not rely on returned value by incorrect call, it can be
816
    changed in future versions of the kernel.
816
    changed in future versions of the kernel.
817
 
817
 
818
======================================================================
818
======================================================================
819
======= Function 18, subfunction 10 - minimize topmost window. =======
819
======= Function 18, subfunction 10 - minimize topmost window. =======
820
======================================================================
820
======================================================================
821
Minimizes the topmost (active) window.
821
Minimizes the topmost (active) window.
822
Parameters:
822
Parameters:
823
  * eax = 18 - function number
823
  * eax = 18 - function number
824
  * ebx = 10 - subfunction number
824
  * ebx = 10 - subfunction number
825
Returned value:
825
Returned value:
826
  * function does not return value
826
  * function does not return value
827
Remarks:
827
Remarks:
828
  * The minimized window from the point of view of function 9
828
  * The minimized window from the point of view of function 9
829
    keeps position and sizes.
829
    keeps position and sizes.
830
  * Restoring of an application window occurs at its activation by
830
  * Restoring of an application window occurs at its activation by
831
    subfunction 3.
831
    subfunction 3.
832
  * Usually there is no necessity to minimize/restore a window
832
  * Usually there is no necessity to minimize/restore a window
833
    explicitly: minimization of a window is carried out by the system
833
    explicitly: minimization of a window is carried out by the system
834
    at pressing the minimization button (for skinned windows
834
    at pressing the minimization button (for skinned windows
835
    it is defined automatically by function 0,
835
    it is defined automatically by function 0,
836
    for other windows it can be defined manually by function 8),
836
    for other windows it can be defined manually by function 8),
837
    restore of a window is done by the application '@taskbar'.
837
    restore of a window is done by the application '@taskbar'.
838
 
838
 
839
======================================================================
839
======================================================================
840
 Function 18, subfunction 11 - get information on the disk subsystem.
840
 Function 18, subfunction 11 - get information on the disk subsystem.
841
======================================================================
841
======================================================================
842
Parameters:
842
Parameters:
843
  * eax = 18 - function number
843
  * eax = 18 - function number
844
  * ebx = 11 - subfunction number
844
  * ebx = 11 - subfunction number
845
  * ecx = type of the table:
845
  * ecx = type of the table:
846
    * 1 = short version, 16 bytes
846
    * 1 = short version, 16 bytes
847
  * edx = pointer to the buffer (in the application) for the table
847
  * edx = pointer to the buffer (in the application) for the table
848
Returned value:
848
Returned value:
849
  * function does not return value
849
  * function does not return value
850
Format of the table: short version:
850
Format of the table: short version:
851
  * +0: byte: information about FDD's (drives for floppies),
851
  * +0: byte: information about FDD's (drives for floppies),
852
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
852
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
853
    of the second regarding to the following list:
853
    of the second regarding to the following list:
854
    * 0 = there is no drive
854
    * 0 = there is no drive
855
    * 1 = 360Kb, 5.25''
855
    * 1 = 360Kb, 5.25''
856
    * 2 = 1.2Mb, 5.25''
856
    * 2 = 1.2Mb, 5.25''
857
    * 3 = 720Kb, 3.5''
857
    * 3 = 720Kb, 3.5''
858
    * 4 = 1.44Mb, 3.5''
858
    * 4 = 1.44Mb, 3.5''
859
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
859
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
860
    For example, for the standard configuration from one 1.44-drive
860
    For example, for the standard configuration from one 1.44-drive
861
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
861
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
862
    the value is 24h.
862
    the value is 24h.
863
    
863
    
864
  First IDE controller:
864
  First IDE controller:
865
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
865
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
866
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
866
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
867
    * 0 = device not found
867
    * 0 = device not found
868
    * 1 = hard drive
868
    * 1 = hard drive
869
    * 2 = CD-drive
869
    * 2 = CD-drive
870
    For example, in the case HD on IDE0 and CD on IDE2
870
    For example, in the case HD on IDE0 and CD on IDE2
871
    this field contains 48h.
871
    this field contains 48h.
872
  * +2: 4 db: number of the retrieved partitions on hard disks
872
  * +2: 4 db: number of the retrieved partitions on hard disks
873
    at accordingly IDE0,...,IDE3.
873
    at accordingly IDE0,...,IDE3.
874
    
874
    
875
  Second IDE controller:
875
  Second IDE controller:
876
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
876
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
877
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
877
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
878
    * 0 = device not found
878
    * 0 = device not found
879
    * 1 = hard drive
879
    * 1 = hard drive
880
    * 2 = CD-drive
880
    * 2 = CD-drive
881
    For example, in the case HD on IDE4 and CD on IDE6
881
    For example, in the case HD on IDE4 and CD on IDE6
882
    this field contains 48h.
882
    this field contains 48h.
883
  * +7: 4 db: number of the retrieved partitions on hard disks
883
  * +7: 4 db: number of the retrieved partitions on hard disks
884
    at accordingly IDE4,...,IDE7.
884
    at accordingly IDE4,...,IDE7.
885
 
885
 
886
  Third IDE controller:
886
  Third IDE controller:
887
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
887
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
888
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
888
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
889
    * 0 = device not found
889
    * 0 = device not found
890
    * 1 = hard drive
890
    * 1 = hard drive
891
    * 2 = CD-drive
891
    * 2 = CD-drive
892
    For example, in the case HD on IDE8 and CD on IDE10
892
    For example, in the case HD on IDE8 and CD on IDE10
893
    this field contains 48h.
893
    this field contains 48h.
894
  * +12: 4 db: number of the retrieved partitions on hard disks
894
  * +12: 4 db: number of the retrieved partitions on hard disks
895
    at accordingly IDE8,...,IDE11.   
895
    at accordingly IDE8,...,IDE11.   
896
    
896
    
897
    If the hard disk on IDEx is absent, appropriate byte is zero,
897
    If the hard disk on IDEx is absent, appropriate byte is zero,
898
    otherwise it shows number of the recognized partitions, which
898
    otherwise it shows number of the recognized partitions, which
899
    can be not presented (if the drive is not formatted or if
899
    can be not presented (if the drive is not formatted or if
900
    the file system is not supported). Current version of the kernel
900
    the file system is not supported). Current version of the kernel
901
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
901
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
902
 
902
 
903
Remarks:
903
Remarks:
904
  * The table can be used for obtaining the information about
904
  * The table can be used for obtaining the information about
905
    available devices.
905
    available devices.
906
 
906
 
907
======================================================================
907
======================================================================
908
========== Function 18, subfunction 13 - get kernel version. =========
908
========== Function 18, subfunction 13 - get kernel version. =========
909
======================================================================
909
======================================================================
910
Parameters:
910
Parameters:
911
  * eax = 18 - function number
911
  * eax = 18 - function number
912
  * ebx = 13 - subfunction number
912
  * ebx = 13 - subfunction number
913
  * ecx = pointer to the buffer (not less than 16 bytes), where
913
  * ecx = pointer to the buffer (not less than 16 bytes), where
914
    the information will be placed
914
    the information will be placed
915
Returned value:
915
Returned value:
916
  * function does not return value
916
  * function does not return value
917
Structure of the buffer:
917
Structure of the buffer:
918
db a,b,c,d for version a.b.c.d
918
db a,b,c,d for version a.b.c.d
919
db 0: reserved
919
db 0: reserved
920
dd REV - kernel SVN revision number
920
dd REV - kernel SVN revision number
921
For Kolibri 0.7.7.0+ kernel:
921
For Kolibri 0.7.7.0+ kernel:
922
db 0,7,7,0
922
db 0,7,7,0
923
db 0
923
db 0
924
dd 1675
924
dd 1675
925
 
925
 
926
======================================================================
926
======================================================================
927
======= Function 18, subfunction 14 - wait for screen retrace. =======
927
======= Function 18, subfunction 14 - wait for screen retrace. =======
928
======================================================================
928
======================================================================
929
Waits for the beginning of retrace of the scanning ray of the screen
929
Waits for the beginning of retrace of the scanning ray of the screen
930
monitor.
930
monitor.
931
Parameters:
931
Parameters:
932
  * eax = 18 - function number
932
  * eax = 18 - function number
933
  * ebx = 14 - subfunction number
933
  * ebx = 14 - subfunction number
934
Returned value:
934
Returned value:
935
  * eax = 0 as the tag of success
935
  * eax = 0 as the tag of success
936
Remarks:
936
Remarks:
937
  * Function is intended only for active high-efficiency graphics
937
  * Function is intended only for active high-efficiency graphics
938
    applications; is used for smooth output of a graphics.
938
    applications; is used for smooth output of a graphics.
939
 
939
 
940
======================================================================
940
======================================================================
941
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
941
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
942
======================================================================
942
======================================================================
943
Parameters:
943
Parameters:
944
  * eax = 18 - function number
944
  * eax = 18 - function number
945
  * ebx = 15 - subfunction number
945
  * ebx = 15 - subfunction number
946
Returned value:
946
Returned value:
947
  * eax = 0 as the tag of success
947
  * eax = 0 as the tag of success
948
 
948
 
949
======================================================================
949
======================================================================
950
========= Function 18, subfunction 16 - get size of free RAM. ========
950
========= Function 18, subfunction 16 - get size of free RAM. ========
951
======================================================================
951
======================================================================
952
Parameters:
952
Parameters:
953
  * eax = 18 - function number
953
  * eax = 18 - function number
954
  * ebx = 16 - subfunction number
954
  * ebx = 16 - subfunction number
955
Returned value:
955
Returned value:
956
  * eax = size of free memory in kilobytes
956
  * eax = size of free memory in kilobytes
957
 
957
 
958
======================================================================
958
======================================================================
959
======== Function 18, subfunction 17 - get full amount of RAM. =======
959
======== Function 18, subfunction 17 - get full amount of RAM. =======
960
======================================================================
960
======================================================================
961
Parameters:
961
Parameters:
962
  * eax = 18 - function number
962
  * eax = 18 - function number
963
  * ebx = 17 - subfunction number
963
  * ebx = 17 - subfunction number
964
Returned value:
964
Returned value:
965
  * eax = total size of existing memory in kilobytes
965
  * eax = total size of existing memory in kilobytes
966
 
966
 
967
======================================================================
967
======================================================================
968
===================== Function 18, subfunction 18 ====================
968
===================== Function 18, subfunction 18 ====================
969
============= Terminate process/thread by the identifier. ============
969
============= Terminate process/thread by the identifier. ============
970
======================================================================
970
======================================================================
971
Parameters:
971
Parameters:
972
  * eax = 18 - function number
972
  * eax = 18 - function number
973
  * ebx = 18 - subfunction number
973
  * ebx = 18 - subfunction number
974
  * ecx = identifer of process/thread (PID/TID)
974
  * ecx = identifer of process/thread (PID/TID)
975
Returned value:
975
Returned value:
976
  * eax = 0 - success
976
  * eax = 0 - success
977
  * eax = -1 - error (process is not found or is system)
977
  * eax = -1 - error (process is not found or is system)
978
Remarks:
978
Remarks:
979
  * It is impossible to terminate system thread OS/IDLE (identifier
979
  * It is impossible to terminate system thread OS/IDLE (identifier
980
    1), it is possible to terminate any normal process/thread.
980
    1), it is possible to terminate any normal process/thread.
981
  * See also subfunction 2 - terminate
981
  * See also subfunction 2 - terminate
982
    process/thread by given slot.
982
    process/thread by given slot.
983
 
983
 
984
======================================================================
984
======================================================================
985
======== Function 18, subfunction 19 - get/set mouse features. =======
985
======== Function 18, subfunction 19 - get/set mouse features. =======
986
======================================================================
986
======================================================================
987
 
987
 
988
---------------- Subsubfunction 0 - get mouse speed. -----------------
988
---------------- Subsubfunction 0 - get mouse speed. -----------------
989
Parameters:
989
Parameters:
990
  * eax = 18 - function number
990
  * eax = 18 - function number
991
  * ebx = 19 - subfunction number
991
  * ebx = 19 - subfunction number
992
  * ecx = 0 - subsubfunction number
992
  * ecx = 0 - subsubfunction number
993
Returned value:
993
Returned value:
994
  * eax = current mouse speed
994
  * eax = current mouse speed
995
 
995
 
996
---------------- Subsubfunction 1 - set mouse speed. -----------------
996
---------------- Subsubfunction 1 - set mouse speed. -----------------
997
Parameters:
997
Parameters:
998
  * eax = 18 - function number
998
  * eax = 18 - function number
999
  * ebx = 19 - subfunction number
999
  * ebx = 19 - subfunction number
1000
  * ecx = 1 - subsubfunction number
1000
  * ecx = 1 - subsubfunction number
1001
  * edx = new value for speed
1001
  * edx = new value for speed
1002
Returned value:
1002
Returned value:
1003
  * function does not return value
1003
  * function does not return value
-
 
1004
 
-
 
1005
Remark: recommended speed = 1, 0 = lock the cursor.
1004
 
1006
 
1005
---------------- Subsubfunction 2 - get mouse delay. -----------------
1007
------------- Subsubfunction 2 - get mouse acceleration. -------------
1006
Parameters:
1008
Parameters:
1007
  * eax = 18 - function number
1009
  * eax = 18 - function number
1008
  * ebx = 19 - subfunction number
1010
  * ebx = 19 - subfunction number
1009
  * ecx = 2 - subsubfunction number
1011
  * ecx = 2 - subsubfunction number
1010
Returned value:
1012
Returned value:
1011
  * eax = current mouse delay
1013
  * eax = 2 - fierce, 1 - soft, 0 - off
1012
 
1014
 
1013
---------------- Subsubfunction 3 - set mouse delay. -----------------
1015
------------- Subsubfunction 3 - set mouse acceleration. -------------
1014
Parameters:
1016
Parameters:
1015
  * eax = 18 - function number
1017
  * eax = 18 - function number
1016
  * ebx = 19 - subfunction number
1018
  * ebx = 19 - subfunction number
1017
  * ecx = 3 - subsubfunction number
1019
  * ecx = 3 - subsubfunction number
1018
  * edx = new value for mouse delay
1020
  * edx = 2 - fierce, 1 - soft, 0 - off
1019
Returned value:
1021
Returned value:
1020
  * function does not return value
1022
  * function does not return value
1021
 
1023
 
1022
----------- Subsubfunction 4 - set mouse pointer position. -----------
1024
----------- Subsubfunction 4 - set mouse pointer position. -----------
1023
Parameters:
1025
Parameters:
1024
  * eax = 18 - function number
1026
  * eax = 18 - function number
1025
  * ebx = 19 - subfunction number
1027
  * ebx = 19 - subfunction number
1026
  * ecx = 4 - subsubfunction number
1028
  * ecx = 4 - subsubfunction number
1027
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1029
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1028
Returned value:
1030
Returned value:
1029
  * function does not return value
1031
  * function does not return value
1030
 
1032
 
1031
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1033
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1032
Parameters:
1034
Parameters:
1033
  * eax = 18 - function number
1035
  * eax = 18 - function number
1034
  * ebx = 19 - subfunction number
1036
  * ebx = 19 - subfunction number
1035
  * ecx = 5 - subsubfunction number
1037
  * ecx = 5 - subsubfunction number
1036
  * edx = information about emulated state of mouse buttons:
1038
  * edx = information about emulated state of mouse buttons:
1037
    (same as return value in subfunction 2 of function 37)
1039
    (same as return value in subfunction 2 of function 37)
1038
    * bit 0 is set = left button is pressed
1040
    * bit 0 is set = left button is pressed
1039
    * bit 1 is set = right button is pressed
1041
    * bit 1 is set = right button is pressed
1040
    * bit 2 is set = middle button is pressed
1042
    * bit 2 is set = middle button is pressed
1041
    * bit 3 is set = 4th button is pressed
1043
    * bit 3 is set = 4th button is pressed
1042
    * bit 4 is set = 5th button is pressed
1044
    * bit 4 is set = 5th button is pressed
1043
Returned value:
1045
Returned value:
1044
  * function does not return value
1046
  * function does not return value
1045
 
1047
 
1046
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1048
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1047
Parameters:
1049
Parameters:
1048
  * eax = 18 - function number
1050
  * eax = 18 - function number
1049
  * ebx = 19 - subfunction number
1051
  * ebx = 19 - subfunction number
1050
  * ecx = 6 - subsubfunction number
1052
  * ecx = 6 - subsubfunction number
1051
Returned value:
1053
Returned value:
1052
  * eax = current doubleclick delay (100 = 1 second)
1054
  * eax = current doubleclick delay (100 = 1 second)
1053
 
1055
 
1054
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1056
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1055
Parameters:
1057
Parameters:
1056
  * eax = 18 - function number
1058
  * eax = 18 - function number
1057
  * ebx = 19 - subfunction number
1059
  * ebx = 19 - subfunction number
1058
  * ecx = 7 - subsubfunction number
1060
  * ecx = 7 - subsubfunction number
1059
  * dl  = new value for doubleclick delay (100 = 1 second)
1061
  * dl  = new value for doubleclick delay (100 = 1 second)
1060
Returned value:
1062
Returned value:
1061
  * function does not return value
1063
  * function does not return value
1062
 
-
 
1063
Remarks:
-
 
1064
  * It is recommended to set speed of the mouse (in subsubfunction 1)
-
 
1065
    from 1 up to 9. The installed value is not inspected by the kernel
-
 
1066
    code, so set it carefully, at incorrect value the cursor
-
 
1067
    can "freeze". Speed of the mouse can be regulated through the
-
 
1068
    application SETUP.
-
 
1069
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
-
 
1070
    value is not handled by COM mice. At the very large values the
-
 
1071
    movement of the mouse on 1 pixel is impossible and the cursor will
-
 
1072
    jump on the value of installed speed (subsubfunction 1). The
-
 
1073
    installed value is not inspected by the kernel code.
1064
 
1074
    Mouse delay can be regulated through the application SETUP.
-
 
1075
  * The subsubfunction 4 does not check the passed value. Before
-
 
1076
    its call find out current screen resolution (with function 14)
-
 
1077
    and check that the value of position is inside the limits of the
-
 
1078
    screen.
1065
Remark: mouse settings can be modified in the application mouse_cfg.
1079
 
1066
 
1080
======================================================================
1067
======================================================================
1081
======== Function 18, subfunction 20 - get information on RAM. =======
1068
======== Function 18, subfunction 20 - get information on RAM. =======
1082
======================================================================
1069
======================================================================
1083
Parameters:
1070
Parameters:
1084
  * eax = 18 - function number
1071
  * eax = 18 - function number
1085
  * ebx = 20 - subfunction number
1072
  * ebx = 20 - subfunction number
1086
  * ecx = pointer to the buffer for information (36 bytes)
1073
  * ecx = pointer to the buffer for information (36 bytes)
1087
Returned value:
1074
Returned value:
1088
  * eax = total size of existing RAM in pages
1075
  * eax = total size of existing RAM in pages
1089
    or -1 if error has occured
1076
    or -1 if error has occured
1090
  * buffer pointed to by ecx contains the following information:
1077
  * buffer pointed to by ecx contains the following information:
1091
    * +0:  dword: total size of existing RAM in pages
1078
    * +0:  dword: total size of existing RAM in pages
1092
    * +4:  dword: size of free RAM in pages
1079
    * +4:  dword: size of free RAM in pages
1093
    * +8:  dword: number of page faults (exceptions #PF)
1080
    * +8:  dword: number of page faults (exceptions #PF)
1094
                 in applications
1081
                 in applications
1095
    * +12: dword: size of kernel heap in bytes
1082
    * +12: dword: size of kernel heap in bytes
1096
    * +16: dword: free in kernel heap in bytes
1083
    * +16: dword: free in kernel heap in bytes
1097
    * +20: dword: total number of memory blocks in kernel heap
1084
    * +20: dword: total number of memory blocks in kernel heap
1098
    * +24: dword: number of free memory blocks in kernel heap
1085
    * +24: dword: number of free memory blocks in kernel heap
1099
    * +28: dword: size of maximum free block in kernel heap
1086
    * +28: dword: size of maximum free block in kernel heap
1100
                 (reserved)
1087
                 (reserved)
1101
    * +32: dword: size of maximum allocated block in kernel heap
1088
    * +32: dword: size of maximum allocated block in kernel heap
1102
                 (reserved)
1089
                 (reserved)
1103
 
1090
 
1104
======================================================================
1091
======================================================================
1105
===================== Function 18, subfunction 21 ====================
1092
===================== Function 18, subfunction 21 ====================
1106
======== Get slot number of process/thread by the identifier. ========
1093
======== Get slot number of process/thread by the identifier. ========
1107
======================================================================
1094
======================================================================
1108
Parameters:
1095
Parameters:
1109
  * eax = 18 - function number
1096
  * eax = 18 - function number
1110
  * ebx = 21 - subfunction number
1097
  * ebx = 21 - subfunction number
1111
  * ecx = identifer of process/thread (PID/TID)
1098
  * ecx = identifer of process/thread (PID/TID)
1112
Returned value:
1099
Returned value:
1113
  * eax = 0 - error (invalid identifier)
1100
  * eax = 0 - error (invalid identifier)
1114
  * otherwise eax = slot number
1101
  * otherwise eax = slot number
1115
 
1102
 
1116
======================================================================
1103
======================================================================
1117
===================== Function 18, subfunction 22 ====================
1104
===================== Function 18, subfunction 22 ====================
1118
============== Operations with window of another thread. =============
1105
============== Operations with window of another thread. =============
1119
======================================================================
1106
======================================================================
1120
Parameters:
1107
Parameters:
1121
  * eax = 18 - function number
1108
  * eax = 18 - function number
1122
  * ebx = 22 - subfunction number
1109
  * ebx = 22 - subfunction number
1123
  * ecx = operation type:
1110
  * ecx = operation type:
1124
    * 0 = minimize window of the thread with given slot number
1111
    * 0 = minimize window of the thread with given slot number
1125
    * 1 = minimize window of the thread with given identifier
1112
    * 1 = minimize window of the thread with given identifier
1126
    * 2 = restore window of the thread with given slot number
1113
    * 2 = restore window of the thread with given slot number
1127
    * 3 = restore window of the thread with given identifier
1114
    * 3 = restore window of the thread with given identifier
1128
  * edx = parameter (slot number or PID/TID)
1115
  * edx = parameter (slot number or PID/TID)
1129
Returned value:
1116
Returned value:
1130
  * eax = 0 - success
1117
  * eax = 0 - success
1131
  * eax = -1 - error (invalid identifier)
1118
  * eax = -1 - error (invalid identifier)
1132
Remarks:
1119
Remarks:
1133
  * The thread can minimize its window with subfunction 10.
1120
  * The thread can minimize its window with subfunction 10.
1134
  * One can restore and activate window simultaneously with
1121
  * One can restore and activate window simultaneously with
1135
    subfunction 3 (which requires slot number).
1122
    subfunction 3 (which requires slot number).
1136
 
1123
 
1137
======================================================================
1124
======================================================================
1138
======== Function 18, subfunction 23 - minimize all windows. ==========
1125
======== Function 18, subfunction 23 - minimize all windows. ==========
1139
======================================================================
1126
======================================================================
1140
Parameters:
1127
Parameters:
1141
  * eax = 18 - function number
1128
  * eax = 18 - function number
1142
  * ebx = 23 - subfunction number
1129
  * ebx = 23 - subfunction number
1143
Returned value:
1130
Returned value:
1144
  * eax = 0 - all windows have been minimized before a function call
1131
  * eax = 0 - all windows have been minimized before a function call
1145
  * eax = N - number of windows minimized from function
1132
  * eax = N - number of windows minimized from function
1146
Remarks:
1133
Remarks:
1147
  * Window of special thread (name begin to symbol @) is not minimize.
1134
  * Window of special thread (name begin to symbol @) is not minimize.
1148
 
1135
 
1149
======================================================================
1136
======================================================================
1150
======= Function 18, subfunction 24 - set limits of screen. ==========
1137
======= Function 18, subfunction 24 - set limits of screen. ==========
1151
======================================================================
1138
======================================================================
1152
Parameters:
1139
Parameters:
1153
  * eax = 18 - function number
1140
  * eax = 18 - function number
1154
  * ebx = 24 - subfunction number
1141
  * ebx = 24 - subfunction number
1155
  * ecx = new X size
1142
  * ecx = new X size
1156
  * edx = new Y size
1143
  * edx = new Y size
1157
Returned value:
1144
Returned value:
1158
  * function does not return value
1145
  * function does not return value
1159
Remarks:
1146
Remarks:
1160
  * The function does not change the physical size of the video mode.
1147
  * The function does not change the physical size of the video mode.
1161
    It is designed for non-standard displays which display the image
1148
    It is designed for non-standard displays which display the image
1162
    partially.
1149
    partially.
1163
  * The sizes specified in the function should not exceed the sizes
1150
  * The sizes specified in the function should not exceed the sizes
1164
    of the current video mode, otherwise the function will not change
1151
    of the current video mode, otherwise the function will not change
1165
    anything.
1152
    anything.
1166
 
1153
 
1167
======================================================================
1154
======================================================================
1168
===================== Function 18, subfunction 25 ====================
1155
===================== Function 18, subfunction 25 ====================
1169
===== Control position of the window relative to other windows. ======
1156
===== Control position of the window relative to other windows. ======
1170
======================================================================
1157
======================================================================
1171
 
1158
 
1172
------------- Subsubfunction 1 - get position  -----------------------
1159
------------- Subsubfunction 1 - get position  -----------------------
1173
Parameters:
1160
Parameters:
1174
  * eax = 18 - function number
1161
  * eax = 18 - function number
1175
  * ebx = 25 - subfunction number
1162
  * ebx = 25 - subfunction number
1176
  * ecx = 1 - subsubfunction number
1163
  * ecx = 1 - subsubfunction number
1177
  * edx = -1(for current window) or PID application
1164
  * edx = -1(for current window) or PID application
1178
Returned value:
1165
Returned value:
1179
  * eax = one of the constants window position
1166
  * eax = one of the constants window position
1180
 
1167
 
1181
------------- Subsubfunction 2 - set position  -----------------------
1168
------------- Subsubfunction 2 - set position  -----------------------
1182
Parameters:
1169
Parameters:
1183
  * eax = 18 - function number
1170
  * eax = 18 - function number
1184
  * ebx = 25 - subfunction number
1171
  * ebx = 25 - subfunction number
1185
  * ecx = 2 - subsubfunction number
1172
  * ecx = 2 - subsubfunction number
1186
  * edx = -1(for current window) or PID application
1173
  * edx = -1(for current window) or PID application
1187
  * esi = new window position (one of the constants below)
1174
  * esi = new window position (one of the constants below)
1188
Returned value:
1175
Returned value:
1189
  * eax = 0 - error
1176
  * eax = 0 - error
1190
  * eax = 1 - success
1177
  * eax = 1 - success
1191
 
1178
 
1192
Constant position of the window relative to other windows:
1179
Constant position of the window relative to other windows:
1193
 ZPOS_DESKTOP     = -2 - on the background
1180
 ZPOS_DESKTOP     = -2 - on the background
1194
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1181
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1195
 ZPOS_NORMAL      = 0  - normal
1182
 ZPOS_NORMAL      = 0  - normal
1196
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1183
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1197
 
1184
 
1198
======================================================================
1185
======================================================================
1199
==================== Function 20 - MIDI interface. ===================
1186
==================== Function 20 - MIDI interface. ===================
1200
======================================================================
1187
======================================================================
1201
 
1188
 
1202
----------------------- Subfunction 1 - reset ------------------------
1189
----------------------- Subfunction 1 - reset ------------------------
1203
Parameters:
1190
Parameters:
1204
  * eax = 20 - function number
1191
  * eax = 20 - function number
1205
  * ebx = 1 - subfunction number
1192
  * ebx = 1 - subfunction number
1206
 
1193
 
1207
-------------------- Subfunction 2 - output byte ---------------------
1194
-------------------- Subfunction 2 - output byte ---------------------
1208
Parameters:
1195
Parameters:
1209
  * eax = 20 - function number
1196
  * eax = 20 - function number
1210
  * ebx = 2 - subfunction number
1197
  * ebx = 2 - subfunction number
1211
  * cl = byte for output
1198
  * cl = byte for output
1212
Returned value (is the same for both subfunctions):
1199
Returned value (is the same for both subfunctions):
1213
  * eax = 0 - success
1200
  * eax = 0 - success
1214
  * eax = 1 - base port is not defined
1201
  * eax = 1 - base port is not defined
1215
Remarks:
1202
Remarks:
1216
  * Previously the base port must be defined by
1203
  * Previously the base port must be defined by
1217
    subfunction 1 of function 21.
1204
    subfunction 1 of function 21.
1218
 
1205
 
1219
======================================================================
1206
======================================================================
1220
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1207
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1221
======================================================================
1208
======================================================================
1222
Parameters:
1209
Parameters:
1223
  * eax = 21 - function number
1210
  * eax = 21 - function number
1224
  * ebx = 1 - subfunction number
1211
  * ebx = 1 - subfunction number
1225
  * ecx = number of base port
1212
  * ecx = number of base port
1226
Returned value
1213
Returned value
1227
  * eax = 0 - success
1214
  * eax = 0 - success
1228
  * eax = -1 - erratic number of a port
1215
  * eax = -1 - erratic number of a port
1229
Remarks:
1216
Remarks:
1230
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1217
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1231
  * The installation of base is necessary for function 20.
1218
  * The installation of base is necessary for function 20.
1232
  * To get base port use subfunction 1 of function 26.
1219
  * To get base port use subfunction 1 of function 26.
1233
 
1220
 
1234
======================================================================
1221
======================================================================
1235
========== Function 21, subfunction 2 - set keyboard layout. =========
1222
========== Function 21, subfunction 2 - set keyboard layout. =========
1236
======================================================================
1223
======================================================================
1237
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1224
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1238
which will be read by function 2.
1225
which will be read by function 2.
1239
Parameters:
1226
Parameters:
1240
  * eax = 21 - function number
1227
  * eax = 21 - function number
1241
  * ebx = 2 - subfunction number
1228
  * ebx = 2 - subfunction number
1242
  * ecx = which layout to set:
1229
  * ecx = which layout to set:
1243
    * 1 = normal layout
1230
    * 1 = normal layout
1244
    * 2 = layout at pressed Shift
1231
    * 2 = layout at pressed Shift
1245
    * 3 = layout at pressed Alt
1232
    * 3 = layout at pressed Alt
1246
  * edx = pointer to layout - table of length 128 bytes
1233
  * edx = pointer to layout - table of length 128 bytes
1247
Or:
1234
Or:
1248
  * ecx = 9
1235
  * ecx = 9
1249
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1236
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1250
Returned value:
1237
Returned value:
1251
  * eax = 0 - success
1238
  * eax = 0 - success
1252
  * eax = 1 - incorrect parameter
1239
  * eax = 1 - incorrect parameter
1253
Remarks:
1240
Remarks:
1254
  * If Alt is pressed, the layout with Alt is used;
1241
  * If Alt is pressed, the layout with Alt is used;
1255
    if Alt is not pressed, but Shift is pressed,
1242
    if Alt is not pressed, but Shift is pressed,
1256
    the layout with Shift is used;
1243
    the layout with Shift is used;
1257
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1244
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1258
    layout is used and then from the code is subtracted 0x60;
1245
    layout is used and then from the code is subtracted 0x60;
1259
    if no control key is pressed, the normal layout is used.
1246
    if no control key is pressed, the normal layout is used.
1260
  * To get layout and country identifier use
1247
  * To get layout and country identifier use
1261
    subfunction 2 of function 26.
1248
    subfunction 2 of function 26.
1262
  * Country identifier is global system variable, which is not used
1249
  * Country identifier is global system variable, which is not used
1263
    by the kernel itself; however the application '@taskbar' displays
1250
    by the kernel itself; however the application '@taskbar' displays
1264
    the corresponding icon.
1251
    the corresponding icon.
1265
  * The application @taskbar switches layouts on user request.
1252
  * The application @taskbar switches layouts on user request.
1266
 
1253
 
1267
======================================================================
1254
======================================================================
1268
========== Function 21, subfunction 5 - set system language. =========
1255
========== Function 21, subfunction 5 - set system language. =========
1269
======================================================================
1256
======================================================================
1270
Parameters:
1257
Parameters:
1271
  * eax = 21 - function number
1258
  * eax = 21 - function number
1272
  * ebx = 5 - subfunction number
1259
  * ebx = 5 - subfunction number
1273
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1260
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1274
Returned value:
1261
Returned value:
1275
  * eax = 0
1262
  * eax = 0
1276
Remarks:
1263
Remarks:
1277
  * System language is global system variable and is not used
1264
  * System language is global system variable and is not used
1278
    by the kernel itself, however application @taskbar draws the
1265
    by the kernel itself, however application @taskbar draws the
1279
    appropriate icon.
1266
    appropriate icon.
1280
  * Function does not check for correctness, as the kernel does not
1267
  * Function does not check for correctness, as the kernel does not
1281
    use this variable.
1268
    use this variable.
1282
  * To get system language use subfunction 5 of function 26.
1269
  * To get system language use subfunction 5 of function 26.
1283
 
1270
 
1284
======================================================================
1271
======================================================================
1285
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1272
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1286
======================================================================
1273
======================================================================
1287
Parameters:
1274
Parameters:
1288
  * eax = 21 - function number
1275
  * eax = 21 - function number
1289
  * ebx = 11 - subfunction number
1276
  * ebx = 11 - subfunction number
1290
  * ecx = 0/1 - disable/enable
1277
  * ecx = 0/1 - disable/enable
1291
Returned value:
1278
Returned value:
1292
  * eax = 0
1279
  * eax = 0
1293
Remarks:
1280
Remarks:
1294
  * Is used in LBA-read (subfunction 8 of function 58).
1281
  * Is used in LBA-read (subfunction 8 of function 58).
1295
  * The current implementation uses only low bit of ecx.
1282
  * The current implementation uses only low bit of ecx.
1296
  * To get current status use subfunction 11 of function 26.
1283
  * To get current status use subfunction 11 of function 26.
1297
 
1284
 
1298
======================================================================
1285
======================================================================
1299
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1286
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1300
======================================================================
1287
======================================================================
1301
Parameters:
1288
Parameters:
1302
  * eax = 21 - function number
1289
  * eax = 21 - function number
1303
  * ebx = 12 - subfunction number
1290
  * ebx = 12 - subfunction number
1304
  * ecx = 0/1 - disable/enable
1291
  * ecx = 0/1 - disable/enable
1305
Returned value:
1292
Returned value:
1306
  * eax = 0
1293
  * eax = 0
1307
Remarks:
1294
Remarks:
1308
  * Is used in operations with PCI bus (function 62).
1295
  * Is used in operations with PCI bus (function 62).
1309
  * The current implementation uses only low bit of ecx.
1296
  * The current implementation uses only low bit of ecx.
1310
  * To get current status use subfunction 12 of function 26.
1297
  * To get current status use subfunction 12 of function 26.
1311
 
1298
 
1312
======================================================================
1299
======================================================================
1313
================= Function 22 - set system date/time. ================
1300
================= Function 22 - set system date/time. ================
1314
======================================================================
1301
======================================================================
1315
Parameters:
1302
Parameters:
1316
  * eax = 22 - function number
1303
  * eax = 22 - function number
1317
  * ebx = 0 - set time
1304
  * ebx = 0 - set time
1318
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1305
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1319
    * HH=hour 00..23
1306
    * HH=hour 00..23
1320
    * MM=minute 00..59
1307
    * MM=minute 00..59
1321
    * SS=second 00..59
1308
    * SS=second 00..59
1322
  * ebx = 1 - set date
1309
  * ebx = 1 - set date
1323
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1310
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1324
    * DD=day 01..31
1311
    * DD=day 01..31
1325
    * MM=month 01..12
1312
    * MM=month 01..12
1326
    * YY=year 00..99
1313
    * YY=year 00..99
1327
  * ebx = 2 - set day of week
1314
  * ebx = 2 - set day of week
1328
    * ecx = 1 for Sunday, ..., 7 for Saturday
1315
    * ecx = 1 for Sunday, ..., 7 for Saturday
1329
  * ebx = 3 - set alarm clock
1316
  * ebx = 3 - set alarm clock
1330
    * ecx = 0x00SSMMHH
1317
    * ecx = 0x00SSMMHH
1331
Returned value:
1318
Returned value:
1332
  * eax = 0 - success
1319
  * eax = 0 - success
1333
  * eax = 1 - incorrect parameter
1320
  * eax = 1 - incorrect parameter
1334
  * eax = 2 - CMOS-battery was unloaded
1321
  * eax = 2 - CMOS-battery was unloaded
1335
Remarks:
1322
Remarks:
1336
  * Value of installation of day of week seems to be doubtful,
1323
  * Value of installation of day of week seems to be doubtful,
1337
    as it a little where is used
1324
    as it a little where is used
1338
    (day of week can be calculated by date).
1325
    (day of week can be calculated by date).
1339
  * Alarm clock can be set on operation in the given time every day.
1326
  * Alarm clock can be set on operation in the given time every day.
1340
    But there is no existing system function to disable it.
1327
    But there is no existing system function to disable it.
1341
  * Operation of alarm clock consists in generation IRQ8.
1328
  * Operation of alarm clock consists in generation IRQ8.
1342
  * Generally CMOS supports for alarm clock set of value 0xFF
1329
  * Generally CMOS supports for alarm clock set of value 0xFF
1343
    as one of parameters and it means that the appropriate parameter
1330
    as one of parameters and it means that the appropriate parameter
1344
    is ignored. But current implementation does not allow this
1331
    is ignored. But current implementation does not allow this
1345
    (will return 1).
1332
    (will return 1).
1346
  * Alarm clock is a global system resource; the set of
1333
  * Alarm clock is a global system resource; the set of
1347
    an alarm clock cancels automatically the previous set.
1334
    an alarm clock cancels automatically the previous set.
1348
    However, at moment no program uses it.
1335
    However, at moment no program uses it.
1349
 
1336
 
1350
======================================================================
1337
======================================================================
1351
============= Function 23 - wait for event with timeout. =============
1338
============= Function 23 - wait for event with timeout. =============
1352
======================================================================
1339
======================================================================
1353
If the message queue is empty, waits for new message in the queue,
1340
If the message queue is empty, waits for new message in the queue,
1354
but no more than given time. Then reads out a message from the queue.
1341
but no more than given time. Then reads out a message from the queue.
1355
 
1342
 
1356
Parameters:
1343
Parameters:
1357
  * eax = 23 - function number
1344
  * eax = 23 - function number
1358
  * ebx = timeout (in 1/100 of second)
1345
  * ebx = timeout (in 1/100 of second)
1359
Returned value:
1346
Returned value:
1360
  * eax = 0 - the message queue is empty
1347
  * eax = 0 - the message queue is empty
1361
  * otherwise eax = event (see the list of events)
1348
  * otherwise eax = event (see the list of events)
1362
Remarks:
1349
Remarks:
1363
  * Only those events are taken into account, which enter into
1350
  * Only those events are taken into account, which enter into
1364
    the mask set by function 40. By default it is
1351
    the mask set by function 40. By default it is
1365
    redraw, key and button events.
1352
    redraw, key and button events.
1366
  * To check for presence of a message in the queue use function 11.
1353
  * To check for presence of a message in the queue use function 11.
1367
    To wait without timeout use function 10.
1354
    To wait without timeout use function 10.
1368
  * Transmission ebx=0 results in immediate returning eax=0.
1355
  * Transmission ebx=0 results in immediate returning eax=0.
1369
  * Current implementation returns immediately with eax=0,
1356
  * Current implementation returns immediately with eax=0,
1370
    if the addition of ebx with the current value of time counter
1357
    if the addition of ebx with the current value of time counter
1371
    makes 32-bit overflow.
1358
    makes 32-bit overflow.
1372
 
1359
 
1373
======================================================================
1360
======================================================================
1374
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1361
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1375
======================================================================
1362
======================================================================
1376
Parameters:
1363
Parameters:
1377
  * eax = 24 - function number
1364
  * eax = 24 - function number
1378
  * ebx = 4 - subfunction number
1365
  * ebx = 4 - subfunction number
1379
  * ecx = position of CD/DVD-drive
1366
  * ecx = position of CD/DVD-drive
1380
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1367
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1381
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1368
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1382
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1369
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1383
Returned value:
1370
Returned value:
1384
  * function does not return value
1371
  * function does not return value
1385
Remarks:
1372
Remarks:
1386
  * The function is supported only for ATAPI devices (CD and DVD).
1373
  * The function is supported only for ATAPI devices (CD and DVD).
1387
  * When the tray is being ejected,
1374
  * When the tray is being ejected,
1388
    manual control of tray is unlocked.
1375
    manual control of tray is unlocked.
1389
  * When the tray is being ejected, the code clears the cache for
1376
  * When the tray is being ejected, the code clears the cache for
1390
    corresponding device.
1377
    corresponding device.
1391
  * An example of usage of the function is the application CD_tray.
1378
  * An example of usage of the function is the application CD_tray.
1392
 
1379
 
1393
======================================================================
1380
======================================================================
1394
======== Function 24, subfunction 5 - load tray of disk drive. =======
1381
======== Function 24, subfunction 5 - load tray of disk drive. =======
1395
======================================================================
1382
======================================================================
1396
Parameters:
1383
Parameters:
1397
  * eax = 24 - function number
1384
  * eax = 24 - function number
1398
  * ebx = 5 - subfunction number
1385
  * ebx = 5 - subfunction number
1399
  * ecx = position of CD/DVD-drive
1386
  * ecx = position of CD/DVD-drive
1400
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1387
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1401
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1388
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1402
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1389
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1403
Returned value:
1390
Returned value:
1404
  * function does not return value
1391
  * function does not return value
1405
Remarks:
1392
Remarks:
1406
  * The function is supported only for ATAPI devices (CD and DVD).
1393
  * The function is supported only for ATAPI devices (CD and DVD).
1407
  * An example of usage of the function is the application CD_tray.
1394
  * An example of usage of the function is the application CD_tray.
1408
 
1395
 
1409
======================================================================
1396
======================================================================
1410
======= Function 25 - put image area on the background layer. ========
1397
======= Function 25 - put image area on the background layer. ========
1411
======================================================================
1398
======================================================================
1412
Paramters:
1399
Paramters:
1413
  * eax = 25 - function number
1400
  * eax = 25 - function number
1414
  * ebx = pointer to the previously allocated memory area,
1401
  * ebx = pointer to the previously allocated memory area,
1415
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1402
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1416
  * ecx = [size on axis x]*65536 + [size on axis y]
1403
  * ecx = [size on axis x]*65536 + [size on axis y]
1417
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1404
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1418
Returned value:
1405
Returned value:
1419
  * function does not return value
1406
  * function does not return value
1420
Remarks:
1407
Remarks:
1421
  * Coordinates of the image are coordinates of the upper left corner
1408
  * Coordinates of the image are coordinates of the upper left corner
1422
    of the image relative to the screen.
1409
    of the image relative to the screen.
1423
  * Size of the image in bytes is 4*xsize*ysize
1410
  * Size of the image in bytes is 4*xsize*ysize
1424
  * TT - byte pointer of transparency, at current version:
1411
  * TT - byte pointer of transparency, at current version:
1425
         1 to FF - opaque, 0 - transparent.
1412
         1 to FF - opaque, 0 - transparent.
1426
  * The function places the image directly to LFB. It is not for
1413
  * The function places the image directly to LFB. It is not for
1427
    background image f.15. Options f.15 to f.25 does not make sense.
1414
    background image f.15. Options f.15 to f.25 does not make sense.
1428
 
1415
 
1429
======================================================================
1416
======================================================================
1430
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1417
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1431
======================================================================
1418
======================================================================
1432
Parameters:
1419
Parameters:
1433
  * eax = 26 - function number
1420
  * eax = 26 - function number
1434
  * ebx = 1 - subfunction number
1421
  * ebx = 1 - subfunction number
1435
Returned value:
1422
Returned value:
1436
  * eax = port number
1423
  * eax = port number
1437
Parameters:
1424
Parameters:
1438
  * To set base port use subfunction 1 of function 21.
1425
  * To set base port use subfunction 1 of function 21.
1439
 
1426
 
1440
======================================================================
1427
======================================================================
1441
========== Function 26, subfunction 2 - get keyboard layout. =========
1428
========== Function 26, subfunction 2 - get keyboard layout. =========
1442
======================================================================
1429
======================================================================
1443
The keyboard layout is used to convert keyboard scancodes to
1430
The keyboard layout is used to convert keyboard scancodes to
1444
ASCII-codes for function 2.
1431
ASCII-codes for function 2.
1445
Parameters:
1432
Parameters:
1446
  * eax = 26 - function number
1433
  * eax = 26 - function number
1447
  * ebx = 2 - subfunction number
1434
  * ebx = 2 - subfunction number
1448
  * ecx = what layout to get:
1435
  * ecx = what layout to get:
1449
    * 1 = normal layout
1436
    * 1 = normal layout
1450
    * 2 = layout with pressed Shift
1437
    * 2 = layout with pressed Shift
1451
    * 3 = layout with pressed Alt
1438
    * 3 = layout with pressed Alt
1452
  * edx = pointer to the 128-bytes buffer, where the layout will be
1439
  * edx = pointer to the 128-bytes buffer, where the layout will be
1453
    copied
1440
    copied
1454
Returned value:
1441
Returned value:
1455
  * function does not return value
1442
  * function does not return value
1456
Or:
1443
Or:
1457
  * eax = 26 - function number
1444
  * eax = 26 - function number
1458
  * ebx = 2 - subfunction number
1445
  * ebx = 2 - subfunction number
1459
  * ecx = 9
1446
  * ecx = 9
1460
Returned value:
1447
Returned value:
1461
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1448
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1462
Remarks:
1449
Remarks:
1463
  * If Alt is pressed, the layout with Alt is used;
1450
  * If Alt is pressed, the layout with Alt is used;
1464
    if Alt is not pressed, but Shift is pressed,
1451
    if Alt is not pressed, but Shift is pressed,
1465
    the layout with Shift is used;
1452
    the layout with Shift is used;
1466
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1453
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1467
    layout is used and then from the code is subtracted 0x60;
1454
    layout is used and then from the code is subtracted 0x60;
1468
    if no control key is pressed, the normal layout is used.
1455
    if no control key is pressed, the normal layout is used.
1469
  * To set layout and country identifier use
1456
  * To set layout and country identifier use
1470
    subfunction 2 of function 21.
1457
    subfunction 2 of function 21.
1471
  * Country identifier is global system variable, which is not used
1458
  * Country identifier is global system variable, which is not used
1472
    by the kernel itself; however the application '@taskbar' displays
1459
    by the kernel itself; however the application '@taskbar' displays
1473
    the corresponding icon (using this function).
1460
    the corresponding icon (using this function).
1474
  * The application @taskbar switches layouts on user request.
1461
  * The application @taskbar switches layouts on user request.
1475
 
1462
 
1476
======================================================================
1463
======================================================================
1477
========== Function 26, subfunction 5 - get system language. =========
1464
========== Function 26, subfunction 5 - get system language. =========
1478
======================================================================
1465
======================================================================
1479
Parameters:
1466
Parameters:
1480
  * eax = 26 - function number
1467
  * eax = 26 - function number
1481
  * ebx = 5 - subfunction number
1468
  * ebx = 5 - subfunction number
1482
Returned value:
1469
Returned value:
1483
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1470
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1484
Remarks:
1471
Remarks:
1485
  * System language is global system variable and is not used
1472
  * System language is global system variable and is not used
1486
    by the kernel itself, however application @taskbar draws the
1473
    by the kernel itself, however application @taskbar draws the
1487
    appropriate icon (using this function).
1474
    appropriate icon (using this function).
1488
  * To set system language use subfunction 5 of function 21.
1475
  * To set system language use subfunction 5 of function 21.
1489
 
1476
 
1490
======================================================================
1477
======================================================================
1491
=== Function 26, subfunction 9 - get the value of the time counter. ==
1478
=== Function 26, subfunction 9 - get the value of the time counter. ==
1492
======================================================================
1479
======================================================================
1493
Parameters:
1480
Parameters:
1494
  * eax = 26 - function number
1481
  * eax = 26 - function number
1495
  * ebx = 9 - subfunction number
1482
  * ebx = 9 - subfunction number
1496
Returned value:
1483
Returned value:
1497
  * eax = number of 1/100s of second, past from the system boot time
1484
  * eax = number of 1/100s of second, past from the system boot time
1498
Remarks:
1485
Remarks:
1499
  * Counter takes modulo 2^32, that correspond to a little more
1486
  * Counter takes modulo 2^32, that correspond to a little more
1500
    than 497 days.
1487
    than 497 days.
1501
  * To get system time use function 3.  
1488
  * To get system time use function 3.  
1502
  
1489
  
1503
======================================================================
1490
======================================================================
1504
===================== Function 26, subfunction 10 ====================
1491
===================== Function 26, subfunction 10 ====================
1505
========== Get the value of the high precision time counter. =========
1492
========== Get the value of the high precision time counter. =========
1506
======================================================================
1493
======================================================================
1507
Parameters:
1494
Parameters:
1508
  * eax = 26 - function number
1495
  * eax = 26 - function number
1509
  * ebx = 10 - subfunction number
1496
  * ebx = 10 - subfunction number
1510
Returned value:
1497
Returned value:
1511
  * eax = number of nanoseconds since system boot time (lower DWORD)
1498
  * eax = number of nanoseconds since system boot time (lower DWORD)
1512
  * edx = number of nanoseconds since system boot time (high DWORD)  
1499
  * edx = number of nanoseconds since system boot time (high DWORD)  
1513
Remarks:
1500
Remarks:
1514
  * The counter is based on HPET, if HPET is not available, resolution
1501
  * The counter is based on HPET, if HPET is not available, resolution
1515
    will be reduced to 10 000 000 nanoseconds.
1502
    will be reduced to 10 000 000 nanoseconds.
1516
 
1503
 
1517
======================================================================
1504
======================================================================
1518
===================== Function 26, subfunction 11 ====================
1505
===================== Function 26, subfunction 11 ====================
1519
========== Find out whether low-level HD access is enabled. ==========
1506
========== Find out whether low-level HD access is enabled. ==========
1520
======================================================================
1507
======================================================================
1521
Parameters:
1508
Parameters:
1522
  * eax = 26 - function number
1509
  * eax = 26 - function number
1523
  * ebx = 11 - subfunction number
1510
  * ebx = 11 - subfunction number
1524
Returned value:
1511
Returned value:
1525
  * eax = 0/1 - disabled/enabled
1512
  * eax = 0/1 - disabled/enabled
1526
Remarks:
1513
Remarks:
1527
  * Is used in LBA read (subfunction 8 of function 58).
1514
  * Is used in LBA read (subfunction 8 of function 58).
1528
  * To set current state use subfunction 11 of function 21.
1515
  * To set current state use subfunction 11 of function 21.
1529
 
1516
 
1530
======================================================================
1517
======================================================================
1531
===================== Function 26, subfunction 12 ====================
1518
===================== Function 26, subfunction 12 ====================
1532
========== Find out whether low-level PCI access is enabled. =========
1519
========== Find out whether low-level PCI access is enabled. =========
1533
======================================================================
1520
======================================================================
1534
Parameters:
1521
Parameters:
1535
  * eax = 26 - function number
1522
  * eax = 26 - function number
1536
  * ebx = 12 - subfunction number
1523
  * ebx = 12 - subfunction number
1537
Returned value:
1524
Returned value:
1538
  * eax = 0/1 - disabled/enabled
1525
  * eax = 0/1 - disabled/enabled
1539
Remarks:
1526
Remarks:
1540
  * Is used by operations with PCI bus (function 62).
1527
  * Is used by operations with PCI bus (function 62).
1541
  * The current implementation uses only low bit of ecx.
1528
  * The current implementation uses only low bit of ecx.
1542
  * To set the current state use subfunction 12 of function 21.
1529
  * To set the current state use subfunction 12 of function 21.
1543
 
1530
 
1544
======================================================================
1531
======================================================================
1545
=================== Function 29 - get system date. ===================
1532
=================== Function 29 - get system date. ===================
1546
======================================================================
1533
======================================================================
1547
Parameters:
1534
Parameters:
1548
  * eax = 29 - function number
1535
  * eax = 29 - function number
1549
Returned value:
1536
Returned value:
1550
  * eax = 0x00DDMMYY, where
1537
  * eax = 0x00DDMMYY, where
1551
    (binary-decimal coding, BCD, is used)
1538
    (binary-decimal coding, BCD, is used)
1552
  * YY = two low digits of year (00..99)
1539
  * YY = two low digits of year (00..99)
1553
  * MM = month (01..12)
1540
  * MM = month (01..12)
1554
  * DD = day (01..31)
1541
  * DD = day (01..31)
1555
Remarks:
1542
Remarks:
1556
  * To set system date use function 22.
1543
  * To set system date use function 22.
1557
 
1544
 
1558
======================================================================
1545
======================================================================
1559
============= Function 30 - work with the current folder. ============
1546
============= Function 30 - work with the current folder. ============
1560
======================================================================
1547
======================================================================
1561
 
1548
 
1562
--------- Subfunction 1 - set current folder for the thread. ---------
1549
--------- Subfunction 1 - set current folder for the thread. ---------
1563
Parameters:
1550
Parameters:
1564
  * eax = 30 - function number
1551
  * eax = 30 - function number
1565
  * ebx = 1 - subfunction number
1552
  * ebx = 1 - subfunction number
1566
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1553
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1567
Returned value:
1554
Returned value:
1568
  * function does not return value
1555
  * function does not return value
1569
 
1556
 
1570
--------- Subfunction 2 - get current folder for the thread. ---------
1557
--------- Subfunction 2 - get current folder for the thread. ---------
1571
Parameters:
1558
Parameters:
1572
  * eax = 30 - function number
1559
  * eax = 30 - function number
1573
  * ebx = 2 - subfunction number
1560
  * ebx = 2 - subfunction number
1574
  * ecx = pointer to buffer
1561
  * ecx = pointer to buffer
1575
  * edx = size of buffer
1562
  * edx = size of buffer
1576
Returned value:
1563
Returned value:
1577
  * eax = size of the current folder's name (including terminating 0)
1564
  * eax = size of the current folder's name (including terminating 0)
1578
Remarks:
1565
Remarks:
1579
  * If the buffer is too small to hold all data, only first (edx-1)
1566
  * If the buffer is too small to hold all data, only first (edx-1)
1580
    bytes are copied and than terminating 0 is inserted.
1567
    bytes are copied and than terminating 0 is inserted.
1581
  * By default, current folder for the thread is "/rd/1".
1568
  * By default, current folder for the thread is "/rd/1".
1582
  * At process/thread creation the current folder will be inherited
1569
  * At process/thread creation the current folder will be inherited
1583
    from the parent.
1570
    from the parent.
1584
 
1571
 
1585
--- Subfunction 3 - install the add.system directory for the kernel --
1572
--- Subfunction 3 - install the add.system directory for the kernel --
1586
Parameters:
1573
Parameters:
1587
  * eax = 30 - function number
1574
  * eax = 30 - function number
1588
  * ebx = 3 - subfunction number
1575
  * ebx = 3 - subfunction number
1589
  * ecx = pointer to a block of data:
1576
  * ecx = pointer to a block of data:
1590
          sysdir_name     rb 64
1577
          sysdir_name     rb 64
1591
          sysdir_path     rb 64
1578
          sysdir_path     rb 64
1592
For example:
1579
For example:
1593
dir_name1       db 'KolibriOS',0
1580
dir_name1       db 'KolibriOS',0
1594
                rb 64-10
1581
                rb 64-10
1595
dir_path1       db 'HD0/1',0
1582
dir_path1       db 'HD0/1',0
1596
                rb 64-6
1583
                rb 64-6
1597
Returned value:
1584
Returned value:
1598
  * function does not return value
1585
  * function does not return value
1599
Remarks:
1586
Remarks:
1600
  * The function can be called only 1 time for 1 session of the OS.
1587
  * The function can be called only 1 time for 1 session of the OS.
1601
 
1588
 
1602
======================================================================
1589
======================================================================
1603
========= Function 34 - who owner the pixel on the screen. ===========
1590
========= Function 34 - who owner the pixel on the screen. ===========
1604
======================================================================
1591
======================================================================
1605
Parameters:
1592
Parameters:
1606
  * eax = 34 - function number
1593
  * eax = 34 - function number
1607
  * ebx = x-coordinate (relative to the display)
1594
  * ebx = x-coordinate (relative to the display)
1608
  * ecx = y-coordinate (relative to the display)
1595
  * ecx = y-coordinate (relative to the display)
1609
 
1596
 
1610
Returned value:
1597
Returned value:
1611
  * eax = 0x000000XX - owner of pixel the slot window N
1598
  * eax = 0x000000XX - owner of pixel the slot window N
1612
    If incorrect values ebx and ecx then function returns 0
1599
    If incorrect values ebx and ecx then function returns 0
1613
  * The function takes the value from the area [_WinMapAddress]
1600
  * The function takes the value from the area [_WinMapAddress]
1614
 
1601
 
1615
======================================================================
1602
======================================================================
1616
======= Function 35 - read the color of a pixel on the screen. =======
1603
======= Function 35 - read the color of a pixel on the screen. =======
1617
======================================================================
1604
======================================================================
1618
Parameters:
1605
Parameters:
1619
  * eax = 35
1606
  * eax = 35
1620
  * ebx = y*xsize+x, where
1607
  * ebx = y*xsize+x, where
1621
  * (x,y) = coordinates of a pixel (beginning from 0)
1608
  * (x,y) = coordinates of a pixel (beginning from 0)
1622
  * xsize = horizontal screen size
1609
  * xsize = horizontal screen size
1623
Returned value:
1610
Returned value:
1624
  * eax = color 0x00RRGGBB
1611
  * eax = color 0x00RRGGBB
1625
Remarks:
1612
Remarks:
1626
  * To get screen sizes use function 14. Pay attention,
1613
  * To get screen sizes use function 14. Pay attention,
1627
    that it subtracts 1 from both sizes.
1614
    that it subtracts 1 from both sizes.
1628
  * There is also direct access (without any system calls)
1615
  * There is also direct access (without any system calls)
1629
    to videomemory through the selector gs. To get parameters of
1616
    to videomemory through the selector gs. To get parameters of
1630
    the current videomode, use function 61.
1617
    the current videomode, use function 61.
1631
 
1618
 
1632
======================================================================
1619
======================================================================
1633
=================== Function 36 - read screen area. ==================
1620
=================== Function 36 - read screen area. ==================
1634
======================================================================
1621
======================================================================
1635
Paramters:
1622
Paramters:
1636
  * eax = 36 - function number
1623
  * eax = 36 - function number
1637
  * ebx = pointer to the previously allocated memory area,
1624
  * ebx = pointer to the previously allocated memory area,
1638
        where will be placed the image in the format BBGGRRBBGGRR...
1625
        where will be placed the image in the format BBGGRRBBGGRR...
1639
  * ecx = [size on axis x]*65536 + [size on axis y]
1626
  * ecx = [size on axis x]*65536 + [size on axis y]
1640
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1627
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1641
Returned value:
1628
Returned value:
1642
  * function does not return value
1629
  * function does not return value
1643
Remarks:
1630
Remarks:
1644
  * Coordinates of the image are coordinates of the upper left corner
1631
  * Coordinates of the image are coordinates of the upper left corner
1645
    of the image relative to the screen.
1632
    of the image relative to the screen.
1646
  * Size of the image in bytes is 3*xsize*ysize.
1633
  * Size of the image in bytes is 3*xsize*ysize.
1647
 
1634
 
1648
======================================================================
1635
======================================================================
1649
=================== Function 37 - work with mouse. ===================
1636
=================== Function 37 - work with mouse. ===================
1650
======================================================================
1637
======================================================================
1651
 
1638
 
1652
---------- Subfunction 0 - screen coordinates of the mouse -----------
1639
---------- Subfunction 0 - screen coordinates of the mouse -----------
1653
Parameters:
1640
Parameters:
1654
  * eax = 37 - function number
1641
  * eax = 37 - function number
1655
  * ebx = 0 - subfunction number
1642
  * ebx = 0 - subfunction number
1656
Returned value:
1643
Returned value:
1657
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1644
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1658
    (beginning from 0)
1645
    (beginning from 0)
1659
 
1646
 
1660
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1647
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1661
Parameters:
1648
Parameters:
1662
  * eax = 37 - function number
1649
  * eax = 37 - function number
1663
  * ebx = 1 - subfunction number
1650
  * ebx = 1 - subfunction number
1664
Returned value:
1651
Returned value:
1665
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1652
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1666
    relative to the application window (beginning from 0)
1653
    relative to the application window (beginning from 0)
1667
Remarks:
1654
Remarks:
1668
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1655
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1669
    If y>=ywnd, the low word is non-negative and contains
1656
    If y>=ywnd, the low word is non-negative and contains
1670
    relative y-coordinate, and the high word - relative x-coordinate
1657
    relative y-coordinate, and the high word - relative x-coordinate
1671
    (with correct sign). Otherwise the low word is negative and still
1658
    (with correct sign). Otherwise the low word is negative and still
1672
    contains relative y-coordinate, and to the high word
1659
    contains relative y-coordinate, and to the high word
1673
    1 should be added.
1660
    1 should be added.
1674
 
1661
 
1675
------------- Subfunction 2 - states of the mouse buttons ------------
1662
------------- Subfunction 2 - states of the mouse buttons ------------
1676
Parameters:
1663
Parameters:
1677
  * eax = 37 - function number
1664
  * eax = 37 - function number
1678
  * ebx = 2 - subfunction number
1665
  * ebx = 2 - subfunction number
1679
Returned value:
1666
Returned value:
1680
  * eax = bits 0-4 equal to subfunction 3
1667
  * eax = bits 0-4 equal to subfunction 3
1681
 
1668
 
1682
------- Subfunction 3 - states and events of the mouse buttons -------
1669
------- Subfunction 3 - states and events of the mouse buttons -------
1683
Parameters:
1670
Parameters:
1684
  * eax = 37 - function number
1671
  * eax = 37 - function number
1685
  * ebx = 3 - subfunction number
1672
  * ebx = 3 - subfunction number
1686
Returned value:
1673
Returned value:
1687
  * eax contains next information:
1674
  * eax contains next information:
1688
 
1675
 
1689
states:
1676
states:
1690
  * bit 0 is set = left button is held
1677
  * bit 0 is set = left button is held
1691
  * bit 1 is set = right button is held
1678
  * bit 1 is set = right button is held
1692
  * bit 2 is set = middle button is held
1679
  * bit 2 is set = middle button is held
1693
  * bit 3 is set = 4th button is held
1680
  * bit 3 is set = 4th button is held
1694
  * bit 4 is set = 5th button is held
1681
  * bit 4 is set = 5th button is held
1695
 
1682
 
1696
events:
1683
events:
1697
  * bit 8 is set = left button is pressed
1684
  * bit 8 is set = left button is pressed
1698
  * bit 9 is set = right button is pressed
1685
  * bit 9 is set = right button is pressed
1699
  * bit 10 is set = middle button is pressed
1686
  * bit 10 is set = middle button is pressed
1700
 
1687
 
1701
  * bit 15 is set = vertical scroll is used
1688
  * bit 15 is set = vertical scroll is used
1702
 
1689
 
1703
  * bit 16 is set = left button is released
1690
  * bit 16 is set = left button is released
1704
  * bit 17 is set = right button is released
1691
  * bit 17 is set = right button is released
1705
  * bit 18 is set = middle button is released
1692
  * bit 18 is set = middle button is released
1706
 
1693
 
1707
  * bit 23 is set = horisontal scroll is used
1694
  * bit 23 is set = horisontal scroll is used
1708
 
1695
 
1709
  * bit 24 is set = doubleclick by left button
1696
  * bit 24 is set = doubleclick by left button
1710
 
1697
 
1711
-------------------- Subfunction 4 - load cursor ---------------------
1698
-------------------- Subfunction 4 - load cursor ---------------------
1712
Parameters:
1699
Parameters:
1713
  * eax = 37 - function number
1700
  * eax = 37 - function number
1714
  * ebx = 4 - subfunction number
1701
  * ebx = 4 - subfunction number
1715
  * dx = data source:
1702
  * dx = data source:
1716
  * dx = LOAD_FROM_FILE = 0 - data in a file
1703
  * dx = LOAD_FROM_FILE = 0 - data in a file
1717
    * ecx = pointer to full path to the cursor file
1704
    * ecx = pointer to full path to the cursor file
1718
    * the file must be in the format .cur, which is standard for
1705
    * the file must be in the format .cur, which is standard for
1719
      MS Windows, at that of the size 32*32 pixels
1706
      MS Windows, at that of the size 32*32 pixels
1720
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1707
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1721
    * ecx = pointer to data of the cursor file
1708
    * ecx = pointer to data of the cursor file
1722
    * the data format is the same as in the previous case
1709
    * the data format is the same as in the previous case
1723
  * dx = LOAD_INDIRECT = 2 - data in memory
1710
  * dx = LOAD_INDIRECT = 2 - data in memory
1724
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1711
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1725
    * edx = 0xXXYY0002, where
1712
    * edx = 0xXXYY0002, where
1726
      * XX = x-coordinate of cursor hotspot
1713
      * XX = x-coordinate of cursor hotspot
1727
      * YY = y-coordinate
1714
      * YY = y-coordinate
1728
      * 0 <= XX, YY <= 31
1715
      * 0 <= XX, YY <= 31
1729
Returned value:
1716
Returned value:
1730
  * eax = 0 - failed
1717
  * eax = 0 - failed
1731
  * otherwise eax = cursor handle
1718
  * otherwise eax = cursor handle
1732
 
1719
 
1733
--------------------- Subfunction 5 - set cursor ---------------------
1720
--------------------- Subfunction 5 - set cursor ---------------------
1734
Sets new cursor for the window of the current thread.
1721
Sets new cursor for the window of the current thread.
1735
Parameters:
1722
Parameters:
1736
  * eax = 37 - function number
1723
  * eax = 37 - function number
1737
  * ebx = 5 - subfunction number
1724
  * ebx = 5 - subfunction number
1738
  * ecx = cursor handle
1725
  * ecx = cursor handle
1739
Returned value:
1726
Returned value:
1740
  * eax = handle of previous cursor
1727
  * eax = handle of previous cursor
1741
Remarks:
1728
Remarks:
1742
  * If the handle is incorrect, the function restores the default
1729
  * If the handle is incorrect, the function restores the default
1743
    cursor (standard arrow). In particular, ecx=0 restores it.
1730
    cursor (standard arrow). In particular, ecx=0 restores it.
1744
 
1731
 
1745
------------------- Subfunction 6 - delete cursor --------------------
1732
------------------- Subfunction 6 - delete cursor --------------------
1746
Parameters:
1733
Parameters:
1747
  * eax = 37 - function number
1734
  * eax = 37 - function number
1748
  * ebx = 6 - subfunction number
1735
  * ebx = 6 - subfunction number
1749
  * ecx = cursor handle
1736
  * ecx = cursor handle
1750
Returned value:
1737
Returned value:
1751
  * eax destroyed
1738
  * eax destroyed
1752
Remarks:
1739
Remarks:
1753
  * The cursor must be loaded previously by the current thread
1740
  * The cursor must be loaded previously by the current thread
1754
    (with the call to subfunction 4). The function does not delete
1741
    (with the call to subfunction 4). The function does not delete
1755
    system cursors and cursors, loaded by another applications.
1742
    system cursors and cursors, loaded by another applications.
1756
  * If the active cursor (set by subfunction 5) is deleted,
1743
  * If the active cursor (set by subfunction 5) is deleted,
1757
    the system restores the default cursor (standard arrow).
1744
    the system restores the default cursor (standard arrow).
1758
 
1745
 
1759
------------------ Subfunction 7 - get scroll data -------------------
1746
------------------ Subfunction 7 - get scroll data -------------------
1760
Parameters:
1747
Parameters:
1761
  * eax = 37 - function number
1748
  * eax = 37 - function number
1762
  * ebx = 7 - subfunction number
1749
  * ebx = 7 - subfunction number
1763
Returned value:
1750
Returned value:
1764
  * eax = [horizontal offset]*65536 + [vertical offset]
1751
  * eax = [horizontal offset]*65536 + [vertical offset]
1765
Remarks:
1752
Remarks:
1766
  * Scroll data is available for active window only.
1753
  * Scroll data is available for active window only.
1767
  * Values are zeroed after reading.
1754
  * Values are zeroed after reading.
1768
  * Values are signed.
1755
  * Values are signed.
1769
 
1756
 
1770
======================================================================
1757
======================================================================
1771
====================== Function 38 - draw line. ======================
1758
====================== Function 38 - draw line. ======================
1772
======================================================================
1759
======================================================================
1773
Parameters:
1760
Parameters:
1774
  * eax = 38 - function number
1761
  * eax = 38 - function number
1775
  * ebx = [start coordinate on axis x]*65536 +
1762
  * ebx = [start coordinate on axis x]*65536 +
1776
              [end coordinate on axis x]
1763
              [end coordinate on axis x]
1777
  * ecx = [start coordinate on axis y]*65536 +
1764
  * ecx = [start coordinate on axis y]*65536 +
1778
              [end coordinate on axis y]
1765
              [end coordinate on axis y]
1779
  * edx = 0x00RRGGBB - color
1766
  * edx = 0x00RRGGBB - color
1780
    edx = 0x01xxxxxx - draw inversed line
1767
    edx = 0x01xxxxxx - draw inversed line
1781
          (low 24 bits are ignored)
1768
          (low 24 bits are ignored)
1782
Returned value:
1769
Returned value:
1783
  * function does not return value
1770
  * function does not return value
1784
Remarks:
1771
Remarks:
1785
  * Coordinates are relative to the window.
1772
  * Coordinates are relative to the window.
1786
  * End point is also drawn.
1773
  * End point is also drawn.
1787
 
1774
 
1788
======================================================================
1775
======================================================================
1789
== Function 39, subfunction 1 - get a size of the background image. ==
1776
== Function 39, subfunction 1 - get a size of the background image. ==
1790
======================================================================
1777
======================================================================
1791
Parameters:
1778
Parameters:
1792
  * eax = 39 - function number
1779
  * eax = 39 - function number
1793
  * ebx = 1 - subfunction number
1780
  * ebx = 1 - subfunction number
1794
Returned value:
1781
Returned value:
1795
  * eax = [width]*65536 + [height]
1782
  * eax = [width]*65536 + [height]
1796
Remarks:
1783
Remarks:
1797
  * There is a pair function to set sizes of background image -
1784
  * There is a pair function to set sizes of background image -
1798
    subfunction 1 of function 15. After which it is necessary,
1785
    subfunction 1 of function 15. After which it is necessary,
1799
    of course, anew to define image.
1786
    of course, anew to define image.
1800
 
1787
 
1801
======================================================================
1788
======================================================================
1802
== Function 39, subfunction 2 - get pixel from the background image. =
1789
== Function 39, subfunction 2 - get pixel from the background image. =
1803
======================================================================
1790
======================================================================
1804
Parameters:
1791
Parameters:
1805
  * eax = 39 - function number
1792
  * eax = 39 - function number
1806
  * ebx = 2 - subfunction number
1793
  * ebx = 2 - subfunction number
1807
  * ecx = offset
1794
  * ecx = offset
1808
Returned value:
1795
Returned value:
1809
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1796
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1810
    (less than 0x160000-16)
1797
    (less than 0x160000-16)
1811
  * eax = 2 otherwise
1798
  * eax = 2 otherwise
1812
Remarks:
1799
Remarks:
1813
  * Do not rely on returned value for invalid offsets, it may be
1800
  * Do not rely on returned value for invalid offsets, it may be
1814
    changed in future kernel versions.
1801
    changed in future kernel versions.
1815
  * Offset for pixel with coordinates (x,y)
1802
  * Offset for pixel with coordinates (x,y)
1816
    is calculated as (x+y*xsize)*3.
1803
    is calculated as (x+y*xsize)*3.
1817
  * There is a pair function to set pixel on the background image -
1804
  * There is a pair function to set pixel on the background image -
1818
    subfunction 2 of function 15.
1805
    subfunction 2 of function 15.
1819
 
1806
 
1820
======================================================================
1807
======================================================================
1821
== Function 39, subfunction 4 - get drawing mode for the background. =
1808
== Function 39, subfunction 4 - get drawing mode for the background. =
1822
======================================================================
1809
======================================================================
1823
Parameters:
1810
Parameters:
1824
  * eax = 39 - function number
1811
  * eax = 39 - function number
1825
  * ebx = 4 - subfunction number
1812
  * ebx = 4 - subfunction number
1826
Returned value:
1813
Returned value:
1827
  * eax = 1 - tile
1814
  * eax = 1 - tile
1828
  * eax = 2 - stretch
1815
  * eax = 2 - stretch
1829
Remarks:
1816
Remarks:
1830
  * There is a pair function to set drawing mode -
1817
  * There is a pair function to set drawing mode -
1831
    subfunction 4 of function 15.
1818
    subfunction 4 of function 15.
1832
 
1819
 
1833
======================================================================
1820
======================================================================
1834
=========== Function 40 - set the mask for expected events. ==========
1821
=========== Function 40 - set the mask for expected events. ==========
1835
======================================================================
1822
======================================================================
1836
The mask for expected events affects function working with events
1823
The mask for expected events affects function working with events
1837
10, 11, 23 - they notify only about events allowed by this mask.
1824
10, 11, 23 - they notify only about events allowed by this mask.
1838
Parameters:
1825
Parameters:
1839
  * eax = 40 - function number
1826
  * eax = 40 - function number
1840
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1827
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1841
    (set bit permits notice on event)
1828
    (set bit permits notice on event)
1842
    bit 31: mouse active/inactive filter
1829
    bit 31: mouse active/inactive filter
1843
    bit 31 = 0 - inactive window receive mouse events
1830
    bit 31 = 0 - inactive window receive mouse events
1844
    bit 31 = 1 - inactive window does not receive mouse events
1831
    bit 31 = 1 - inactive window does not receive mouse events
1845
    bit 30: cursor position filter
1832
    bit 30: cursor position filter
1846
    bit 30 = 0 = the window receive mouse events if cursor
1833
    bit 30 = 0 = the window receive mouse events if cursor
1847
                 outside window
1834
                 outside window
1848
    bit 30 = 1 - the window does not receive mouse events if cursor
1835
    bit 30 = 1 - the window does not receive mouse events if cursor
1849
                 outside window
1836
                 outside window
1850
Returned value:
1837
Returned value:
1851
  * eax = previous value of mask
1838
  * eax = previous value of mask
1852
Remarks:
1839
Remarks:
1853
  * Default mask (7=111b) enables nofices about redraw,
1840
  * Default mask (7=111b) enables nofices about redraw,
1854
    keys and buttons. This is enough for many applications.
1841
    keys and buttons. This is enough for many applications.
1855
  * Events prohibited in the mask are saved anyway, when come;
1842
  * Events prohibited in the mask are saved anyway, when come;
1856
    they are simply not informed with event functions.
1843
    they are simply not informed with event functions.
1857
  * Event functions take into account the mask on moment of
1844
  * Event functions take into account the mask on moment of
1858
    function call, not on moment of event arrival.
1845
    function call, not on moment of event arrival.
1859
 
1846
 
1860
 
1847
 
1861
======================================================================
1848
======================================================================
1862
================ Function 43 - input/output to a port. ===============
1849
================ Function 43 - input/output to a port. ===============
1863
======================================================================
1850
======================================================================
1864
 
1851
 
1865
------------------------ Output data to port -------------------------
1852
------------------------ Output data to port -------------------------
1866
Parameters:
1853
Parameters:
1867
  * eax = 43 - function number
1854
  * eax = 43 - function number
1868
  * bl = byte for output
1855
  * bl = byte for output
1869
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1856
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1870
Returned value:
1857
Returned value:
1871
  * eax = 0 - success
1858
  * eax = 0 - success
1872
  * eax = 1 - the thread has not reserved the selected port
1859
  * eax = 1 - the thread has not reserved the selected port
1873
 
1860
 
1874
------------------------ Input data from port ------------------------
1861
------------------------ Input data from port ------------------------
1875
Parameters:
1862
Parameters:
1876
  * eax = 43 - function number
1863
  * eax = 43 - function number
1877
  * ebx is ignored
1864
  * ebx is ignored
1878
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1865
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1879
Returned value:
1866
Returned value:
1880
  * eax = 0 - success, thus ebx = entered byte
1867
  * eax = 0 - success, thus ebx = entered byte
1881
  * eax = 1 - the thread has not reserved the selected port
1868
  * eax = 1 - the thread has not reserved the selected port
1882
Remarks:
1869
Remarks:
1883
  * Previously the thread must reserve the selected port
1870
  * Previously the thread must reserve the selected port
1884
    for itself by function 46.
1871
    for itself by function 46.
1885
  * Instead of call to this function it is better to use
1872
  * Instead of call to this function it is better to use
1886
    processor instructions in/out - this is much
1873
    processor instructions in/out - this is much
1887
    faster and a bit shorter and easier.
1874
    faster and a bit shorter and easier.
1888
 
1875
 
1889
 
1876
 
1890
======================================================================
1877
======================================================================
1891
====== Function 46 - reserve/free a group of input/output ports. =====
1878
====== Function 46 - reserve/free a group of input/output ports. =====
1892
======================================================================
1879
======================================================================
1893
To work with reserved ports an application can access directly by
1880
To work with reserved ports an application can access directly by
1894
commands in/out (recommended way) and can use function 43
1881
commands in/out (recommended way) and can use function 43
1895
(not recommended way).
1882
(not recommended way).
1896
Parameters:
1883
Parameters:
1897
  * eax = 46 - function number
1884
  * eax = 46 - function number
1898
  * ebx = 0 - reserve, 1 - free
1885
  * ebx = 0 - reserve, 1 - free
1899
  * ecx = start port number
1886
  * ecx = start port number
1900
  * edx = end port number (inclusive)
1887
  * edx = end port number (inclusive)
1901
Returned value:
1888
Returned value:
1902
  * eax = 0 - success
1889
  * eax = 0 - success
1903
  * eax = 1 - error
1890
  * eax = 1 - error
1904
Remarks:
1891
Remarks:
1905
  * For ports reservation: an error occurs if and only if
1892
  * For ports reservation: an error occurs if and only if
1906
    one from the following condition satisfies:
1893
    one from the following condition satisfies:
1907
    * start port is more than end port;
1894
    * start port is more than end port;
1908
    * the selected range contains incorrect port number
1895
    * the selected range contains incorrect port number
1909
      (correct are from 0 to 0xFFFF);
1896
      (correct are from 0 to 0xFFFF);
1910
    * limit for the total number of reserved areas is exceeded
1897
    * limit for the total number of reserved areas is exceeded
1911
      (maximum 255 are allowed);
1898
      (maximum 255 are allowed);
1912
    * the selected range intersects with any of earlier reserved
1899
    * the selected range intersects with any of earlier reserved
1913
  * For ports free: an error is an attempt to free range,
1900
  * For ports free: an error is an attempt to free range,
1914
    that was not earlier reserved by this function
1901
    that was not earlier reserved by this function
1915
    (with same ecx,edx).
1902
    (with same ecx,edx).
1916
  * If an error occurs (for both cases) function performs no action.
1903
  * If an error occurs (for both cases) function performs no action.
1917
  * At booting the system reserves for itself ports
1904
  * At booting the system reserves for itself ports
1918
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
1905
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
1919
  * When a thread terminates, all reserved by it ports
1906
  * When a thread terminates, all reserved by it ports
1920
    are freed automatically.
1907
    are freed automatically.
1921
 
1908
 
1922
======================================================================
1909
======================================================================
1923
============= Function 47 - draw a number in the window. =============
1910
============= Function 47 - draw a number in the window. =============
1924
======================================================================
1911
======================================================================
1925
Parameters:
1912
Parameters:
1926
  * eax = 47 - function number
1913
  * eax = 47 - function number
1927
  * ebx = parameters of conversion number to text:
1914
  * ebx = parameters of conversion number to text:
1928
    * bl = 0 - ecx contains number
1915
    * bl = 0 - ecx contains number
1929
    * bl = 1 - ecx contains pointer to dword/qword-number
1916
    * bl = 1 - ecx contains pointer to dword/qword-number
1930
    * bh = 0 - display in decimal number system
1917
    * bh = 0 - display in decimal number system
1931
    * bh = 1 - display in hexadecimal system
1918
    * bh = 1 - display in hexadecimal system
1932
    * bh = 2 - display in binary system
1919
    * bh = 2 - display in binary system
1933
    * bits 16-21 = how many digits to display
1920
    * bits 16-21 = how many digits to display
1934
    * bits 22-29 reserved and must be set to 0
1921
    * bits 22-29 reserved and must be set to 0
1935
    * bit 30 set = display qword (64-bit) number (must be bl=1)
1922
    * bit 30 set = display qword (64-bit) number (must be bl=1)
1936
    * bit 31 set = do not display leading zeroes of the number
1923
    * bit 31 set = do not display leading zeroes of the number
1937
  * ecx = number (if bl=0) or pointer (if bl=1)
1924
  * ecx = number (if bl=0) or pointer (if bl=1)
1938
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1925
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1939
  * esi = 0xX0RRGGBB:
1926
  * esi = 0xX0RRGGBB:
1940
    * RR, GG, BB specify the color
1927
    * RR, GG, BB specify the color
1941
    * X = ABnn (bits)
1928
    * X = ABnn (bits)
1942
    * nn = font (0/1)
1929
    * nn = font (0/1)
1943
    * A is ignored
1930
    * A is ignored
1944
    * B=1 - fill background with the color edi
1931
    * B=1 - fill background with the color edi
1945
Returned value:
1932
Returned value:
1946
  * function does not return value
1933
  * function does not return value
1947
Remarks:
1934
Remarks:
1948
  * The given length must not exceed 60.
1935
  * The given length must not exceed 60.
1949
  * The exactly given amount of digits is output. If number is small
1936
  * The exactly given amount of digits is output. If number is small
1950
    and can be written by smaller amount of digits, it is supplemented
1937
    and can be written by smaller amount of digits, it is supplemented
1951
    by leading zeroes; if the number is big and can not be written by
1938
    by leading zeroes; if the number is big and can not be written by
1952
    given amount of digits, extra digits are not drawn.
1939
    given amount of digits, extra digits are not drawn.
1953
  * Parameters of fonts are shown in the description of function 4
1940
  * Parameters of fonts are shown in the description of function 4
1954
    (text output).
1941
    (text output).
1955
 
1942
 
1956
======================================================================
1943
======================================================================
1957
========= Function 48, subfunction 0 - apply screen settings. ========
1944
========= Function 48, subfunction 0 - apply screen settings. ========
1958
======================================================================
1945
======================================================================
1959
Parameters:
1946
Parameters:
1960
  * eax = 48 - function number
1947
  * eax = 48 - function number
1961
  * ebx = 0 - subfunction number
1948
  * ebx = 0 - subfunction number
1962
  * ecx = 0 - reserved
1949
  * ecx = 0 - reserved
1963
Returned value:
1950
Returned value:
1964
  * function does not return value
1951
  * function does not return value
1965
Remarks:
1952
Remarks:
1966
  * Function redraws the screen after parameters change by
1953
  * Function redraws the screen after parameters change by
1967
    subfunctions 1 and 2.
1954
    subfunctions 1 and 2.
1968
  * Function call without prior call to one of indicated subfunctions
1955
  * Function call without prior call to one of indicated subfunctions
1969
    is ignored.
1956
    is ignored.
1970
  * Function call with nonzero ecx is ignored.
1957
  * Function call with nonzero ecx is ignored.
1971
 
1958
 
1972
======================================================================
1959
======================================================================
1973
=========== Function 48, subfunction 1 - set button style. ===========
1960
=========== Function 48, subfunction 1 - set button style. ===========
1974
======================================================================
1961
======================================================================
1975
Parameters:
1962
Parameters:
1976
  * eax = 48 - function number
1963
  * eax = 48 - function number
1977
  * ebx = 1 - subfunction number
1964
  * ebx = 1 - subfunction number
1978
  * ecx = button style:
1965
  * ecx = button style:
1979
    * 0 = flat
1966
    * 0 = flat
1980
    * 1 = 3d
1967
    * 1 = 3d
1981
Returned value:
1968
Returned value:
1982
  * function does not return value
1969
  * function does not return value
1983
Remarks:
1970
Remarks:
1984
  * After call to this function one should redraw the screen by
1971
  * After call to this function one should redraw the screen by
1985
    subfunction 0.
1972
    subfunction 0.
1986
  * Button style influences only to their draw of function 8.
1973
  * Button style influences only to their draw of function 8.
1987
 
1974
 
1988
======================================================================
1975
======================================================================
1989
====== Function 48, subfunction 2 - set standard window colors. ======
1976
====== Function 48, subfunction 2 - set standard window colors. ======
1990
======================================================================
1977
======================================================================
1991
Parameters:
1978
Parameters:
1992
  * eax = 48 - function number
1979
  * eax = 48 - function number
1993
  * ebx = 2 - subfunction number
1980
  * ebx = 2 - subfunction number
1994
  * ecx = pointer to the color table
1981
  * ecx = pointer to the color table
1995
  * edx = size of the color table
1982
  * edx = size of the color table
1996
    (must be 40 bytes for future compatibility)
1983
    (must be 40 bytes for future compatibility)
1997
Format of the color table is shown in description of subfunction 3.
1984
Format of the color table is shown in description of subfunction 3.
1998
Returned value:
1985
Returned value:
1999
  * function does not return value
1986
  * function does not return value
2000
Remarks:
1987
Remarks:
2001
  * After call to this function one should redraw the screen by
1988
  * After call to this function one should redraw the screen by
2002
    subfunction 0.
1989
    subfunction 0.
2003
  * Table of standard colors influences only to applications,
1990
  * Table of standard colors influences only to applications,
2004
    which receive this table obviously (by subfunction 3)
1991
    which receive this table obviously (by subfunction 3)
2005
    and use it (specifying colors from it to drawing functions).
1992
    and use it (specifying colors from it to drawing functions).
2006
  * Table of standard colors is included in skin and is installed
1993
  * Table of standard colors is included in skin and is installed
2007
    anew with skin installation (by subfunction 8).
1994
    anew with skin installation (by subfunction 8).
2008
  * Color table can be viewed/changed interactively with
1995
  * Color table can be viewed/changed interactively with
2009
    the application 'desktop'.
1996
    the application 'desktop'.
2010
 
1997
 
2011
======================================================================
1998
======================================================================
2012
====== Function 48, subfunction 3 - get standard window colors. ======
1999
====== Function 48, subfunction 3 - get standard window colors. ======
2013
======================================================================
2000
======================================================================
2014
Parameters:
2001
Parameters:
2015
  * eax = 48 - function number
2002
  * eax = 48 - function number
2016
  * ebx = 3 - subfunction number
2003
  * ebx = 3 - subfunction number
2017
  * ecx = pointer to the buffer with size edx bytes,
2004
  * ecx = pointer to the buffer with size edx bytes,
2018
    where table will be written
2005
    where table will be written
2019
  * edx = size of color table
2006
  * edx = size of color table
2020
    (must be 40 bytes for future compatibility)
2007
    (must be 40 bytes for future compatibility)
2021
Returned value:
2008
Returned value:
2022
  * function does not return value
2009
  * function does not return value
2023
Format of the color table:
2010
Format of the color table:
2024
each item is dword-value for color 0x00RRGGBB
2011
each item is dword-value for color 0x00RRGGBB
2025
  * +0: dword: frames - color of frame
2012
  * +0: dword: frames - color of frame
2026
  * +4: dword: grab - color of header
2013
  * +4: dword: grab - color of header
2027
  * +8: dword: grab_button - color of button on header bar
2014
  * +8: dword: grab_button - color of button on header bar
2028
  * +12 = +0xC: dword: grab_button_text - color of text on button
2015
  * +12 = +0xC: dword: grab_button_text - color of text on button
2029
    on header bar
2016
    on header bar
2030
  * +16 = +0x10: dword: grab_text - color of text on header
2017
  * +16 = +0x10: dword: grab_text - color of text on header
2031
  * +20 = +0x14: dword: work - color of working area
2018
  * +20 = +0x14: dword: work - color of working area
2032
  * +24 = +0x18: dword: work_button - color of button in working area
2019
  * +24 = +0x18: dword: work_button - color of button in working area
2033
  * +28 = +0x1C: dword: work_button_text - color of text on button
2020
  * +28 = +0x1C: dword: work_button_text - color of text on button
2034
    in working area
2021
    in working area
2035
  * +32 = +0x20: dword: work_text - color of text in working area
2022
  * +32 = +0x20: dword: work_text - color of text in working area
2036
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2023
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2037
Remarks:
2024
Remarks:
2038
  * Structure of the color table is described in the standard
2025
  * Structure of the color table is described in the standard
2039
    include file 'macros.inc' as 'system_colors'; for example,
2026
    include file 'macros.inc' as 'system_colors'; for example,
2040
    it is possible to write:
2027
    it is possible to write:
2041
        sc      system_colors           ; variable declaration
2028
        sc      system_colors           ; variable declaration
2042
        ...                             ; somewhere one must call
2029
        ...                             ; somewhere one must call
2043
                                        ; this function with ecx=sc
2030
                                        ; this function with ecx=sc
2044
        mov     ecx, [sc.work_button_text]      ; read text color on
2031
        mov     ecx, [sc.work_button_text]      ; read text color on
2045
                                        ; buttin in working area
2032
                                        ; buttin in working area
2046
  * A program itself desides to use or not to use color table.
2033
  * A program itself desides to use or not to use color table.
2047
    For usage program must simply at calls to drawing functions select
2034
    For usage program must simply at calls to drawing functions select
2048
    color taken from the table.
2035
    color taken from the table.
2049
  * At change of the table of standard colors (by subfunction 2 with
2036
  * At change of the table of standard colors (by subfunction 2 with
2050
    the subsequent application of changes by subfunction 0 or
2037
    the subsequent application of changes by subfunction 0 or
2051
    at skin set by subfunction 8) the system sends to all windows
2038
    at skin set by subfunction 8) the system sends to all windows
2052
    redraw message (the event with code 1).
2039
    redraw message (the event with code 1).
2053
  * Color table can be viewed/changed interactively with
2040
  * Color table can be viewed/changed interactively with
2054
    the application 'desktop'.
2041
    the application 'desktop'.
2055
 
2042
 
2056
======================================================================
2043
======================================================================
2057
============ Function 48, subfunction 4 - get skin height. ===========
2044
============ Function 48, subfunction 4 - get skin height. ===========
2058
======================================================================
2045
======================================================================
2059
Parameters:
2046
Parameters:
2060
  * eax = 48 - function number
2047
  * eax = 48 - function number
2061
  * ebx = 4 - subfunction number
2048
  * ebx = 4 - subfunction number
2062
Returned value:
2049
Returned value:
2063
  * eax = skin height
2050
  * eax = skin height
2064
Remarks:
2051
Remarks:
2065
  * Skin height is defined as the height of a header
2052
  * Skin height is defined as the height of a header
2066
    of skinned windows.
2053
    of skinned windows.
2067
  * See also general structure of window in the description
2054
  * See also general structure of window in the description
2068
    of function 0.
2055
    of function 0.
2069
 
2056
 
2070
======================================================================
2057
======================================================================
2071
======== Function 48, subfunction 5 - get screen working area. =======
2058
======== Function 48, subfunction 5 - get screen working area. =======
2072
======================================================================
2059
======================================================================
2073
Parameters:
2060
Parameters:
2074
  * eax = 48 - function number
2061
  * eax = 48 - function number
2075
  * ebx = 5 - subfunction number
2062
  * ebx = 5 - subfunction number
2076
Returned value:
2063
Returned value:
2077
  * eax = [left]*65536 + [right]
2064
  * eax = [left]*65536 + [right]
2078
  * ebx = [top]*65536 + [bottom]
2065
  * ebx = [top]*65536 + [bottom]
2079
Remarks:
2066
Remarks:
2080
  * The screen working area defines position and coordinates of
2067
  * The screen working area defines position and coordinates of
2081
    a maximized window.
2068
    a maximized window.
2082
  * The screen working area in view of normal work is all screen
2069
  * The screen working area in view of normal work is all screen
2083
    without taskbar ('@taskbar' application).
2070
    without taskbar ('@taskbar' application).
2084
  * (left,top) are coordinates of the left upper corner,
2071
  * (left,top) are coordinates of the left upper corner,
2085
    (right,bottom) are coordinates of the right lower one.
2072
    (right,bottom) are coordinates of the right lower one.
2086
    Thus the size of working area on x axis can be calculated by
2073
    Thus the size of working area on x axis can be calculated by
2087
    formula right-left+1, on y axis - by formula bottom-right+1.
2074
    formula right-left+1, on y axis - by formula bottom-right+1.
2088
  * See also function 14,
2075
  * See also function 14,
2089
    to get sizes of all screen.
2076
    to get sizes of all screen.
2090
  * There is a pair function to set working area - subfunction 6.
2077
  * There is a pair function to set working area - subfunction 6.
2091
 
2078
 
2092
======================================================================
2079
======================================================================
2093
======== Function 48, subfunction 6 - set screen working area. =======
2080
======== Function 48, subfunction 6 - set screen working area. =======
2094
======================================================================
2081
======================================================================
2095
Parameters:
2082
Parameters:
2096
  * eax = 48 - function number
2083
  * eax = 48 - function number
2097
  * ebx = 6 - subfunction number
2084
  * ebx = 6 - subfunction number
2098
  * ecx = [left]*65536 + [right]
2085
  * ecx = [left]*65536 + [right]
2099
  * edx = [top]*65536 + [bottom]
2086
  * edx = [top]*65536 + [bottom]
2100
Returned value:
2087
Returned value:
2101
  * function does not return value
2088
  * function does not return value
2102
Remarks:
2089
Remarks:
2103
  * The screen working area defines position and coordinates of
2090
  * The screen working area defines position and coordinates of
2104
    a maximized window.
2091
    a maximized window.
2105
  * This function is used only by the application '@taskbar',
2092
  * This function is used only by the application '@taskbar',
2106
    which set working area to all screen without taskbar.
2093
    which set working area to all screen without taskbar.
2107
  * (left,top) are coordinates of the left upper corner,
2094
  * (left,top) are coordinates of the left upper corner,
2108
    (right,bottom) are coordinates of the right lower one.
2095
    (right,bottom) are coordinates of the right lower one.
2109
    Thus the size of working area on x axis can be calculated by
2096
    Thus the size of working area on x axis can be calculated by
2110
    formula right-left+1, on y axis - by formula bottom-right+1.
2097
    formula right-left+1, on y axis - by formula bottom-right+1.
2111
  * If 'left'>='right', x-coordinate of working area is not changed.
2098
  * If 'left'>='right', x-coordinate of working area is not changed.
2112
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2099
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2113
    equal to screen width, 'right' will not be set.
2100
    equal to screen width, 'right' will not be set.
2114
    Similarly on y axis.
2101
    Similarly on y axis.
2115
  * See also function 14,
2102
  * See also function 14,
2116
    to get sizes of all screen.
2103
    to get sizes of all screen.
2117
  * There is a pair function to get working area - subfunction 5.
2104
  * There is a pair function to get working area - subfunction 5.
2118
  * This function redraws the screen automatically,
2105
  * This function redraws the screen automatically,
2119
    updating coordinates and sizes of maximized windows.
2106
    updating coordinates and sizes of maximized windows.
2120
    The system sends to all windows redraw message (the event 1).
2107
    The system sends to all windows redraw message (the event 1).
2121
 
2108
 
2122
======================================================================
2109
======================================================================
2123
=========== Function 48, subfunction 7 - get skin margins. ===========
2110
=========== Function 48, subfunction 7 - get skin margins. ===========
2124
======================================================================
2111
======================================================================
2125
Returns the area of a header of a skinned window, intended for
2112
Returns the area of a header of a skinned window, intended for
2126
a text of a header.
2113
a text of a header.
2127
Parameters:
2114
Parameters:
2128
  * eax = 48 - function number
2115
  * eax = 48 - function number
2129
  * ebx = 7 - subfunction number
2116
  * ebx = 7 - subfunction number
2130
Returned value:
2117
Returned value:
2131
  * eax = [left]*65536 + [right]
2118
  * eax = [left]*65536 + [right]
2132
  * ebx = [top]*65536 + [bottom]
2119
  * ebx = [top]*65536 + [bottom]
2133
Remarks:
2120
Remarks:
2134
  * An application decides itself to use or not to use this function.
2121
  * An application decides itself to use or not to use this function.
2135
  * It is recommended to take into account returned value
2122
  * It is recommended to take into account returned value
2136
    of this function for choice of a place for drawing header text
2123
    of this function for choice of a place for drawing header text
2137
    (by function 4) or a substitute of header text
2124
    (by function 4) or a substitute of header text
2138
    (at the discretion of an application).
2125
    (at the discretion of an application).
2139
 
2126
 
2140
======================================================================
2127
======================================================================
2141
============= Function 48, subfunction 8 - set used skin. ============
2128
============= Function 48, subfunction 8 - set used skin. ============
2142
======================================================================
2129
======================================================================
2143
Parameters:
2130
Parameters:
2144
  * eax = 48 - function number
2131
  * eax = 48 - function number
2145
  * ebx = 8 - subfunction number
2132
  * ebx = 8 - subfunction number
2146
  * ecx = pointer to filename of the skin
2133
  * ecx = pointer to filename of the skin
2147
Returned value:
2134
Returned value:
2148
  * eax = 0 - success
2135
  * eax = 0 - success
2149
  * otherwise eax = file system error code; if file does not
2136
  * otherwise eax = file system error code; if file does not
2150
    contain valid skin, function returns error 3
2137
    contain valid skin, function returns error 3
2151
    (unknown file system).
2138
    (unknown file system).
2152
Remarks:
2139
Remarks:
2153
  * After successful skin loading the system sends to all windows
2140
  * After successful skin loading the system sends to all windows
2154
    redraw message (the event 1).
2141
    redraw message (the event 1).
2155
  * At booting the system reads skin from file 'default.skn'
2142
  * At booting the system reads skin from file 'default.skn'
2156
    on ramdisk.
2143
    on ramdisk.
2157
  * User can change the skin statically by creating hisself
2144
  * User can change the skin statically by creating hisself
2158
    'default.skn' or dynamically with the application 'desktop'.
2145
    'default.skn' or dynamically with the application 'desktop'.
2159
 
2146
 
2160
======================================================================
2147
======================================================================
2161
====== Function 48, subfunction 9 - get font smoothing setting. ======
2148
====== Function 48, subfunction 9 - get font smoothing setting. ======
2162
======================================================================
2149
======================================================================
2163
Parameters:
2150
Parameters:
2164
  * eax = 48 - function number
2151
  * eax = 48 - function number
2165
  * ebx = 9 - subfunction number
2152
  * ebx = 9 - subfunction number
2166
Returned value:
2153
Returned value:
2167
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2154
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2168
 
2155
 
2169
======================================================================
2156
======================================================================
2170
========== Function 48, subfunction 10 - set font smoothing. =========
2157
========== Function 48, subfunction 10 - set font smoothing. =========
2171
======================================================================
2158
======================================================================
2172
Parameters:
2159
Parameters:
2173
  * eax = 48 - function number
2160
  * eax = 48 - function number
2174
  * ebx = 10 - subfunction number
2161
  * ebx = 10 - subfunction number
2175
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2162
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2176
 
2163
 
2177
======================================================================
2164
======================================================================
2178
============ Function 48, subfunction 11 - get font size. ============
2165
============ Function 48, subfunction 11 - get font size. ============
2179
======================================================================
2166
======================================================================
2180
Parameters:
2167
Parameters:
2181
  * eax = 48 - function number
2168
  * eax = 48 - function number
2182
  * ebx = 9 - subfunction number
2169
  * ebx = 9 - subfunction number
2183
Returned value:
2170
Returned value:
2184
  * eax = current font height in pixels
2171
  * eax = current font height in pixels
2185
 
2172
 
2186
======================================================================
2173
======================================================================
2187
============ Function 48, subfunction 12 - set font size. ============
2174
============ Function 48, subfunction 12 - set font size. ============
2188
======================================================================
2175
======================================================================
2189
Parameters:
2176
Parameters:
2190
  * eax = 48 - function number
2177
  * eax = 48 - function number
2191
  * ebx = 10 - subfunction number
2178
  * ebx = 10 - subfunction number
2192
  * cl  = new font height in pixels
2179
  * cl  = new font height in pixels
2193
 
2180
 
2194
======================================================================
2181
======================================================================
2195
=========== Function 49 - Advanced Power Management (APM). ===========
2182
=========== Function 49 - Advanced Power Management (APM). ===========
2196
======================================================================
2183
======================================================================
2197
Parameters:
2184
Parameters:
2198
  * eax = 49 - function number
2185
  * eax = 49 - function number
2199
  * dx = number of the APM function
2186
  * dx = number of the APM function
2200
    (analogue of ax in APM specification)
2187
    (analogue of ax in APM specification)
2201
  * bx, cx = parameters of the APM function
2188
  * bx, cx = parameters of the APM function
2202
Returned value:
2189
Returned value:
2203
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2190
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2204
    are set according to the APM specification
2191
    are set according to the APM specification
2205
  * high halves of 32-bit registers eax, ebx, ecx,
2192
  * high halves of 32-bit registers eax, ebx, ecx,
2206
    edx, esi, edi are destroyed
2193
    edx, esi, edi are destroyed
2207
Remarks:
2194
Remarks:
2208
  * APM 1.2 specification is described in the document
2195
  * APM 1.2 specification is described in the document
2209
    "Advanced Power Management (APM) BIOS Specification"
2196
    "Advanced Power Management (APM) BIOS Specification"
2210
    (Revision 1.2), available at
2197
    (Revision 1.2), available at
2211
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2198
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2212
    besides it is included in famous Interrupt List by Ralf Brown
2199
    besides it is included in famous Interrupt List by Ralf Brown
2213
    (http://www.pobox.com/~ralf/files.html,
2200
    (http://www.pobox.com/~ralf/files.html,
2214
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2201
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2215
 
2202
 
2216
======================================================================
2203
======================================================================
2217
=================== Function 50 - set window shape. ==================
2204
=================== Function 50 - set window shape. ==================
2218
======================================================================
2205
======================================================================
2219
Normal windows have rectangular shape. This function can give to
2206
Normal windows have rectangular shape. This function can give to
2220
a window any shape. The shape is given by a set of points inside
2207
a window any shape. The shape is given by a set of points inside
2221
the base rectangle belonging to a window. Position and coordinates
2208
the base rectangle belonging to a window. Position and coordinates
2222
of the base rectangle are set by function 0
2209
of the base rectangle are set by function 0
2223
and changed by function 67.
2210
and changed by function 67.
2224
 
2211
 
2225
--------------------------- Set shape data ---------------------------
2212
--------------------------- Set shape data ---------------------------
2226
Parameters:
2213
Parameters:
2227
  * eax = 50 - function number
2214
  * eax = 50 - function number
2228
  * ebx = 0 - subfunction number
2215
  * ebx = 0 - subfunction number
2229
  * ecx = pointer to shape data (array of bytes 0/1)
2216
  * ecx = pointer to shape data (array of bytes 0/1)
2230
Returned value:
2217
Returned value:
2231
  * function does not return value
2218
  * function does not return value
2232
 
2219
 
2233
-------------------------- Set shape scale ---------------------------
2220
-------------------------- Set shape scale ---------------------------
2234
Parameters:
2221
Parameters:
2235
  * eax = 50 - function number
2222
  * eax = 50 - function number
2236
  * ebx = 1 - subfunction number
2223
  * ebx = 1 - subfunction number
2237
  * ecx sets a scale: each byte of data defines
2224
  * ecx sets a scale: each byte of data defines
2238
    (2^scale)*(2^scale) pixels
2225
    (2^scale)*(2^scale) pixels
2239
Returned value:
2226
Returned value:
2240
  * function does not return value
2227
  * function does not return value
2241
Remarks:
2228
Remarks:
2242
  * Default scale is 0 (scale factor is 1). If in the shape data
2229
  * Default scale is 0 (scale factor is 1). If in the shape data
2243
    one byte corresponds to one pixel, there is no necessity
2230
    one byte corresponds to one pixel, there is no necessity
2244
    to set scale.
2231
    to set scale.
2245
  * Let's designate xsize = window width (in pixels), ysize = height;
2232
  * Let's designate xsize = window width (in pixels), ysize = height;
2246
    pay attention, that they are one pixel more than defined by
2233
    pay attention, that they are one pixel more than defined by
2247
    functions 0, 67.
2234
    functions 0, 67.
2248
  * On definition of scale xsize and ysize must be divisible
2235
  * On definition of scale xsize and ysize must be divisible
2249
    on 2^scale.
2236
    on 2^scale.
2250
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2237
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2251
    to a window of square with the side 2^scale (if scale=0,
2238
    to a window of square with the side 2^scale (if scale=0,
2252
    this is one pixel) and coordinates of the left upper corner
2239
    this is one pixel) and coordinates of the left upper corner
2253
    (a mod (xsize shr scale), a div (xsize shr scale))
2240
    (a mod (xsize shr scale), a div (xsize shr scale))
2254
  * Data size: (xsize shr scale)*(ysize shr scale).
2241
  * Data size: (xsize shr scale)*(ysize shr scale).
2255
  * Data must be presented in the memory and not change
2242
  * Data must be presented in the memory and not change
2256
    after set of shape.
2243
    after set of shape.
2257
  * The system views the shape data at every window redraw by
2244
  * The system views the shape data at every window redraw by
2258
    function 0.
2245
    function 0.
2259
  * The call of subfunction 0 with NULL pointer results in return
2246
  * The call of subfunction 0 with NULL pointer results in return
2260
    to the rectangular shape.
2247
    to the rectangular shape.
2261
 
2248
 
2262
======================================================================
2249
======================================================================
2263
==================== Function 51 - create thread. ====================
2250
==================== Function 51 - create thread. ====================
2264
======================================================================
2251
======================================================================
2265
Parameters:
2252
Parameters:
2266
  * eax = 51 - function number
2253
  * eax = 51 - function number
2267
  * ebx = 1 - unique subfunction
2254
  * ebx = 1 - unique subfunction
2268
  * ecx = address of thread entry point (starting eip)
2255
  * ecx = address of thread entry point (starting eip)
2269
  * edx = pointer to thread stack (starting esp)
2256
  * edx = pointer to thread stack (starting esp)
2270
Returned value:
2257
Returned value:
2271
  * eax = -1 - error (there is too many threads)
2258
  * eax = -1 - error (there is too many threads)
2272
  * otherwise eax = TID - thread identifier
2259
  * otherwise eax = TID - thread identifier
2273
    
2260
    
2274
 
2261
 
2275
======================================================================
2262
======================================================================
2276
==================== Function 54, subfunction 0 ======================
2263
==================== Function 54, subfunction 0 ======================
2277
============== Get the number of slots in the clipboard. =============
2264
============== Get the number of slots in the clipboard. =============
2278
======================================================================
2265
======================================================================
2279
Parameters:
2266
Parameters:
2280
  * eax = 54 - function number
2267
  * eax = 54 - function number
2281
  * ebx = 0 - subfunction number
2268
  * ebx = 0 - subfunction number
2282
Returned value:
2269
Returned value:
2283
  * eax = slots in the clipboard
2270
  * eax = slots in the clipboard
2284
  * eax = -1 - main list area not found
2271
  * eax = -1 - main list area not found
2285
 
2272
 
2286
======================================================================
2273
======================================================================
2287
==================== Function 54, subfunction 1 ======================
2274
==================== Function 54, subfunction 1 ======================
2288
================= Read the data from the clipboard. ==================
2275
================= Read the data from the clipboard. ==================
2289
======================================================================
2276
======================================================================
2290
Parameters:
2277
Parameters:
2291
  * eax = 54 - function number
2278
  * eax = 54 - function number
2292
  * ebx = 1 - subfunction number
2279
  * ebx = 1 - subfunction number
2293
  * eсx = slot number
2280
  * eсx = slot number
2294
Returned value:
2281
Returned value:
2295
  * eax = if successful - pointer to a memory with data
2282
  * eax = if successful - pointer to a memory with data
2296
  * eax = 1 - error
2283
  * eax = 1 - error
2297
  * eax = -1 - main list area not found
2284
  * eax = -1 - main list area not found
2298
 
2285
 
2299
======================================================================
2286
======================================================================
2300
==================== Function 54, subfunction 2 ======================
2287
==================== Function 54, subfunction 2 ======================
2301
================= Write the data to the clipboard. ===================
2288
================= Write the data to the clipboard. ===================
2302
======================================================================
2289
======================================================================
2303
Parameters:
2290
Parameters:
2304
  * eax = 54 - function number
2291
  * eax = 54 - function number
2305
  * ebx = 2 - subfunction number
2292
  * ebx = 2 - subfunction number
2306
  * eсx = the number of bytes to be copied
2293
  * eсx = the number of bytes to be copied
2307
  * edx = a pointer to a buffer for data to be copied
2294
  * edx = a pointer to a buffer for data to be copied
2308
Returned value:
2295
Returned value:
2309
  * eax = 0 - success
2296
  * eax = 0 - success
2310
  * eax = 1 - error
2297
  * eax = 1 - error
2311
  * eax = -1 - main list area not found
2298
  * eax = -1 - main list area not found
2312
 
2299
 
2313
======================================================================
2300
======================================================================
2314
===================== Function 54, subfunction 3 =====================
2301
===================== Function 54, subfunction 3 =====================
2315
================ Delete the last slot in the clipboard ===============
2302
================ Delete the last slot in the clipboard ===============
2316
======================================================================
2303
======================================================================
2317
Parameters:
2304
Parameters:
2318
  * eax = 54 - function number
2305
  * eax = 54 - function number
2319
  * ebx = 3 - subfunction number
2306
  * ebx = 3 - subfunction number
2320
Returned value:
2307
Returned value:
2321
  * eax = 0 - success
2308
  * eax = 0 - success
2322
  * eax = 1 - error
2309
  * eax = 1 - error
2323
  * eax = -1 - main list area not found
2310
  * eax = -1 - main list area not found
2324
  
2311
  
2325
======================================================================
2312
======================================================================
2326
===================== Function 54, subfunction 4 =====================
2313
===================== Function 54, subfunction 4 =====================
2327
===================== Alarm reset the lock buffer ====================
2314
===================== Alarm reset the lock buffer ====================
2328
======================================================================
2315
======================================================================
2329
Parameters:
2316
Parameters:
2330
  * eax = 54 - function number
2317
  * eax = 54 - function number
2331
  * ebx = 4 - subfunction number
2318
  * ebx = 4 - subfunction number
2332
Returned value:
2319
Returned value:
2333
  * eax = 0 - success
2320
  * eax = 0 - success
2334
  * eax = -1 - main list area not found or no blocking
2321
  * eax = -1 - main list area not found or no blocking
2335
Remarks:
2322
Remarks:
2336
  * Used in exceptional cases, where no responsible or killed
2323
  * Used in exceptional cases, where no responsible or killed
2337
    application blocked the clipboard operations.
2324
    application blocked the clipboard operations.
2338
 
2325
 
2339
======================================================================
2326
======================================================================
2340
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2327
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2341
======================================================================
2328
======================================================================
2342
Parameters:
2329
Parameters:
2343
  * eax = 55 - function number
2330
  * eax = 55 - function number
2344
  * ebx = 55 - subfunction number
2331
  * ebx = 55 - subfunction number
2345
  * esi = pointer to data
2332
  * esi = pointer to data
2346
Returned value:
2333
Returned value:
2347
  * eax = 0 - success
2334
  * eax = 0 - success
2348
  * eax = 55 - error (speaker is off or busy)
2335
  * eax = 55 - error (speaker is off or busy)
2349
Data is an array of items with variable length.
2336
Data is an array of items with variable length.
2350
Format of each item is defined by first byte:
2337
Format of each item is defined by first byte:
2351
  * 0 = end of data
2338
  * 0 = end of data
2352
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2339
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2353
    is defined by immediate value of frequency
2340
    is defined by immediate value of frequency
2354
    * following word (2 bytes) contains frequency divider;
2341
    * following word (2 bytes) contains frequency divider;
2355
      frequency is defined as 1193180/divider
2342
      frequency is defined as 1193180/divider
2356
  * 0x81 = invalid
2343
  * 0x81 = invalid
2357
  * 0x82..0xFF = note is defined by octave and number:
2344
  * 0x82..0xFF = note is defined by octave and number:
2358
    * duration in 1/100 of second = (first byte)-0x81
2345
    * duration in 1/100 of second = (first byte)-0x81
2359
    * there is one more byte;
2346
    * there is one more byte;
2360
    * (second byte)=0xFF - delay
2347
    * (second byte)=0xFF - delay
2361
    * otherwise it looks like a*0x10+b, where b=number of the note in
2348
    * otherwise it looks like a*0x10+b, where b=number of the note in
2362
      an octave from 1 to 12, a=number of octave (beginning from 0)
2349
      an octave from 1 to 12, a=number of octave (beginning from 0)
2363
Remarks:
2350
Remarks:
2364
  * Speaker play can be disabled/enabled by
2351
  * Speaker play can be disabled/enabled by
2365
    subfunction 8 of function 18.
2352
    subfunction 8 of function 18.
2366
  * Function returns control, having informed the system
2353
  * Function returns control, having informed the system
2367
    an information on request. Play itself goes independently from
2354
    an information on request. Play itself goes independently from
2368
    the program.
2355
    the program.
2369
  * The data must be kept in the memory at least up to the end
2356
  * The data must be kept in the memory at least up to the end
2370
    of play.
2357
    of play.
2371
 
2358
 
2372
======================================================================
2359
======================================================================
2373
======================= Function 57 - PCI BIOS. ======================
2360
======================= Function 57 - PCI BIOS. ======================
2374
======================================================================
2361
======================================================================
2375
Parameters:
2362
Parameters:
2376
  * eax = 57 - function number
2363
  * eax = 57 - function number
2377
  * ebp corresponds to al in PCI BIOS specification
2364
  * ebp corresponds to al in PCI BIOS specification
2378
  * other registers are set according to PCI BIOS specification
2365
  * other registers are set according to PCI BIOS specification
2379
Returned value:
2366
Returned value:
2380
  * CF is undefined
2367
  * CF is undefined
2381
  * other registers are set according to PCI BIOS specification
2368
  * other registers are set according to PCI BIOS specification
2382
Remarks:
2369
Remarks:
2383
  * Many effects of this function can be also achieved with
2370
  * Many effects of this function can be also achieved with
2384
    corresponding subfunctions of function 62.
2371
    corresponding subfunctions of function 62.
2385
  * The function calls PCI32 BIOS extension, documented e.g. in
2372
  * The function calls PCI32 BIOS extension, documented e.g. in
2386
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2373
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2387
  * If BIOS does not support this extension, its behavior is emulated
2374
  * If BIOS does not support this extension, its behavior is emulated
2388
    (through kernel-mode analogues of subfunctions of function 62).
2375
    (through kernel-mode analogues of subfunctions of function 62).
2389
 
2376
 
2390
======================================================================
2377
======================================================================
2391
========== Function 60 - Inter Process Communication (IPC). ==========
2378
========== Function 60 - Inter Process Communication (IPC). ==========
2392
======================================================================
2379
======================================================================
2393
IPC is used for message dispatching from one process/thread to
2380
IPC is used for message dispatching from one process/thread to
2394
another. Previously it is necessary to agree how to interpret
2381
another. Previously it is necessary to agree how to interpret
2395
the concrete message.
2382
the concrete message.
2396
 
2383
 
2397
----------- Subfunction 1 - set the area for IPC receiving -----------
2384
----------- Subfunction 1 - set the area for IPC receiving -----------
2398
Is called by process-receiver.
2385
Is called by process-receiver.
2399
Parameters:
2386
Parameters:
2400
  * eax = 60 - function number
2387
  * eax = 60 - function number
2401
  * ebx = 1 - subfunction number
2388
  * ebx = 1 - subfunction number
2402
  * ecx = pointer to the buffer
2389
  * ecx = pointer to the buffer
2403
  * edx = size of the buffer
2390
  * edx = size of the buffer
2404
Returned value:
2391
Returned value:
2405
  * eax = 0 - always success
2392
  * eax = 0 - always success
2406
Format of IPC-buffer:
2393
Format of IPC-buffer:
2407
  * +0: dword: if nonzero, buffer is considered locked;
2394
  * +0: dword: if nonzero, buffer is considered locked;
2408
    lock/unlock the buffer, when you work with it and need that
2395
    lock/unlock the buffer, when you work with it and need that
2409
    buffer data are not changed from outside (no new messages)
2396
    buffer data are not changed from outside (no new messages)
2410
  * +4: dword: occupied place in the buffer (in bytes)
2397
  * +4: dword: occupied place in the buffer (in bytes)
2411
  * +8: first message
2398
  * +8: first message
2412
  * +8+n: second message
2399
  * +8+n: second message
2413
  * ...
2400
  * ...
2414
Format of a message:
2401
Format of a message:
2415
  * +0: dword: PID of sender
2402
  * +0: dword: PID of sender
2416
  * +4: dword: message length (not including this header)
2403
  * +4: dword: message length (not including this header)
2417
  * +8: n*byte: message data
2404
  * +8: n*byte: message data
2418
 
2405
 
2419
------------------ Subfunction 2 - send IPC message ------------------
2406
------------------ Subfunction 2 - send IPC message ------------------
2420
Is called by process-sender.
2407
Is called by process-sender.
2421
Parameters:
2408
Parameters:
2422
  * eax = 60 - function number
2409
  * eax = 60 - function number
2423
  * ebx = 2 - subfunction number
2410
  * ebx = 2 - subfunction number
2424
  * ecx = PID of receiver
2411
  * ecx = PID of receiver
2425
  * edx = pointer to the message data
2412
  * edx = pointer to the message data
2426
  * esi = message length (in bytes)
2413
  * esi = message length (in bytes)
2427
Returned value:
2414
Returned value:
2428
  * eax = 0 - success
2415
  * eax = 0 - success
2429
  * eax = 1 - the receiver has not defined buffer for IPC messages
2416
  * eax = 1 - the receiver has not defined buffer for IPC messages
2430
    (can be, still have no time,
2417
    (can be, still have no time,
2431
    and can be, this is not right process)
2418
    and can be, this is not right process)
2432
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2419
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2433
  * eax = 3 - overflow of IPC-buffer of the receiver
2420
  * eax = 3 - overflow of IPC-buffer of the receiver
2434
  * eax = 4 - process/thread with such PID does not exist
2421
  * eax = 4 - process/thread with such PID does not exist
2435
Remarks:
2422
Remarks:
2436
  * Immediately after writing of IPC-message to the buffer the system
2423
  * Immediately after writing of IPC-message to the buffer the system
2437
    sends to the receiver the event with code 7 (see event codes).
2424
    sends to the receiver the event with code 7 (see event codes).
2438
 
2425
 
2439
======================================================================
2426
======================================================================
2440
==== Function 61 - get parameters for the direct graphics access. ====
2427
==== Function 61 - get parameters for the direct graphics access. ====
2441
======================================================================
2428
======================================================================
2442
The data of the graphics screen (the memory area which displays
2429
The data of the graphics screen (the memory area which displays
2443
screen contents) are accessible to a program directly, without
2430
screen contents) are accessible to a program directly, without
2444
any system calls, through the selector gs:
2431
any system calls, through the selector gs:
2445
        mov     eax, [gs:0]
2432
        mov     eax, [gs:0]
2446
places in eax the first dword of the buffer, which contains
2433
places in eax the first dword of the buffer, which contains
2447
information on color of the left upper point (and, possibly, colors
2434
information on color of the left upper point (and, possibly, colors
2448
of several following).
2435
of several following).
2449
        mov     [gs:0], eax
2436
        mov     [gs:0], eax
2450
by work in VESA modes with LFB sets color of the left upper point
2437
by work in VESA modes with LFB sets color of the left upper point
2451
(and, possibly, colors of several following).
2438
(and, possibly, colors of several following).
2452
To interpret the data of graphics screen program needs to know
2439
To interpret the data of graphics screen program needs to know
2453
some parameters, returning by this function.
2440
some parameters, returning by this function.
2454
Remarks:
2441
Remarks:
2455
  * Graphics parameters changes very seldom at work,
2442
  * Graphics parameters changes very seldom at work,
2456
    namely, only in cases, when user works with the application VRR.
2443
    namely, only in cases, when user works with the application VRR.
2457
  * At videomode change the system redraws all windows (event
2444
  * At videomode change the system redraws all windows (event
2458
    with code 1) and redraws the background (event 5).
2445
    with code 1) and redraws the background (event 5).
2459
    Same events occur in other cases too, which meet much more often,
2446
    Same events occur in other cases too, which meet much more often,
2460
    than videomode change.
2447
    than videomode change.
2461
  * By operation in videomodes with LFB the selector gs points to
2448
  * By operation in videomodes with LFB the selector gs points to
2462
    LFB itself, so reading/writing on gs result directly in
2449
    LFB itself, so reading/writing on gs result directly in
2463
    change of screen contents. By operation in videomodes without
2450
    change of screen contents. By operation in videomodes without
2464
    LFB gs points to some data area in the kernel, and all functions
2451
    LFB gs points to some data area in the kernel, and all functions
2465
    of screen output fulfil honesty double operation on writing
2452
    of screen output fulfil honesty double operation on writing
2466
    directly to the screen and writing to this buffer. In result
2453
    directly to the screen and writing to this buffer. In result
2467
    at reading contents of this buffer the results correspond to
2454
    at reading contents of this buffer the results correspond to
2468
    screen contents (with, generally speaking, large color
2455
    screen contents (with, generally speaking, large color
2469
    resolution), and writing is ignored.
2456
    resolution), and writing is ignored.
2470
    One exception is the mode 320*200, for which main loop of the
2457
    One exception is the mode 320*200, for which main loop of the
2471
    system thread updates the screen according to mouse movements.
2458
    system thread updates the screen according to mouse movements.
2472
 
2459
 
2473
------------------------- Screen resolution --------------------------
2460
------------------------- Screen resolution --------------------------
2474
Parameters:
2461
Parameters:
2475
  * eax = 61 - function number
2462
  * eax = 61 - function number
2476
  * ebx = 1 - subfunction number
2463
  * ebx = 1 - subfunction number
2477
Returned value:
2464
Returned value:
2478
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2465
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2479
Remarks:
2466
Remarks:
2480
  * One can use function 14 paying attention that
2467
  * One can use function 14 paying attention that
2481
    it returns sizes on 1 pixel less. It is fully equivalent way.
2468
    it returns sizes on 1 pixel less. It is fully equivalent way.
2482
 
2469
 
2483
---------------------- Number of bits per pixel ----------------------
2470
---------------------- Number of bits per pixel ----------------------
2484
Parameters:
2471
Parameters:
2485
  * eax = 61 - function number
2472
  * eax = 61 - function number
2486
  * ebx = 2 - subfunction number
2473
  * ebx = 2 - subfunction number
2487
Returned value:
2474
Returned value:
2488
  * eax = number of bits per pixel (24 or 32)
2475
  * eax = number of bits per pixel (24 or 32)
2489
 
2476
 
2490
-------------------- Number of bytes per scanline --------------------
2477
-------------------- Number of bytes per scanline --------------------
2491
Parameters:
2478
Parameters:
2492
  * eax = 61 - function number
2479
  * eax = 61 - function number
2493
  * ebx = 3 - subfunction number
2480
  * ebx = 3 - subfunction number
2494
Returned value:
2481
Returned value:
2495
  * eax = number of bytes occupied by one scanline
2482
  * eax = number of bytes occupied by one scanline
2496
    (horizontal line on the screen)
2483
    (horizontal line on the screen)
2497
 
2484
 
2498
======================================================================
2485
======================================================================
2499
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2486
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2500
======================================================================
2487
======================================================================
2501
Parameters:
2488
Parameters:
2502
  * eax = 62 - function number
2489
  * eax = 62 - function number
2503
  * bl = 0 - subfunction number
2490
  * bl = 0 - subfunction number
2504
Returned value:
2491
Returned value:
2505
  * eax = -1 - PCI access is disabled; otherwise
2492
  * eax = -1 - PCI access is disabled; otherwise
2506
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2493
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2507
  * high word of eax is zeroed
2494
  * high word of eax is zeroed
2508
Remarks:
2495
Remarks:
2509
  * Previously low-level access to PCI for applications must be
2496
  * Previously low-level access to PCI for applications must be
2510
    enabled by subfunction 12 of function 21.
2497
    enabled by subfunction 12 of function 21.
2511
  * If PCI BIOS is not supported, the value of ax is undefined.
2498
  * If PCI BIOS is not supported, the value of ax is undefined.
2512
 
2499
 
2513
======================================================================
2500
======================================================================
2514
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2501
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2515
======================================================================
2502
======================================================================
2516
Parameters:
2503
Parameters:
2517
  * eax = 62 - function number
2504
  * eax = 62 - function number
2518
  * bl = 1 - subfunction number
2505
  * bl = 1 - subfunction number
2519
Returned value:
2506
Returned value:
2520
  * eax = -1 - access to PCI is disabled; otherwise
2507
  * eax = -1 - access to PCI is disabled; otherwise
2521
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2508
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2522
Remarks:
2509
Remarks:
2523
  * Previously low-level access to PCI for applications must be
2510
  * Previously low-level access to PCI for applications must be
2524
    enabled by subfunction 12 of function 21.
2511
    enabled by subfunction 12 of function 21.
2525
  * If PCI BIOS is not supported, the value of ax is undefined.
2512
  * If PCI BIOS is not supported, the value of ax is undefined.
2526
 
2513
 
2527
======================================================================
2514
======================================================================
2528
===================== Function 62, subfunction 2 =====================
2515
===================== Function 62, subfunction 2 =====================
2529
===== Get mechanism of addressing to the PCI configuration space. ====
2516
===== Get mechanism of addressing to the PCI configuration space. ====
2530
======================================================================
2517
======================================================================
2531
Parameters:
2518
Parameters:
2532
  * eax = 62 - function number
2519
  * eax = 62 - function number
2533
  * bl = 2 - subfunction number
2520
  * bl = 2 - subfunction number
2534
Returned value:
2521
Returned value:
2535
  * eax = -1 - access to PCI is disabled; otherwise
2522
  * eax = -1 - access to PCI is disabled; otherwise
2536
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2523
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2537
Remarks:
2524
Remarks:
2538
  * Previously low-level access to PCI for applications must be
2525
  * Previously low-level access to PCI for applications must be
2539
    enabled by subfunction 12 of function 21.
2526
    enabled by subfunction 12 of function 21.
2540
  * Addressing mechanism is selected depending on
2527
  * Addressing mechanism is selected depending on
2541
    equipment characteristics.
2528
    equipment characteristics.
2542
  * Subfunctions of read and write work automatically
2529
  * Subfunctions of read and write work automatically
2543
    with the selected mechanism.
2530
    with the selected mechanism.
2544
 
2531
 
2545
======================================================================
2532
======================================================================
2546
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2533
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2547
======================================================================
2534
======================================================================
2548
Parameters:
2535
Parameters:
2549
  * eax = 62 - function number
2536
  * eax = 62 - function number
2550
  * bl = 4 - read byte
2537
  * bl = 4 - read byte
2551
  * bl = 5 - read word
2538
  * bl = 5 - read word
2552
  * bl = 6 - read dword
2539
  * bl = 6 - read dword
2553
  * bh = number of PCI-bus
2540
  * bh = number of PCI-bus
2554
  * ch = dddddfff, where ddddd = number of the device on the bus,
2541
  * ch = dddddfff, where ddddd = number of the device on the bus,
2555
    fff = function number of device
2542
    fff = function number of device
2556
  * cl = number of register (must be even for bl=5,
2543
  * cl = number of register (must be even for bl=5,
2557
    divisible by 4 for bl=6)
2544
    divisible by 4 for bl=6)
2558
Returned value:
2545
Returned value:
2559
  * eax = -1 - error (access to PCI is disabled or parameters
2546
  * eax = -1 - error (access to PCI is disabled or parameters
2560
    are not supported); otherwise
2547
    are not supported); otherwise
2561
  * al/ax/eax (depending on requested size) contains the data;
2548
  * al/ax/eax (depending on requested size) contains the data;
2562
    the other part of register eax is destroyed
2549
    the other part of register eax is destroyed
2563
Remarks:
2550
Remarks:
2564
  * Previously low-level access to PCI for applications must be
2551
  * Previously low-level access to PCI for applications must be
2565
    enabled by subfunction 12 of function 21.
2552
    enabled by subfunction 12 of function 21.
2566
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2553
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2567
    function number. To get access mechanism use subfunction 2.
2554
    function number. To get access mechanism use subfunction 2.
2568
  * Some registers are standard and exist for all devices, some are
2555
  * Some registers are standard and exist for all devices, some are
2569
    defined by the concrete device. The list of registers of the
2556
    defined by the concrete device. The list of registers of the
2570
    first type can be found e.g. in famous
2557
    first type can be found e.g. in famous
2571
    Interrupt List by Ralf Brown
2558
    Interrupt List by Ralf Brown
2572
    (http://www.pobox.com/~ralf/files.html,
2559
    (http://www.pobox.com/~ralf/files.html,
2573
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2560
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2574
    registers of the second type must be listed
2561
    registers of the second type must be listed
2575
    in the device documentation.
2562
    in the device documentation.
2576
 
2563
 
2577
======================================================================
2564
======================================================================
2578
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2565
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2579
======================================================================
2566
======================================================================
2580
Parameters:
2567
Parameters:
2581
  * eax = 62 - function number
2568
  * eax = 62 - function number
2582
  * bl = 8 - write byte
2569
  * bl = 8 - write byte
2583
  * bl = 9 - write word
2570
  * bl = 9 - write word
2584
  * bl = 10 - write dword
2571
  * bl = 10 - write dword
2585
  * bh = number of PCI-bus
2572
  * bh = number of PCI-bus
2586
  * ch = dddddfff, where ddddd = number of the device on the bus,
2573
  * ch = dddddfff, where ddddd = number of the device on the bus,
2587
    fff = function number of device
2574
    fff = function number of device
2588
  * cl = number of register (must be even for bl=9,
2575
  * cl = number of register (must be even for bl=9,
2589
    divisible by 4 for bl=10)
2576
    divisible by 4 for bl=10)
2590
  * dl/dx/edx (depending on requested size) contatins
2577
  * dl/dx/edx (depending on requested size) contatins
2591
    the data to write
2578
    the data to write
2592
Returned value:
2579
Returned value:
2593
  * eax = -1 - error (access to PCI is disabled or parameters
2580
  * eax = -1 - error (access to PCI is disabled or parameters
2594
    are not supported)
2581
    are not supported)
2595
  * eax = 0 - success
2582
  * eax = 0 - success
2596
Remarks:
2583
Remarks:
2597
  * Previously low-level access to PCI for applications must be
2584
  * Previously low-level access to PCI for applications must be
2598
    enabled by subfunction 12 of function 21.
2585
    enabled by subfunction 12 of function 21.
2599
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2586
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2600
    function number. To get access mechanism use subfunction 2.
2587
    function number. To get access mechanism use subfunction 2.
2601
  * Some registers are standard and exist for all devices, some are
2588
  * Some registers are standard and exist for all devices, some are
2602
    defined by the concrete device. The list of registers of the
2589
    defined by the concrete device. The list of registers of the
2603
    first type can be found e.g. in famous Interrupt List by
2590
    first type can be found e.g. in famous Interrupt List by
2604
    Ralf Brown; registers of the second type must be listed
2591
    Ralf Brown; registers of the second type must be listed
2605
    in the device documentation.
2592
    in the device documentation.
2606
 
2593
 
2607
======================================================================
2594
======================================================================
2608
============== Function 63 - work with the debug board. ==============
2595
============== Function 63 - work with the debug board. ==============
2609
======================================================================
2596
======================================================================
2610
The debug board is the global system buffer (with the size
2597
The debug board is the global system buffer (with the size
2611
1024 bytes), to which any program can write (generally speaking,
2598
1024 bytes), to which any program can write (generally speaking,
2612
arbitrary) data and from which other program can read these data.
2599
arbitrary) data and from which other program can read these data.
2613
By the agreement written data are text strings interpreted as
2600
By the agreement written data are text strings interpreted as
2614
debug messages on a course of program execution. The kernel in
2601
debug messages on a course of program execution. The kernel in
2615
some situations also writes to the debug board information on
2602
some situations also writes to the debug board information on
2616
execution of some functions; by the agreement kernel messages
2603
execution of some functions; by the agreement kernel messages
2617
begins from the prefix "K : ".
2604
begins from the prefix "K : ".
2618
For view of the debug board the application 'board' was created,
2605
For view of the debug board the application 'board' was created,
2619
which reads data from the buffer and displays them in its window.
2606
which reads data from the buffer and displays them in its window.
2620
'board' interpretes the sequence of codes 13,10 as newline.
2607
'board' interpretes the sequence of codes 13,10 as newline.
2621
A character with null code in an end of line is not necessary,
2608
A character with null code in an end of line is not necessary,
2622
but also does not prevent.
2609
but also does not prevent.
2623
Because debugger has been written, the value of the debug board
2610
Because debugger has been written, the value of the debug board
2624
has decreased, as debugger allows to inspect completely a course of
2611
has decreased, as debugger allows to inspect completely a course of
2625
program execution without any efforts from the direction of program
2612
program execution without any efforts from the direction of program
2626
itself. Nevertheless in some cases the debug board is still useful.
2613
itself. Nevertheless in some cases the debug board is still useful.
2627
 
2614
 
2628
----------------------------- Write byte -----------------------------
2615
----------------------------- Write byte -----------------------------
2629
Parameters:
2616
Parameters:
2630
  * eax = 63 - function number
2617
  * eax = 63 - function number
2631
  * ebx = 1 - subfunction number
2618
  * ebx = 1 - subfunction number
2632
  * cl = data byte
2619
  * cl = data byte
2633
Returned value:
2620
Returned value:
2634
  * function does not return value
2621
  * function does not return value
2635
Remarks:
2622
Remarks:
2636
  * Byte is written to the buffer. Buffer size is 512 bytes.
2623
  * Byte is written to the buffer. Buffer size is 512 bytes.
2637
    At buffer overflow all obtained data are lost.
2624
    At buffer overflow all obtained data are lost.
2638
  * For output to the debug board of more complicated objects
2625
  * For output to the debug board of more complicated objects
2639
    (strings, numbers) it is enough to call this function in cycle.
2626
    (strings, numbers) it is enough to call this function in cycle.
2640
    It is possible not to write the appropriate code manually and use
2627
    It is possible not to write the appropriate code manually and use
2641
    file 'debug.inc', which is included into the distributive.
2628
    file 'debug.inc', which is included into the distributive.
2642
 
2629
 
2643
----------------------------- Read byte ------------------------------
2630
----------------------------- Read byte ------------------------------
2644
Takes away byte from the buffer.
2631
Takes away byte from the buffer.
2645
Parameters:
2632
Parameters:
2646
  * eax = 63 - function number
2633
  * eax = 63 - function number
2647
  * ebx = 2 - subfunction number
2634
  * ebx = 2 - subfunction number
2648
Returned value:
2635
Returned value:
2649
  * eax = ebx = 0 - the buffer is empty
2636
  * eax = ebx = 0 - the buffer is empty
2650
  * eax = byte, ebx = 1 - byte was successfully read
2637
  * eax = byte, ebx = 1 - byte was successfully read
2651
 
2638
 
2652
======================================================================
2639
======================================================================
2653
============== Function 64 - resize application memory. ==============
2640
============== Function 64 - resize application memory. ==============
2654
======================================================================
2641
======================================================================
2655
Parameters:
2642
Parameters:
2656
  * eax = 64 - function number
2643
  * eax = 64 - function number
2657
  * ebx = 1 - unique subfunction
2644
  * ebx = 1 - unique subfunction
2658
  * ecx = new memory size
2645
  * ecx = new memory size
2659
Returned value:
2646
Returned value:
2660
  * eax = 0 - success
2647
  * eax = 0 - success
2661
  * eax = 1 - not enough memory
2648
  * eax = 1 - not enough memory
2662
Remarks:
2649
Remarks:
2663
  * There is another way to dynamically allocate/free memory -
2650
  * There is another way to dynamically allocate/free memory -
2664
    subfunctions 11, 12, 13 of function 68.
2651
    subfunctions 11, 12, 13 of function 68.
2665
  * The function cannot be used together with 68.11, 68.12, 68.13.
2652
  * The function cannot be used together with 68.11, 68.12, 68.13.
2666
    The function call will be ignored after creation of process heap
2653
    The function call will be ignored after creation of process heap
2667
    with function 68.11.
2654
    with function 68.11.
2668
 
2655
 
2669
======================================================================
2656
======================================================================
2670
======== Function 65 - draw image with palette in the window. ========
2657
======== Function 65 - draw image with palette in the window. ========
2671
======================================================================
2658
======================================================================
2672
Parameters:
2659
Parameters:
2673
  * eax = 65 - function number
2660
  * eax = 65 - function number
2674
  * ebx = pointer to the image
2661
  * ebx = pointer to the image
2675
  * ecx = [size on axis x]*65536 + [size on axis y]
2662
  * ecx = [size on axis x]*65536 + [size on axis y]
2676
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2663
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2677
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2664
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2678
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2665
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2679
          ignored when esi > 8
2666
          ignored when esi > 8
2680
  * ebp = offset of next row data relative to previous row data
2667
  * ebp = offset of next row data relative to previous row data
2681
Returned value:
2668
Returned value:
2682
  * function does not return value
2669
  * function does not return value
2683
Remarks:
2670
Remarks:
2684
  * Coordinates of the image are coordinates of the upper left corner
2671
  * Coordinates of the image are coordinates of the upper left corner
2685
    of the image relative to the window.
2672
    of the image relative to the window.
2686
  * Format of image with 1 bit per pixel: each byte of image
2673
  * Format of image with 1 bit per pixel: each byte of image
2687
    (possibly excluding last bytes in rows), contains information on
2674
    (possibly excluding last bytes in rows), contains information on
2688
    the color of 8 pixels, MSB corresponds to first pixel.
2675
    the color of 8 pixels, MSB corresponds to first pixel.
2689
  * Format of image with 2 bits per pixel: each byte of image
2676
  * Format of image with 2 bits per pixel: each byte of image
2690
    (possibly excluding last bytes in rows), contains information on
2677
    (possibly excluding last bytes in rows), contains information on
2691
    the color of 4 pixels, two MSBs correspond to first pixel.
2678
    the color of 4 pixels, two MSBs correspond to first pixel.
2692
  * Format of image with 4 bits per pixel: each byte of image
2679
  * Format of image with 4 bits per pixel: each byte of image
2693
    excluding last bytes in rows (if width is odd) contains
2680
    excluding last bytes in rows (if width is odd) contains
2694
    information on the color of 2 pixels, high-order tetrad
2681
    information on the color of 2 pixels, high-order tetrad
2695
    corresponds to first pixel.
2682
    corresponds to first pixel.
2696
  * Format of image with 8 bits per pixel: each byte of image is
2683
  * Format of image with 8 bits per pixel: each byte of image is
2697
    index in the palette.
2684
    index in the palette.
2698
  * Format of image with 9 bits per pixel: array of one byte values;
2685
  * Format of image with 9 bits per pixel: array of one byte values;
2699
    each byte (8 bit) represents the intensity of gray for one pixel;
2686
    each byte (8 bit) represents the intensity of gray for one pixel;
2700
    this format is equal to 8bpp without palette.
2687
    this format is equal to 8bpp without palette.
2701
  * Format of image with 15 bits per pixel: the color of each pixel
2688
  * Format of image with 15 bits per pixel: the color of each pixel
2702
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2689
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2703
    each color.
2690
    each color.
2704
  * Format of image with 16 bits per pixel: the color of each pixel
2691
  * Format of image with 16 bits per pixel: the color of each pixel
2705
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2692
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2706
  * Format of image with 24 bits per pixel: the color of each pixel
2693
  * Format of image with 24 bits per pixel: the color of each pixel
2707
    is coded as 3 bytes - sequentially blue, green, red components.
2694
    is coded as 3 bytes - sequentially blue, green, red components.
2708
  * Format of image with 32 bits per pixel: similar to 24, but
2695
  * Format of image with 32 bits per pixel: similar to 24, but
2709
    one additional ignored byte is present.
2696
    one additional ignored byte is present.
2710
  * The call to function 7 is equivalent to call to this function
2697
  * The call to function 7 is equivalent to call to this function
2711
    with esi=24, ebp=0.
2698
    with esi=24, ebp=0.
2712
 
2699
 
2713
======================================================================
2700
======================================================================
2714
================== Function 66 - work with keyboard. =================
2701
================== Function 66 - work with keyboard. =================
2715
======================================================================
2702
======================================================================
2716
The input mode influences results of reading keys by function 2.
2703
The input mode influences results of reading keys by function 2.
2717
When a program loads, ASCII input mode is set for it.
2704
When a program loads, ASCII input mode is set for it.
2718
 
2705
 
2719
-------------- Subfunction 1 - set keyboard input mode. --------------
2706
-------------- Subfunction 1 - set keyboard input mode. --------------
2720
Parameters:
2707
Parameters:
2721
  * eax = 66 - function number
2708
  * eax = 66 - function number
2722
  * ebx = 1 - subfunction number
2709
  * ebx = 1 - subfunction number
2723
  * ecx = mode:
2710
  * ecx = mode:
2724
    * 0 = normal (ASCII-characters)
2711
    * 0 = normal (ASCII-characters)
2725
    * 1 = scancodes
2712
    * 1 = scancodes
2726
Returned value:
2713
Returned value:
2727
  * function does not return value
2714
  * function does not return value
2728
 
2715
 
2729
-------------- Subfunction 2 - get keyboard input mode. --------------
2716
-------------- Subfunction 2 - get keyboard input mode. --------------
2730
Parameters:
2717
Parameters:
2731
  * eax = 66 - function number
2718
  * eax = 66 - function number
2732
  * ebx = 2 - subfunction number
2719
  * ebx = 2 - subfunction number
2733
Returned value:
2720
Returned value:
2734
  * eax = current mode
2721
  * eax = current mode
2735
 
2722
 
2736
------------ Subfunction 3 - get status of control keys. -------------
2723
------------ Subfunction 3 - get status of control keys. -------------
2737
Parameters:
2724
Parameters:
2738
  * eax = 66 - function number
2725
  * eax = 66 - function number
2739
  * ebx = 3 - subfunction number
2726
  * ebx = 3 - subfunction number
2740
Returned value:
2727
Returned value:
2741
  * eax = bit mask:
2728
  * eax = bit mask:
2742
  * bit 0  (mask 1): left Shift is pressed
2729
  * bit 0  (mask 1): left Shift is pressed
2743
  * bit 1  (mask 2): right Shift is pressed
2730
  * bit 1  (mask 2): right Shift is pressed
2744
  * bit 2  (mask 4): left Ctrl is pressed
2731
  * bit 2  (mask 4): left Ctrl is pressed
2745
  * bit 3  (mask 8): right Ctrl is pressed
2732
  * bit 3  (mask 8): right Ctrl is pressed
2746
  * bit 4  (mask 0x10): left Alt is pressed
2733
  * bit 4  (mask 0x10): left Alt is pressed
2747
  * bit 5  (mask 0x20): right Alt is pressed
2734
  * bit 5  (mask 0x20): right Alt is pressed
2748
  * bit 6  (mask 0x40): CapsLock is on
2735
  * bit 6  (mask 0x40): CapsLock is on
2749
  * bit 7  (mask 0x80): NumLock is on
2736
  * bit 7  (mask 0x80): NumLock is on
2750
  * bit 8  (mask 0x100): ScrollLock is on
2737
  * bit 8  (mask 0x100): ScrollLock is on
2751
  * bit 9  (mask 0x200): left Win is pressed
2738
  * bit 9  (mask 0x200): left Win is pressed
2752
  * bit 10 (mask 0x400): right Win is pressed
2739
  * bit 10 (mask 0x400): right Win is pressed
2753
  * other bits are cleared
2740
  * other bits are cleared
2754
 
2741
 
2755
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2742
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2756
When hotkey is pressed, the system notifies only those applications,
2743
When hotkey is pressed, the system notifies only those applications,
2757
which have installed it; the active application (which receives
2744
which have installed it; the active application (which receives
2758
all normal input) does not receive such keys.
2745
all normal input) does not receive such keys.
2759
The notification consists in sending event with the code 2.
2746
The notification consists in sending event with the code 2.
2760
Reading hotkey is the same as reading normal key - by function 2.
2747
Reading hotkey is the same as reading normal key - by function 2.
2761
Parameters:
2748
Parameters:
2762
  * eax = 66 - function number
2749
  * eax = 66 - function number
2763
  * ebx = 4 - subfunction number
2750
  * ebx = 4 - subfunction number
2764
  * cl determines key scancode;
2751
  * cl determines key scancode;
2765
    use cl=0 to give combinations such as Ctrl+Shift
2752
    use cl=0 to give combinations such as Ctrl+Shift
2766
  * edx = 0xXYZ determines possible states of control keys:
2753
  * edx = 0xXYZ determines possible states of control keys:
2767
    * Z (low 4 bits) determines state of LShift and RShift:
2754
    * Z (low 4 bits) determines state of LShift and RShift:
2768
      * 0 = no key must be pressed;
2755
      * 0 = no key must be pressed;
2769
      * 1 = exactly one key must be pressed;
2756
      * 1 = exactly one key must be pressed;
2770
      * 2 = both keys must be pressed;
2757
      * 2 = both keys must be pressed;
2771
      * 3 = must be pressed LShift, but not RShift;
2758
      * 3 = must be pressed LShift, but not RShift;
2772
      * 4 = must be pressed RShift, but not LShift
2759
      * 4 = must be pressed RShift, but not LShift
2773
    * Y - similar for LCtrl and RCtrl;
2760
    * Y - similar for LCtrl and RCtrl;
2774
    * X - similar for LAlt and RAlt
2761
    * X - similar for LAlt and RAlt
2775
Returned value:
2762
Returned value:
2776
  * eax=0 - success
2763
  * eax=0 - success
2777
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
2764
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
2778
Remarks:
2765
Remarks:
2779
  * Hotkey can work either at pressing or at release. Release
2766
  * Hotkey can work either at pressing or at release. Release
2780
    scancode of a key is more on 128 than pressing scancode
2767
    scancode of a key is more on 128 than pressing scancode
2781
    (i.e. high bit is set).
2768
    (i.e. high bit is set).
2782
  * Several applications can set the same combination;
2769
  * Several applications can set the same combination;
2783
    all such applications will be informed on pressing
2770
    all such applications will be informed on pressing
2784
    such combination.
2771
    such combination.
2785
 
2772
 
2786
-------------- Subfunction 5 - delete installed hotkey. --------------
2773
-------------- Subfunction 5 - delete installed hotkey. --------------
2787
Parameters:
2774
Parameters:
2788
  * eax = 66 - function number
2775
  * eax = 66 - function number
2789
  * ebx = 5 - subfunction number
2776
  * ebx = 5 - subfunction number
2790
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
2777
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
2791
Returned value:
2778
Returned value:
2792
  * eax = 0 - success
2779
  * eax = 0 - success
2793
  * eax = 1 - there is no such hotkey
2780
  * eax = 1 - there is no such hotkey
2794
Remarks:
2781
Remarks:
2795
  * When a process/thread terminates, all hotkey installed by it are
2782
  * When a process/thread terminates, all hotkey installed by it are
2796
    deleted.
2783
    deleted.
2797
  * The call to this subfunction does not affect other applications.
2784
  * The call to this subfunction does not affect other applications.
2798
    If other application has defined the same combination, it will
2785
    If other application has defined the same combination, it will
2799
    still receive notices.
2786
    still receive notices.
2800
 
2787
 
2801
--------------- Subfunction 6 - block the normal input. --------------
2788
--------------- Subfunction 6 - block the normal input. --------------
2802
Parameters:
2789
Parameters:
2803
  * eax = 66 - function number
2790
  * eax = 66 - function number
2804
  * ebx = 6 - subfunction number
2791
  * ebx = 6 - subfunction number
2805
Returned value:
2792
Returned value:
2806
  * function does not return value
2793
  * function does not return value
2807
Remarks:
2794
Remarks:
2808
  * Blocking the normal keyboard input for installed hotkeys
2795
  * Blocking the normal keyboard input for installed hotkeys
2809
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2796
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2810
 
2797
 
2811
------------ Subfunction 7 - unlock the normal input. ----------------
2798
------------ Subfunction 7 - unlock the normal input. ----------------
2812
Parameters:
2799
Parameters:
2813
  * eax = 66 - function number
2800
  * eax = 66 - function number
2814
  * ebx = 7 - subfunction number
2801
  * ebx = 7 - subfunction number
2815
Returned value:
2802
Returned value:
2816
  * function does not return value
2803
  * function does not return value
2817
Remarks:
2804
Remarks:
2818
  * Unlocking the results of the f. 66.6
2805
  * Unlocking the results of the f. 66.6
2819
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2806
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2820
 
2807
 
2821
======================================================================
2808
======================================================================
2822
========= Function 67 - change position/sizes of the window. =========
2809
========= Function 67 - change position/sizes of the window. =========
2823
======================================================================
2810
======================================================================
2824
Parameters:
2811
Parameters:
2825
  * eax = 67 - function number
2812
  * eax = 67 - function number
2826
  * ebx = new x-coordinate of the window
2813
  * ebx = new x-coordinate of the window
2827
  * ecx = new y-coordinate of the window
2814
  * ecx = new y-coordinate of the window
2828
  * edx = new x-size of the window
2815
  * edx = new x-size of the window
2829
  * esi = new y-size of the window
2816
  * esi = new y-size of the window
2830
Returned value:
2817
Returned value:
2831
  * function does not return value
2818
  * function does not return value
2832
Remarks:
2819
Remarks:
2833
  * The value -1 for a parameter means "do not change"; e.g. to move
2820
  * The value -1 for a parameter means "do not change"; e.g. to move
2834
    the window without resizing it is possible to specify edx=esi=-1.
2821
    the window without resizing it is possible to specify edx=esi=-1.
2835
  * Previously the window must be defined by function 0.
2822
  * Previously the window must be defined by function 0.
2836
    It sets initial coordinates and sizes of the window.
2823
    It sets initial coordinates and sizes of the window.
2837
  * Sizes of the window are understood in sense of function 0,
2824
  * Sizes of the window are understood in sense of function 0,
2838
    that is one pixel less than real sizes.
2825
    that is one pixel less than real sizes.
2839
  * The function call for maximized windows is simply ignored.
2826
  * The function call for maximized windows is simply ignored.
2840
  * For windows of appropriate styles position and/or sizes can be
2827
  * For windows of appropriate styles position and/or sizes can be
2841
    changed by user; current position and sizes can be obtained by
2828
    changed by user; current position and sizes can be obtained by
2842
    call to function 9.
2829
    call to function 9.
2843
  * The function sends to the window redraw event (with the code 1).
2830
  * The function sends to the window redraw event (with the code 1).
2844
 
2831
 
2845
======================================================================
2832
======================================================================
2846
====== Function 68, subfunction 0 - get the task switch counter. =====
2833
====== Function 68, subfunction 0 - get the task switch counter. =====
2847
======================================================================
2834
======================================================================
2848
Parameters:
2835
Parameters:
2849
  * eax = 68 - function number
2836
  * eax = 68 - function number
2850
  * ebx = 0 - subfunction number
2837
  * ebx = 0 - subfunction number
2851
Returned value:
2838
Returned value:
2852
  * eax = number of task switches from the system booting
2839
  * eax = number of task switches from the system booting
2853
    (modulo 2^32)
2840
    (modulo 2^32)
2854
 
2841
 
2855
======================================================================
2842
======================================================================
2856
======= Function 68, subfunction 1 - switch to the next thread. ======
2843
======= Function 68, subfunction 1 - switch to the next thread. ======
2857
======================================================================
2844
======================================================================
2858
The function completes the current time slice allocated to the
2845
The function completes the current time slice allocated to the
2859
thread and switches to the next. (Which thread in which process
2846
thread and switches to the next. (Which thread in which process
2860
will be next, is unpredictable). Later, when execution queue
2847
will be next, is unpredictable). Later, when execution queue
2861
will reach the current thread, execution will be continued.
2848
will reach the current thread, execution will be continued.
2862
Parameters:
2849
Parameters:
2863
  * eax = 68 - function number
2850
  * eax = 68 - function number
2864
  * ebx = 1 - subfunction number
2851
  * ebx = 1 - subfunction number
2865
Returned value:
2852
Returned value:
2866
  * function does not return value
2853
  * function does not return value
2867
 
2854
 
2868
======================================================================
2855
======================================================================
2869
============= Function 68, subfunction 2 - cache + rdpmc. ============
2856
============= Function 68, subfunction 2 - cache + rdpmc. ============
2870
======================================================================
2857
======================================================================
2871
Parameters:
2858
Parameters:
2872
  * eax = 68 - function number
2859
  * eax = 68 - function number
2873
  * ebx = 2 - subfunction number
2860
  * ebx = 2 - subfunction number
2874
  * ecx = required action:
2861
  * ecx = required action:
2875
    * ecx = 0 - enable instruction 'rdpmc'
2862
    * ecx = 0 - enable instruction 'rdpmc'
2876
      (ReaD Performance-Monitoring Counters) for applications
2863
      (ReaD Performance-Monitoring Counters) for applications
2877
    * ecx = 1 - find out whether cache is disabled/enabled
2864
    * ecx = 1 - find out whether cache is disabled/enabled
2878
    * ecx = 2 - enable cache
2865
    * ecx = 2 - enable cache
2879
    * ecx = 3 - disable cache
2866
    * ecx = 3 - disable cache
2880
Returned value:
2867
Returned value:
2881
  * for ecx=0:
2868
  * for ecx=0:
2882
    * eax = the value of cr4
2869
    * eax = the value of cr4
2883
  * for ecx=1:
2870
  * for ecx=1:
2884
    * eax = (cr0 and 0x60000000):
2871
    * eax = (cr0 and 0x60000000):
2885
    * eax = 0 - cache is on
2872
    * eax = 0 - cache is on
2886
    * eax <> 0 - cache is off
2873
    * eax <> 0 - cache is off
2887
  * for ecx=2 and ecx=3:
2874
  * for ecx=2 and ecx=3:
2888
    * function does not return value
2875
    * function does not return value
2889
 
2876
 
2890
======================================================================
2877
======================================================================
2891
=========== Function 68, subfunction 3 - read MSR-register. ==========
2878
=========== Function 68, subfunction 3 - read MSR-register. ==========
2892
======================================================================
2879
======================================================================
2893
MSR = Model Specific Register; the complete list of MSR-registers
2880
MSR = Model Specific Register; the complete list of MSR-registers
2894
of a processor is included to the documentation on it (for example,
2881
of a processor is included to the documentation on it (for example,
2895
IA-32 Intel Architecture Software Developer's Manual,
2882
IA-32 Intel Architecture Software Developer's Manual,
2896
Volume 3, Appendix B); each processor family has its own subset
2883
Volume 3, Appendix B); each processor family has its own subset
2897
of the MSR-registers.
2884
of the MSR-registers.
2898
Parameters:
2885
Parameters:
2899
  * eax = 68 - function number
2886
  * eax = 68 - function number
2900
  * ebx = 3 - subfunction number
2887
  * ebx = 3 - subfunction number
2901
  * ecx is ignored
2888
  * ecx is ignored
2902
  * edx = MSR address
2889
  * edx = MSR address
2903
Returned value:
2890
Returned value:
2904
  * ebx:eax = high:low dword of the result
2891
  * ebx:eax = high:low dword of the result
2905
Remarks:
2892
Remarks:
2906
  * If ecx contains nonexistent or not implemented for this processor
2893
  * If ecx contains nonexistent or not implemented for this processor
2907
    MSR, processor will generate an exception in the kernel, which
2894
    MSR, processor will generate an exception in the kernel, which
2908
    will kill the thread.
2895
    will kill the thread.
2909
  * Previously it is necessary to check, whether MSRs are supported
2896
  * Previously it is necessary to check, whether MSRs are supported
2910
    as a whole, with the instruction 'cpuid'. Otherwise processor
2897
    as a whole, with the instruction 'cpuid'. Otherwise processor
2911
    will generate other exception in the kernel, which will anyway
2898
    will generate other exception in the kernel, which will anyway
2912
    kill the thread.
2899
    kill the thread.
2913
 
2900
 
2914
======================================================================
2901
======================================================================
2915
========= Function 68, subfunction 4 - write to MSR-register. ========
2902
========= Function 68, subfunction 4 - write to MSR-register. ========
2916
======================================================================
2903
======================================================================
2917
MSR = Model Specific Register; the complete list of MSR-registers
2904
MSR = Model Specific Register; the complete list of MSR-registers
2918
of a processor is included to the documentation on it (for example,
2905
of a processor is included to the documentation on it (for example,
2919
IA-32 Intel Architecture Software Developer's Manual,
2906
IA-32 Intel Architecture Software Developer's Manual,
2920
Volume 3, Appendix B); each processor family has its own subset
2907
Volume 3, Appendix B); each processor family has its own subset
2921
of the MSR-registers.
2908
of the MSR-registers.
2922
Parameters:
2909
Parameters:
2923
  * eax = 68 - function number
2910
  * eax = 68 - function number
2924
  * ebx = 4 - subfunction number
2911
  * ebx = 4 - subfunction number
2925
  * ecx is ignored
2912
  * ecx is ignored
2926
  * edx = MSR address
2913
  * edx = MSR address
2927
  * esi:edi = high:low dword
2914
  * esi:edi = high:low dword
2928
Returned value:
2915
Returned value:
2929
  * function does not return value
2916
  * function does not return value
2930
Remarks:
2917
Remarks:
2931
  * If ecx contains nonexistent or not implemented for this processor
2918
  * If ecx contains nonexistent or not implemented for this processor
2932
    MSR, processor will generate an exception in the kernel, which
2919
    MSR, processor will generate an exception in the kernel, which
2933
    will kill the thread.
2920
    will kill the thread.
2934
  * Previously it is necessary to check, whether MSRs are supported
2921
  * Previously it is necessary to check, whether MSRs are supported
2935
    as a whole, with the instruction 'cpuid'. Otherwise processor
2922
    as a whole, with the instruction 'cpuid'. Otherwise processor
2936
    will generate other exception in the kernel, which will anyway
2923
    will generate other exception in the kernel, which will anyway
2937
    kill the thread.
2924
    kill the thread.
2938
 
2925
 
2939
======================================================================
2926
======================================================================
2940
======= Function 68, subfunction 11 - initialize process heap. =======
2927
======= Function 68, subfunction 11 - initialize process heap. =======
2941
======================================================================
2928
======================================================================
2942
Parameters:
2929
Parameters:
2943
  * eax = 68 - function number
2930
  * eax = 68 - function number
2944
  * ebx = 11 - subfunction number
2931
  * ebx = 11 - subfunction number
2945
Returned value:
2932
Returned value:
2946
  * eax = 0 - failed
2933
  * eax = 0 - failed
2947
  * otherwise size of created heap
2934
  * otherwise size of created heap
2948
Remarks:
2935
Remarks:
2949
  * The function call initializes heap, from which one can in future
2936
  * The function call initializes heap, from which one can in future
2950
    allocate and free memory blocks with subfunctions 12 and 13.
2937
    allocate and free memory blocks with subfunctions 12 and 13.
2951
    Heap size is equal to total amount of free application memory.
2938
    Heap size is equal to total amount of free application memory.
2952
  * The second function call from the same process results in
2939
  * The second function call from the same process results in
2953
    returning the size of the existing heap.
2940
    returning the size of the existing heap.
2954
  * After creation of the heap calls to function 64 will be ignored.
2941
  * After creation of the heap calls to function 64 will be ignored.
2955
 
2942
 
2956
======================================================================
2943
======================================================================
2957
======== Function 68, subfunction 12 - allocate memory block. ========
2944
======== Function 68, subfunction 12 - allocate memory block. ========
2958
======================================================================
2945
======================================================================
2959
Parameters:
2946
Parameters:
2960
  * eax = 68 - function number
2947
  * eax = 68 - function number
2961
  * ebx = 12 - subfunction number
2948
  * ebx = 12 - subfunction number
2962
  * ecx = required size in bytes
2949
  * ecx = required size in bytes
2963
Returned value:
2950
Returned value:
2964
  * eax = pointer to the allocated block
2951
  * eax = pointer to the allocated block
2965
Remarks:
2952
Remarks:
2966
  * Before this call one must initialize process heap by call to
2953
  * Before this call one must initialize process heap by call to
2967
    subfunction 11.
2954
    subfunction 11.
2968
  * The function allocates an integer number of pages (4 Kb) in such
2955
  * The function allocates an integer number of pages (4 Kb) in such
2969
    way that the real size of allocated block is more than or equal to
2956
    way that the real size of allocated block is more than or equal to
2970
    requested size.
2957
    requested size.
2971
 
2958
 
2972
======================================================================
2959
======================================================================
2973
========== Function 68, subfunction 13 - free memory block. ==========
2960
========== Function 68, subfunction 13 - free memory block. ==========
2974
======================================================================
2961
======================================================================
2975
Parameters:
2962
Parameters:
2976
  * eax = 68 - function number
2963
  * eax = 68 - function number
2977
  * ebx = 13 - subfunction number
2964
  * ebx = 13 - subfunction number
2978
  * ecx = pointer to the memory block
2965
  * ecx = pointer to the memory block
2979
Returned value:
2966
Returned value:
2980
  * eax = 1 - success
2967
  * eax = 1 - success
2981
  * eax = 0 - failed
2968
  * eax = 0 - failed
2982
Remarks:
2969
Remarks:
2983
  * The memory block must have been allocated by subfunction 12
2970
  * The memory block must have been allocated by subfunction 12
2984
    or subfunction 20.
2971
    or subfunction 20.
2985
 
2972
 
2986
======================================================================
2973
======================================================================
2987
===================== Function 68, subfunction 14 ====================
2974
===================== Function 68, subfunction 14 ====================
2988
============ Wait for signal from another program/driver. ============
2975
============ Wait for signal from another program/driver. ============
2989
======================================================================
2976
======================================================================
2990
Parameters:
2977
Parameters:
2991
  * eax = 68 - function number
2978
  * eax = 68 - function number
2992
  * ebx = 14 - subfunction number
2979
  * ebx = 14 - subfunction number
2993
  * ecx = pointer to the buffer for information (24 bytes)
2980
  * ecx = pointer to the buffer for information (24 bytes)
2994
Returned value:
2981
Returned value:
2995
  * buffer pointed to by ecx contains the following information:
2982
  * buffer pointed to by ecx contains the following information:
2996
    * +0: dword: identifier for following data of signal
2983
    * +0: dword: identifier for following data of signal
2997
    * +4: dword: data of signal (20 bytes), format of which is defined
2984
    * +4: dword: data of signal (20 bytes), format of which is defined
2998
          by the first dword
2985
          by the first dword
2999
 
2986
 
3000
======================================================================
2987
======================================================================
3001
============= Function 68, subfunction 16 - load driver. =============
2988
============= Function 68, subfunction 16 - load driver. =============
3002
======================================================================
2989
======================================================================
3003
Parameters:
2990
Parameters:
3004
  * eax = 68 - function number
2991
  * eax = 68 - function number
3005
  * ebx = 16 - subfunction number
2992
  * ebx = 16 - subfunction number
3006
  * ecx = pointer to ASCIIZ-string with driver name
2993
  * ecx = pointer to ASCIIZ-string with driver name
3007
Returned value:
2994
Returned value:
3008
  * eax = 0 - failed
2995
  * eax = 0 - failed
3009
  * otherwise eax = driver handle
2996
  * otherwise eax = driver handle
3010
Remarks:
2997
Remarks:
3011
  * If the driver was not loaded yet, it is loaded;
2998
  * If the driver was not loaded yet, it is loaded;
3012
    if the driver was loaded yet, nothing happens.
2999
    if the driver was loaded yet, nothing happens.
3013
  * Driver name is case-sensitive.
3000
  * Driver name is case-sensitive.
3014
    Maximum length of the name is 16 characters, including
3001
    Maximum length of the name is 16 characters, including
3015
    terminating null character, the rest is ignored.
3002
    terminating null character, the rest is ignored.
3016
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3003
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3017
 
3004
 
3018
======================================================================
3005
======================================================================
3019
============ Function 68, subfunction 17 - driver control. ===========
3006
============ Function 68, subfunction 17 - driver control. ===========
3020
======================================================================
3007
======================================================================
3021
Parameters:
3008
Parameters:
3022
  * eax = 68 - function number
3009
  * eax = 68 - function number
3023
  * ebx = 17 - subfunction number
3010
  * ebx = 17 - subfunction number
3024
  * ecx = pointer to the control structure:
3011
  * ecx = pointer to the control structure:
3025
    * +0: dword: handle of driver
3012
    * +0: dword: handle of driver
3026
    * +4: dword: code of driver function
3013
    * +4: dword: code of driver function
3027
    * +8: dword: pointer to input data
3014
    * +8: dword: pointer to input data
3028
    * +12 = +0xC: dword: size of input data
3015
    * +12 = +0xC: dword: size of input data
3029
    * +16 = +0x10: dword: pointer to output data
3016
    * +16 = +0x10: dword: pointer to output data
3030
    * +20 = +0x14: dword: size of output data
3017
    * +20 = +0x14: dword: size of output data
3031
Returned value:
3018
Returned value:
3032
  * eax = determined by driver
3019
  * eax = determined by driver
3033
Remarks:
3020
Remarks:
3034
  * Function codes and the structure of input/output data
3021
  * Function codes and the structure of input/output data
3035
    are defined by driver.
3022
    are defined by driver.
3036
  * Previously one must obtain driver handle by subfunction 16.
3023
  * Previously one must obtain driver handle by subfunction 16.
3037
 
3024
 
3038
======================================================================
3025
======================================================================
3039
=============== Function 68, subfunction 19 - load DLL. ==============
3026
=============== Function 68, subfunction 19 - load DLL. ==============
3040
======================================================================
3027
======================================================================
3041
Parameters:
3028
Parameters:
3042
  * eax = 68 - function number
3029
  * eax = 68 - function number
3043
  * ebx = 19 - subfunction number
3030
  * ebx = 19 - subfunction number
3044
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3031
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3045
Returned value:
3032
Returned value:
3046
  * eax = 0 - failed
3033
  * eax = 0 - failed
3047
  * otherwise eax = pointer to DLL export table
3034
  * otherwise eax = pointer to DLL export table
3048
Remarks:
3035
Remarks:
3049
  * Export table is an array of structures of 2 dword's, terminated
3036
  * Export table is an array of structures of 2 dword's, terminated
3050
    by zero. The first dword in structure points to function name,
3037
    by zero. The first dword in structure points to function name,
3051
    the second dword contains address of function.
3038
    the second dword contains address of function.
3052
 
3039
 
3053
======================================================================
3040
======================================================================
3054
======= Function 68, subfunction 20 - reallocate memory block. =======
3041
======= Function 68, subfunction 20 - reallocate memory block. =======
3055
======================================================================
3042
======================================================================
3056
Parameters:
3043
Parameters:
3057
  * eax = 68 - function number
3044
  * eax = 68 - function number
3058
  * ebx = 20 - subfunction number
3045
  * ebx = 20 - subfunction number
3059
  * ecx = new size in bytes
3046
  * ecx = new size in bytes
3060
  * edx = pointer to already allocated block
3047
  * edx = pointer to already allocated block
3061
Returned value:
3048
Returned value:
3062
  * eax = pointer to the reallocated block, 0 = error
3049
  * eax = pointer to the reallocated block, 0 = error
3063
Remarks:
3050
Remarks:
3064
  * Before this call one must initialize process heap by call to
3051
  * Before this call one must initialize process heap by call to
3065
    subfunction 11.
3052
    subfunction 11.
3066
  * The function allocates an integer number of pages (4 Kb) in such
3053
  * The function allocates an integer number of pages (4 Kb) in such
3067
    way that the real size of allocated block is more than or equal to
3054
    way that the real size of allocated block is more than or equal to
3068
    requested size.
3055
    requested size.
3069
  * If edx=0, the function call is equivalent to memory allocation
3056
  * If edx=0, the function call is equivalent to memory allocation
3070
    with subfunction 12. Otherwise the block at edx
3057
    with subfunction 12. Otherwise the block at edx
3071
    must be allocated earlier with subfunction 12 or this subfunction.
3058
    must be allocated earlier with subfunction 12 or this subfunction.
3072
  * If ecx=0, the function frees memory block at edx and returns 0.
3059
  * If ecx=0, the function frees memory block at edx and returns 0.
3073
  * The contents of the block are unchanged up to the shorter of
3060
  * The contents of the block are unchanged up to the shorter of
3074
    the new and old sizes.
3061
    the new and old sizes.
3075
 
3062
 
3076
======================================================================
3063
======================================================================
3077
=========== Function 68, subfunction 21 - load driver PE. ============
3064
=========== Function 68, subfunction 21 - load driver PE. ============
3078
======================================================================
3065
======================================================================
3079
Parameters:
3066
Parameters:
3080
  * eax = 68 - function number
3067
  * eax = 68 - function number
3081
  * ebx = 21 - subfunction number
3068
  * ebx = 21 - subfunction number
3082
  * ecx = pointer to ASCIIZ-string with driver name
3069
  * ecx = pointer to ASCIIZ-string with driver name
3083
  * edx = pointer to command line
3070
  * edx = pointer to command line
3084
Returned value:
3071
Returned value:
3085
  * eax = 0 - failed
3072
  * eax = 0 - failed
3086
  * otherwise eax = driver handle
3073
  * otherwise eax = driver handle
3087
Remarks:
3074
Remarks:
3088
  * If the driver was not loaded yet, it is loaded;
3075
  * If the driver was not loaded yet, it is loaded;
3089
    if the driver was loaded yet, nothing happens.
3076
    if the driver was loaded yet, nothing happens.
3090
 
3077
 
3091
======================================================================
3078
======================================================================
3092
======== Function 68, subfunction 22 - open named memory area. =======
3079
======== Function 68, subfunction 22 - open named memory area. =======
3093
======================================================================
3080
======================================================================
3094
Parameters:
3081
Parameters:
3095
  * eax = 68 - function number
3082
  * eax = 68 - function number
3096
  * ebx = 22 - subfunction number
3083
  * ebx = 22 - subfunction number
3097
  * ecx = area name. Maximum of 31 characters with terminating zero
3084
  * ecx = area name. Maximum of 31 characters with terminating zero
3098
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3085
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3099
  * esi = flags for open and access:
3086
  * esi = flags for open and access:
3100
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3087
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3101
                          with such name does not exist, the function
3088
                          with such name does not exist, the function
3102
                          will return error code 5.
3089
                          will return error code 5.
3103
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3090
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3104
                          memory area.
3091
                          memory area.
3105
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3092
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3106
                          with such name already exists, the function
3093
                          with such name already exists, the function
3107
                          will return error code 10.
3094
                          will return error code 10.
3108
    * SHM_READ        = 0x00 - only read access
3095
    * SHM_READ        = 0x00 - only read access
3109
    * SHM_WRITE       = 0x01 - read and write access
3096
    * SHM_WRITE       = 0x01 - read and write access
3110
Returned value:
3097
Returned value:
3111
  * eax = pointer to memory area, 0 if error has occured
3098
  * eax = pointer to memory area, 0 if error has occured
3112
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3099
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3113
    edx = 0 - success, otherwise - error code
3100
    edx = 0 - success, otherwise - error code
3114
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3101
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3115
    edx = error code (if eax=0) or area size in bytes
3102
    edx = error code (if eax=0) or area size in bytes
3116
Error codes:
3103
Error codes:
3117
  * E_NOTFOUND = 5
3104
  * E_NOTFOUND = 5
3118
  * E_ACCESS = 10
3105
  * E_ACCESS = 10
3119
  * E_NOMEM = 30
3106
  * E_NOMEM = 30
3120
  * E_PARAM = 33
3107
  * E_PARAM = 33
3121
Remarks:
3108
Remarks:
3122
  * Before this call one must initialize process heap by call to
3109
  * Before this call one must initialize process heap by call to
3123
    subfunction 11.
3110
    subfunction 11.
3124
  * If a new area is created, access flags set maximal rights
3111
  * If a new area is created, access flags set maximal rights
3125
    for other processes. An attempt from other process to open
3112
    for other processes. An attempt from other process to open
3126
    with denied rights will fail with error code E_ACCESS.
3113
    with denied rights will fail with error code E_ACCESS.
3127
  * The process which has created an area always has write access.
3114
  * The process which has created an area always has write access.
3128
 
3115
 
3129
======================================================================
3116
======================================================================
3130
======= Function 68, subfunction 23 - close named memory area. =======
3117
======= Function 68, subfunction 23 - close named memory area. =======
3131
======================================================================
3118
======================================================================
3132
Parameters:
3119
Parameters:
3133
  * eax = 68 - function number
3120
  * eax = 68 - function number
3134
  * ebx = 23 - subfunction number
3121
  * ebx = 23 - subfunction number
3135
  * ecx = area name. Maximum of 31 characters with terminating zero
3122
  * ecx = area name. Maximum of 31 characters with terminating zero
3136
Returned value:
3123
Returned value:
3137
  * eax destroyed
3124
  * eax destroyed
3138
Remarks:
3125
Remarks:
3139
  * A memory area is physically freed (with deleting all data and
3126
  * A memory area is physically freed (with deleting all data and
3140
    freeing physical memory), when all threads which have opened
3127
    freeing physical memory), when all threads which have opened
3141
    this area will close it.
3128
    this area will close it.
3142
  * When thread is terminating, all opened by it areas are closed.
3129
  * When thread is terminating, all opened by it areas are closed.
3143
 
3130
 
3144
======================================================================
3131
======================================================================
3145
======== Function 68, subfunction 24 - set exception handler. ========
3132
======== Function 68, subfunction 24 - set exception handler. ========
3146
======================================================================
3133
======================================================================
3147
Parameters:
3134
Parameters:
3148
  * eax = 68 - function number
3135
  * eax = 68 - function number
3149
  * ebx = 24 - subfunction number
3136
  * ebx = 24 - subfunction number
3150
  * ecx = address of the new exception handler
3137
  * ecx = address of the new exception handler
3151
  * edx = the mask of handled exceptions
3138
  * edx = the mask of handled exceptions
3152
Returned value:
3139
Returned value:
3153
  * eax = address of the old exception handler (0, if it was not set)
3140
  * eax = address of the old exception handler (0, if it was not set)
3154
  * ebx = the old mask of handled exceptions
3141
  * ebx = the old mask of handled exceptions
3155
Remarks:
3142
Remarks:
3156
  * Bit number in mask of exceptions corresponds to exception number
3143
  * Bit number in mask of exceptions corresponds to exception number
3157
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3144
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3158
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3145
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3159
  * The current implementation ignores the inquiry for hook of 7
3146
  * The current implementation ignores the inquiry for hook of 7
3160
    exception - the system handles #NM by its own.
3147
    exception - the system handles #NM by its own.
3161
  * The exception handler is called with exception number as first
3148
  * The exception handler is called with exception number as first
3162
    (and only) stack parameter. So, correct exit from the handler is
3149
    (and only) stack parameter. So, correct exit from the handler is
3163
    RET 4. It returns to the instruction, that caused the exception,
3150
    RET 4. It returns to the instruction, that caused the exception,
3164
    for faults, and to the next instruction for traps (see
3151
    for faults, and to the next instruction for traps (see
3165
    classification of exceptions in CPU specification).
3152
    classification of exceptions in CPU specification).
3166
  * When user handler receives control, the corresponding bit in
3153
  * When user handler receives control, the corresponding bit in
3167
    the exception mask is cleared. Raising this exception
3154
    the exception mask is cleared. Raising this exception
3168
    in consequence leads to default handling, that is,
3155
    in consequence leads to default handling, that is,
3169
    terminating the application in absence of debugger or
3156
    terminating the application in absence of debugger or
3170
    suspend with notification of debugger otherwise.
3157
    suspend with notification of debugger otherwise.
3171
  * After user handler completes critical operations, it can set
3158
  * After user handler completes critical operations, it can set
3172
    the corresponding bit in the exception mask with subfunction 25.
3159
    the corresponding bit in the exception mask with subfunction 25.
3173
    Also user handler is responsible for clearing exceptions flags in
3160
    Also user handler is responsible for clearing exceptions flags in
3174
    FPU and/or SSE.
3161
    FPU and/or SSE.
3175
 
3162
 
3176
======================================================================
3163
======================================================================
3177
====== Function 68, subfunction 25 - set FPU exception handler. ======
3164
====== Function 68, subfunction 25 - set FPU exception handler. ======
3178
======================================================================
3165
======================================================================
3179
Parameters:
3166
Parameters:
3180
  * eax = 68 - function number
3167
  * eax = 68 - function number
3181
  * ebx = 25 - subfunction number
3168
  * ebx = 25 - subfunction number
3182
  * ecx = signal number
3169
  * ecx = signal number
3183
  * edx = value of activity (0/1)
3170
  * edx = value of activity (0/1)
3184
Returned value:
3171
Returned value:
3185
  * eax = -1 - invalid signal number
3172
  * eax = -1 - invalid signal number
3186
  * otherwise eax = old value of activity for this signal (0/1)
3173
  * otherwise eax = old value of activity for this signal (0/1)
3187
Remarks:
3174
Remarks:
3188
  * In current implementation only mask for user excepton handler,
3175
  * In current implementation only mask for user excepton handler,
3189
    which has been previously set by subfunction 24,
3176
    which has been previously set by subfunction 24,
3190
    is changed. Signal number corresponds to exception number.
3177
    is changed. Signal number corresponds to exception number.
3191
 
3178
 
3192
======================================================================
3179
======================================================================
3193
====== Function 68, subfunction 26 - release memory pages ============
3180
====== Function 68, subfunction 26 - release memory pages ============
3194
======================================================================
3181
======================================================================
3195
Parameters:
3182
Parameters:
3196
  * eax = 68 - function number
3183
  * eax = 68 - function number
3197
  * ebx = 26 - subfunction number
3184
  * ebx = 26 - subfunction number
3198
  * ecx = pointer to the memory block, allocated by subfunction 12
3185
  * ecx = pointer to the memory block, allocated by subfunction 12
3199
  * edx = offset from the block beginnings
3186
  * edx = offset from the block beginnings
3200
  * esi = the size of the region of memory to release, in bytes
3187
  * esi = the size of the region of memory to release, in bytes
3201
Remarks:
3188
Remarks:
3202
  * function release range of pages from ecx+edx to ecx+edx+esi
3189
  * function release range of pages from ecx+edx to ecx+edx+esi
3203
    and set virtual memory into reserved state.
3190
    and set virtual memory into reserved state.
3204
 
3191
 
3205
======================================================================
3192
======================================================================
3206
========== Function 68, subfunction 27 - load file ===================
3193
========== Function 68, subfunction 27 - load file ===================
3207
======================================================================
3194
======================================================================
3208
Parameters:
3195
Parameters:
3209
  * eax = 68 - function number
3196
  * eax = 68 - function number
3210
  * ebx = 27 - subfunction number
3197
  * ebx = 27 - subfunction number
3211
  * ecx = pointer to ASCIIZ-string with the filename
3198
  * ecx = pointer to ASCIIZ-string with the filename
3212
Returned value:
3199
Returned value:
3213
  * eax = pointer to the loaded file, or zero
3200
  * eax = pointer to the loaded file, or zero
3214
  * edx = size of the loaded file, or zero
3201
  * edx = size of the loaded file, or zero
3215
Remarks:
3202
Remarks:
3216
  * function loads file and unpacks, if necessary
3203
  * function loads file and unpacks, if necessary
3217
 
3204
 
3218
======================================================================
3205
======================================================================
3219
====================== Function 69 - debugging. ======================
3206
====================== Function 69 - debugging. ======================
3220
======================================================================
3207
======================================================================
3221
A process can load other process as debugged by set of corresponding
3208
A process can load other process as debugged by set of corresponding
3222
bit by call to subfunction 7 of function 70.
3209
bit by call to subfunction 7 of function 70.
3223
A process can have only one debugger; one process can debug some
3210
A process can have only one debugger; one process can debug some
3224
others. The system notifies debugger on events occuring with
3211
others. The system notifies debugger on events occuring with
3225
debugged process. Messages are written to the buffer defined by
3212
debugged process. Messages are written to the buffer defined by
3226
subfunction 0.
3213
subfunction 0.
3227
Format of a message:
3214
Format of a message:
3228
  * +0: dword: message code
3215
  * +0: dword: message code
3229
  * +4: dword: PID of debugged process
3216
  * +4: dword: PID of debugged process
3230
  * +8: there can be additional data depending on message code
3217
  * +8: there can be additional data depending on message code
3231
Message codes:
3218
Message codes:
3232
  * 1 = exception
3219
  * 1 = exception
3233
    * in addition dword-number of the exception is given
3220
    * in addition dword-number of the exception is given
3234
    * process is suspended
3221
    * process is suspended
3235
  * 2 = process has terminated
3222
  * 2 = process has terminated
3236
    * comes at any termination: both through the system function -1,
3223
    * comes at any termination: both through the system function -1,
3237
      and at "murder" by any other process (including debugger itself)
3224
      and at "murder" by any other process (including debugger itself)
3238
  * 3 = debug exception int 1 = #DB
3225
  * 3 = debug exception int 1 = #DB
3239
    * in addition dword-image of the register DR6 is given:
3226
    * in addition dword-image of the register DR6 is given:
3240
      * bits 0-3: condition of the corresponding breakpoint (set by
3227
      * bits 0-3: condition of the corresponding breakpoint (set by
3241
        subfunction 9) is satisfied
3228
        subfunction 9) is satisfied
3242
      * bit 14: exception has occured because of the trace mode
3229
      * bit 14: exception has occured because of the trace mode
3243
        (flag TF is set TF)
3230
        (flag TF is set TF)
3244
    * process is suspended
3231
    * process is suspended
3245
When debugger terminates, all debugged processes are killed.
3232
When debugger terminates, all debugged processes are killed.
3246
If debugger does not want this, it must previously detach by
3233
If debugger does not want this, it must previously detach by
3247
subfunction 3.
3234
subfunction 3.
3248
 
3235
 
3249
All subfunctions are applicable only to processes/threads started
3236
All subfunctions are applicable only to processes/threads started
3250
from the current by function 70 with set debugging flag.
3237
from the current by function 70 with set debugging flag.
3251
Debugging of multithreaded programs is not supported yet.
3238
Debugging of multithreaded programs is not supported yet.
3252
The full list of subfunctions:
3239
The full list of subfunctions:
3253
  * subfunction 0 - define data area for debug messages
3240
  * subfunction 0 - define data area for debug messages
3254
  * subfunction 1 - get contents of registers of debugged thread
3241
  * subfunction 1 - get contents of registers of debugged thread
3255
  * subfunction 2 - set contents of registers of debugged thread
3242
  * subfunction 2 - set contents of registers of debugged thread
3256
  * subfunction 3 - detach from debugged process
3243
  * subfunction 3 - detach from debugged process
3257
  * subfunction 4 - suspend debugged thread
3244
  * subfunction 4 - suspend debugged thread
3258
  * subfunction 5 - resume debugged thread
3245
  * subfunction 5 - resume debugged thread
3259
  * subfunction 6 - read from the memory of debugged process
3246
  * subfunction 6 - read from the memory of debugged process
3260
  * subfunction 7 - write to the memory of debugged process
3247
  * subfunction 7 - write to the memory of debugged process
3261
  * subfunction 8 - terminate debugged thread
3248
  * subfunction 8 - terminate debugged thread
3262
  * subfunction 9 - set/clear hardware breakpoint
3249
  * subfunction 9 - set/clear hardware breakpoint
3263
 
3250
 
3264
======================================================================
3251
======================================================================
3265
= Function 69, subfunction 0 - define data area fror debug messages. =
3252
= Function 69, subfunction 0 - define data area fror debug messages. =
3266
======================================================================
3253
======================================================================
3267
Parameters:
3254
Parameters:
3268
  * eax = 69 - function number
3255
  * eax = 69 - function number
3269
  * ebx = 0 - subfunction number
3256
  * ebx = 0 - subfunction number
3270
  * ecx = pointer
3257
  * ecx = pointer
3271
Format of data area:
3258
Format of data area:
3272
  * +0: dword: N = buffer size (not including this header)
3259
  * +0: dword: N = buffer size (not including this header)
3273
  * +4: dword: occupied place
3260
  * +4: dword: occupied place
3274
  * +8: N*byte: buffer
3261
  * +8: N*byte: buffer
3275
Returned value:
3262
Returned value:
3276
  * function does not return value
3263
  * function does not return value
3277
Remarks:
3264
Remarks:
3278
  * If the size field is negative, the buffer is considered locked
3265
  * If the size field is negative, the buffer is considered locked
3279
    and at arrival of new message the system will wait.
3266
    and at arrival of new message the system will wait.
3280
    For synchronization frame all work with the buffer by operations
3267
    For synchronization frame all work with the buffer by operations
3281
    lock/unlock
3268
    lock/unlock
3282
        neg     [bufsize]
3269
        neg     [bufsize]
3283
  * Data in the buffer are considered as array of items with variable
3270
  * Data in the buffer are considered as array of items with variable
3284
    length - messages. Format of a message is explained in
3271
    length - messages. Format of a message is explained in
3285
    general description.
3272
    general description.
3286
 
3273
 
3287
======================================================================
3274
======================================================================
3288
===================== Function 69, subfunction 1 =====================
3275
===================== Function 69, subfunction 1 =====================
3289
============ Get contents of registers of debugged thread. ===========
3276
============ Get contents of registers of debugged thread. ===========
3290
======================================================================
3277
======================================================================
3291
Parameters:
3278
Parameters:
3292
  * eax = 69 - function number
3279
  * eax = 69 - function number
3293
  * ebx = 1 - subfunction number
3280
  * ebx = 1 - subfunction number
3294
  * ecx = thread identifier
3281
  * ecx = thread identifier
3295
  * edx = size of context structure, must be 0x28=40 bytes
3282
  * edx = size of context structure, must be 0x28=40 bytes
3296
  * esi = pointer to context structure
3283
  * esi = pointer to context structure
3297
Returned value:
3284
Returned value:
3298
  * function does not return value
3285
  * function does not return value
3299
Format of context structure: (FPU is not supported yet)
3286
Format of context structure: (FPU is not supported yet)
3300
  * +0: dword: eip
3287
  * +0: dword: eip
3301
  * +4: dword: eflags
3288
  * +4: dword: eflags
3302
  * +8: dword: eax
3289
  * +8: dword: eax
3303
  * +12 = +0xC: dword: ecx
3290
  * +12 = +0xC: dword: ecx
3304
  * +16 = +0x10: dword: edx
3291
  * +16 = +0x10: dword: edx
3305
  * +20 = +0x14: dword: ebx
3292
  * +20 = +0x14: dword: ebx
3306
  * +24 = +0x18: dword: esp
3293
  * +24 = +0x18: dword: esp
3307
  * +28 = +0x1C: dword: ebp
3294
  * +28 = +0x1C: dword: ebp
3308
  * +32 = +0x20: dword: esi
3295
  * +32 = +0x20: dword: esi
3309
  * +36 = +0x24: dword: edi
3296
  * +36 = +0x24: dword: edi
3310
Remarks:
3297
Remarks:
3311
  * If the thread executes code of ring-0, the function returns
3298
  * If the thread executes code of ring-0, the function returns
3312
    contents of registers of ring-3.
3299
    contents of registers of ring-3.
3313
  * Process must be loaded for debugging (as is shown in
3300
  * Process must be loaded for debugging (as is shown in
3314
    general description).
3301
    general description).
3315
 
3302
 
3316
======================================================================
3303
======================================================================
3317
===================== Function 69, subfunction 2 =====================
3304
===================== Function 69, subfunction 2 =====================
3318
============ Set contents of registers of debugged thread. ===========
3305
============ Set contents of registers of debugged thread. ===========
3319
======================================================================
3306
======================================================================
3320
Parameters:
3307
Parameters:
3321
  * eax = 69 - function number
3308
  * eax = 69 - function number
3322
  * ebx = 2 - subfunction number
3309
  * ebx = 2 - subfunction number
3323
  * ecx = thread identifier
3310
  * ecx = thread identifier
3324
  * edx = size of context structure, must be 0x28=40 bytes
3311
  * edx = size of context structure, must be 0x28=40 bytes
3325
Returned value:
3312
Returned value:
3326
  * function does not return value
3313
  * function does not return value
3327
Format of context structure is shown in the description of
3314
Format of context structure is shown in the description of
3328
subfunction 1.
3315
subfunction 1.
3329
Remarks:
3316
Remarks:
3330
  * If the thread executes code of ring-0, the function returns
3317
  * If the thread executes code of ring-0, the function returns
3331
    contents of registers of ring-3.
3318
    contents of registers of ring-3.
3332
  * Process must be loaded for debugging (as is shown in
3319
  * Process must be loaded for debugging (as is shown in
3333
    general description).
3320
    general description).
3334
 
3321
 
3335
======================================================================
3322
======================================================================
3336
===== Function 69, subfunction 3 - detach from debugged process. =====
3323
===== Function 69, subfunction 3 - detach from debugged process. =====
3337
======================================================================
3324
======================================================================
3338
Parameters:
3325
Parameters:
3339
  * eax = 69 - function number
3326
  * eax = 69 - function number
3340
  * ebx = 3 - subfunction number
3327
  * ebx = 3 - subfunction number
3341
  * ecx = identifier
3328
  * ecx = identifier
3342
Returned value:
3329
Returned value:
3343
  * function does not return value
3330
  * function does not return value
3344
Remarks:
3331
Remarks:
3345
  * If the process was suspended, it resumes execution.
3332
  * If the process was suspended, it resumes execution.
3346
 
3333
 
3347
======================================================================
3334
======================================================================
3348
======== Function 69, subfunction 4 - suspend debugged thread. =======
3335
======== Function 69, subfunction 4 - suspend debugged thread. =======
3349
======================================================================
3336
======================================================================
3350
Parameters:
3337
Parameters:
3351
  * eax = 69 - function number
3338
  * eax = 69 - function number
3352
  * ebx = 4 - subfunction number
3339
  * ebx = 4 - subfunction number
3353
  * ecx = thread identifier
3340
  * ecx = thread identifier
3354
Returned value:
3341
Returned value:
3355
  * function does not return value
3342
  * function does not return value
3356
Remarks:
3343
Remarks:
3357
  * Process must be loaded for debugging (as is shown in
3344
  * Process must be loaded for debugging (as is shown in
3358
    general description).
3345
    general description).
3359
 
3346
 
3360
======================================================================
3347
======================================================================
3361
======== Function 69, subfunction 5 - resume debugged thread. ========
3348
======== Function 69, subfunction 5 - resume debugged thread. ========
3362
======================================================================
3349
======================================================================
3363
Parameters:
3350
Parameters:
3364
  * eax = 69 - function number
3351
  * eax = 69 - function number
3365
  * ebx = 5 - subfunction number
3352
  * ebx = 5 - subfunction number
3366
  * ecx = thread identifier
3353
  * ecx = thread identifier
3367
Returned value:
3354
Returned value:
3368
  * function does not return value
3355
  * function does not return value
3369
Remarks:
3356
Remarks:
3370
  * Process must be loaded for debugging (as is shown in
3357
  * Process must be loaded for debugging (as is shown in
3371
    general description).
3358
    general description).
3372
 
3359
 
3373
======================================================================
3360
======================================================================
3374
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3361
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3375
======================================================================
3362
======================================================================
3376
Parameters:
3363
Parameters:
3377
  * eax = 69 - function number
3364
  * eax = 69 - function number
3378
  * ebx = 6 - subfunction number
3365
  * ebx = 6 - subfunction number
3379
  * ecx = identifier
3366
  * ecx = identifier
3380
  * edx = number of bytes to read
3367
  * edx = number of bytes to read
3381
  * esi = address in the memory of debugged process
3368
  * esi = address in the memory of debugged process
3382
  * edi = pointer to buffer for data
3369
  * edi = pointer to buffer for data
3383
Returned value:
3370
Returned value:
3384
  * eax = -1 at an error (invalid PID or buffer)
3371
  * eax = -1 at an error (invalid PID or buffer)
3385
  * otherwise eax = number of read bytes (possibly, 0,
3372
  * otherwise eax = number of read bytes (possibly, 0,
3386
    if esi is too large)
3373
    if esi is too large)
3387
Remarks:
3374
Remarks:
3388
  * Process must be loaded for debugging (as is shown in
3375
  * Process must be loaded for debugging (as is shown in
3389
    general description).
3376
    general description).
3390
 
3377
 
3391
======================================================================
3378
======================================================================
3392
== Function 69, subfunction 7 - write to memory of debugged process. =
3379
== Function 69, subfunction 7 - write to memory of debugged process. =
3393
======================================================================
3380
======================================================================
3394
Parameters:
3381
Parameters:
3395
  * eax = 69 - function number
3382
  * eax = 69 - function number
3396
  * ebx = 7 - subfunction number
3383
  * ebx = 7 - subfunction number
3397
  * ecx = identifier
3384
  * ecx = identifier
3398
  * edx = number of bytes to write
3385
  * edx = number of bytes to write
3399
  * esi = address of memory in debugged process
3386
  * esi = address of memory in debugged process
3400
  * edi = pointer to data
3387
  * edi = pointer to data
3401
Returned value:
3388
Returned value:
3402
  * eax = -1 at an error (invalid PID or buffer)
3389
  * eax = -1 at an error (invalid PID or buffer)
3403
  * otherwise eax = number of written bytes (possibly, 0,
3390
  * otherwise eax = number of written bytes (possibly, 0,
3404
    if esi is too large)
3391
    if esi is too large)
3405
Remarks:
3392
Remarks:
3406
  * Process must be loaded for debugging (as is shown in
3393
  * Process must be loaded for debugging (as is shown in
3407
    general description).
3394
    general description).
3408
 
3395
 
3409
======================================================================
3396
======================================================================
3410
======= Function 69, subfunction 8 - terminate debugged thread. ======
3397
======= Function 69, subfunction 8 - terminate debugged thread. ======
3411
======================================================================
3398
======================================================================
3412
Parameters:
3399
Parameters:
3413
  * eax = 69 - function number
3400
  * eax = 69 - function number
3414
  * ebx = 8 - subfunction number
3401
  * ebx = 8 - subfunction number
3415
  * ecx = identifier
3402
  * ecx = identifier
3416
Returned value:
3403
Returned value:
3417
  * function does not return value
3404
  * function does not return value
3418
Remarks:
3405
Remarks:
3419
  * Process must be loaded for debugging (as is shown in
3406
  * Process must be loaded for debugging (as is shown in
3420
    general description).
3407
    general description).
3421
  * The function is similar to subfunction 2 of function 18
3408
  * The function is similar to subfunction 2 of function 18
3422
    with two differences: it requires first remark and
3409
    with two differences: it requires first remark and
3423
    accepts PID rather than slot number.
3410
    accepts PID rather than slot number.
3424
 
3411
 
3425
======================================================================
3412
======================================================================
3426
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3413
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3427
======================================================================
3414
======================================================================
3428
Parameters:
3415
Parameters:
3429
  * eax = 69 - function number
3416
  * eax = 69 - function number
3430
  * ebx = 9 - subfunction number
3417
  * ebx = 9 - subfunction number
3431
  * ecx = thread identifier
3418
  * ecx = thread identifier
3432
  * dl = index of breakpoint, from 0 to 3 inclusively
3419
  * dl = index of breakpoint, from 0 to 3 inclusively
3433
  * dh = flags:
3420
  * dh = flags:
3434
    * if high bit is cleared - set breakpoint:
3421
    * if high bit is cleared - set breakpoint:
3435
      * bits 0-1 - condition:
3422
      * bits 0-1 - condition:
3436
        * 00 = breakpoint on execution
3423
        * 00 = breakpoint on execution
3437
        * 01 = breakpoint on read
3424
        * 01 = breakpoint on read
3438
        * 11 = breakpoint on read/write
3425
        * 11 = breakpoint on read/write
3439
      * bits 2-3 - length; for breakpoints on exception it must be
3426
      * bits 2-3 - length; for breakpoints on exception it must be
3440
        00, otherwise one of
3427
        00, otherwise one of
3441
        * 00 = byte
3428
        * 00 = byte
3442
        * 01 = word
3429
        * 01 = word
3443
        * 11 = dword
3430
        * 11 = dword
3444
      * esi = breakpoint address; must be aligned according to
3431
      * esi = breakpoint address; must be aligned according to
3445
        the length (i.e. must be even for word breakpoints,
3432
        the length (i.e. must be even for word breakpoints,
3446
        divisible by 4 for dword)
3433
        divisible by 4 for dword)
3447
    * if high bit is set - clear breakpoint
3434
    * if high bit is set - clear breakpoint
3448
Returned value:
3435
Returned value:
3449
  * eax = 0 - success
3436
  * eax = 0 - success
3450
  * eax = 1 - error in the input data
3437
  * eax = 1 - error in the input data
3451
  * eax = 2 - (reserved, is never returned in the current
3438
  * eax = 2 - (reserved, is never returned in the current
3452
    implementation) a global breakpoint with that index is already set
3439
    implementation) a global breakpoint with that index is already set
3453
Remarks:
3440
Remarks:
3454
  * Process must be loaded for debugging (as is shown in
3441
  * Process must be loaded for debugging (as is shown in
3455
    general description).
3442
    general description).
3456
  * Hardware breakpoints are implemented through DRx-registers of
3443
  * Hardware breakpoints are implemented through DRx-registers of
3457
    the processor, all limitations results from this.
3444
    the processor, all limitations results from this.
3458
  * The function can reinstall the breakpoint, previously set
3445
  * The function can reinstall the breakpoint, previously set
3459
    by it (and it does not inform on this).
3446
    by it (and it does not inform on this).
3460
    Carry on the list of set breakpoints in the debugger.
3447
    Carry on the list of set breakpoints in the debugger.
3461
  * Breakpoints generate debug exception #DB, on which the system
3448
  * Breakpoints generate debug exception #DB, on which the system
3462
    notifies debugger.
3449
    notifies debugger.
3463
  * Breakpoints on write and read/write act after
3450
  * Breakpoints on write and read/write act after
3464
    execution of the caused it instruction.
3451
    execution of the caused it instruction.
3465
 
3452
 
3466
======================================================================
3453
======================================================================
3467
==== Function 70 - work with file system with long names support. ====
3454
==== Function 70 - work with file system with long names support. ====
3468
======================================================================
3455
======================================================================
3469
Parameters:
3456
Parameters:
3470
  * eax = 70
3457
  * eax = 70
3471
  * ebx = pointer to the information structure
3458
  * ebx = pointer to the information structure
3472
Returned value:
3459
Returned value:
3473
  * eax = 0 - success; otherwise file system error code
3460
  * eax = 0 - success; otherwise file system error code
3474
  * some subfunctions return value in other registers too
3461
  * some subfunctions return value in other registers too
3475
General format of the information structure:
3462
General format of the information structure:
3476
  * +0: dword: subfunction number
3463
  * +0: dword: subfunction number
3477
  * +4: dword: file offset
3464
  * +4: dword: file offset
3478
  * +8: dword: high dword of offset (must be 0) or flags field
3465
  * +8: dword: high dword of offset (must be 0) or flags field
3479
  * +12 = +0xC: dword: size
3466
  * +12 = +0xC: dword: size
3480
  * +16 = +0x10: dword: pointer to data
3467
  * +16 = +0x10: dword: pointer to data
3481
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3468
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3482
    or
3469
    or
3483
  * +20 = +0x14: db 0
3470
  * +20 = +0x14: db 0
3484
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3471
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3485
Specifications - in documentation on the appropriate subfunction.
3472
Specifications - in documentation on the appropriate subfunction.
3486
Filename is case-insensitive. Russian letters must be written in
3473
Filename is case-insensitive. Russian letters must be written in
3487
the encoding cp866 (DOS).
3474
the encoding cp866 (DOS).
3488
Format of filename:
3475
Format of filename:
3489
/base/number/dir1/dir2/.../dirn/file,
3476
/base/number/dir1/dir2/.../dirn/file,
3490
where /base/number identifies device, on which file is located:
3477
where /base/number identifies device, on which file is located:
3491
one of
3478
one of
3492
  * /RD/1 = /RAMDISK/1 to access ramdisk
3479
  * /RD/1 = /RAMDISK/1 to access ramdisk
3493
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3480
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3494
    /FD/2 = /FLOPPYDISK/2 to access second one
3481
    /FD/2 = /FLOPPYDISK/2 to access second one
3495
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3482
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3496
    IDE0 (Primary Master), IDE1 (Primary Slave),
3483
    IDE0 (Primary Master), IDE1 (Primary Slave),
3497
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3484
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3498
    x - partition number on the selected hard drive, varies from 1
3485
    x - partition number on the selected hard drive, varies from 1
3499
    to 255 (on each hard drive the indexing starts from 1)
3486
    to 255 (on each hard drive the indexing starts from 1)
3500
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3487
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3501
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3488
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3502
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3489
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3503
  * /SYS means system folder; with the usual boot (from floppy)
3490
  * /SYS means system folder; with the usual boot (from floppy)
3504
    is equivalent to /RD/1
3491
    is equivalent to /RD/1
3505
Examples:
3492
Examples:
3506
  * '/rd/1/kernel.asm',0
3493
  * '/rd/1/kernel.asm',0
3507
  * '/HD0/1/kernel.asm',0
3494
  * '/HD0/1/kernel.asm',0
3508
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3495
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3509
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3496
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3510
  * '/sys/MySuperApp.ini',0
3497
  * '/sys/MySuperApp.ini',0
3511
Also function supports relative names.  If the path begins not
3498
Also function supports relative names.  If the path begins not
3512
with '/', it is considered relative to a current folder. To get or
3499
with '/', it is considered relative to a current folder. To get or
3513
set a current folder, use the function 30.
3500
set a current folder, use the function 30.
3514
 
3501
 
3515
Available subfunctions:
3502
Available subfunctions:
3516
  * subfunction 0 - read file
3503
  * subfunction 0 - read file
3517
  * subfunction 1 - read folder
3504
  * subfunction 1 - read folder
3518
  * subfunction 2 - create/rewrite file
3505
  * subfunction 2 - create/rewrite file
3519
  * subfunction 3 - write to existing file
3506
  * subfunction 3 - write to existing file
3520
  * subfunction 4 - set file size
3507
  * subfunction 4 - set file size
3521
  * subfunction 5 - get attributes of file/folder
3508
  * subfunction 5 - get attributes of file/folder
3522
  * subfunction 6 - set attributes of file/folder
3509
  * subfunction 6 - set attributes of file/folder
3523
  * subfunction 7 - start application
3510
  * subfunction 7 - start application
3524
  * subfunction 8 - delete file/folder
3511
  * subfunction 8 - delete file/folder
3525
  * subfunction 9 - create folder
3512
  * subfunction 9 - create folder
3526
For CD-drives due to hardware limitations only subfunctions
3513
For CD-drives due to hardware limitations only subfunctions
3527
0,1,5 and 7 are available, other subfunctions return error
3514
0,1,5 and 7 are available, other subfunctions return error
3528
with code 2.
3515
with code 2.
3529
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3516
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3530
(CD and DVD) the manual control of tray is locked due to caching
3517
(CD and DVD) the manual control of tray is locked due to caching
3531
drive data. Unlocking is made when subfunction 4 of function 24
3518
drive data. Unlocking is made when subfunction 4 of function 24
3532
is called for corresponding device.
3519
is called for corresponding device.
3533
 
3520
 
3534
======================================================================
3521
======================================================================
3535
=== Function 70, subfunction 0 - read file with long names support. ==
3522
=== Function 70, subfunction 0 - read file with long names support. ==
3536
======================================================================
3523
======================================================================
3537
Parameters:
3524
Parameters:
3538
  * eax = 70 - function number
3525
  * eax = 70 - function number
3539
  * ebx = pointer to the information structure
3526
  * ebx = pointer to the information structure
3540
Format of the information structure:
3527
Format of the information structure:
3541
  * +0: dword: 0 = subfunction number
3528
  * +0: dword: 0 = subfunction number
3542
  * +4: dword: file offset (in bytes)
3529
  * +4: dword: file offset (in bytes)
3543
  * +8: dword: 0 (reserved for high dword of offset)
3530
  * +8: dword: 0 (reserved for high dword of offset)
3544
  * +12 = +0xC: dword: number of bytes to read
3531
  * +12 = +0xC: dword: number of bytes to read
3545
  * +16 = +0x10: dword: pointer to buffer for data
3532
  * +16 = +0x10: dword: pointer to buffer for data
3546
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3533
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3547
    given in the general description
3534
    given in the general description
3548
    or
3535
    or
3549
  * +20 = +0x14: db 0
3536
  * +20 = +0x14: db 0
3550
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3537
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3551
Returned value:
3538
Returned value:
3552
  * eax = 0 - success, otherwise file system error code
3539
  * eax = 0 - success, otherwise file system error code
3553
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3540
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3554
Remarks:
3541
Remarks:
3555
  * If file was ended before last requested block was read,
3542
  * If file was ended before last requested block was read,
3556
    the function will read as many as it can, and after that return
3543
    the function will read as many as it can, and after that return
3557
    eax=6 (EOF).
3544
    eax=6 (EOF).
3558
  * The function does not allow to read folder (returns eax=10,
3545
  * The function does not allow to read folder (returns eax=10,
3559
    access denied).
3546
    access denied).
3560
 
3547
 
3561
======================================================================
3548
======================================================================
3562
== Function 70, subfunction 1 - read folder with long names support. =
3549
== Function 70, subfunction 1 - read folder with long names support. =
3563
======================================================================
3550
======================================================================
3564
Parameters:
3551
Parameters:
3565
  * eax = 70 - function number
3552
  * eax = 70 - function number
3566
  * ebx = pointer to the information structure
3553
  * ebx = pointer to the information structure
3567
Format of the information structure:
3554
Format of the information structure:
3568
  * +0: dword: 1 = subfunction number
3555
  * +0: dword: 1 = subfunction number
3569
  * +4: dword: index of starting block (beginning from 0)
3556
  * +4: dword: index of starting block (beginning from 0)
3570
  * +8: dword: flags field:
3557
  * +8: dword: flags field:
3571
    * bit 0 (mask 1): in what format to return names,
3558
    * bit 0 (mask 1): in what format to return names,
3572
      0=ANSI, 1=UNICODE
3559
      0=ANSI, 1=UNICODE
3573
    * other bits are reserved and must be set to 0 for the future
3560
    * other bits are reserved and must be set to 0 for the future
3574
      compatibility
3561
      compatibility
3575
  * +12 = +0xC: dword: number of blocks to read
3562
  * +12 = +0xC: dword: number of blocks to read
3576
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3563
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3577
    must be not less than 32 + [+12]*560 bytes
3564
    must be not less than 32 + [+12]*560 bytes
3578
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3565
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3579
    given in the general description
3566
    given in the general description
3580
    or
3567
    or
3581
  * +20 = +0x14: db 0
3568
  * +20 = +0x14: db 0
3582
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3569
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3583
Returned value:
3570
Returned value:
3584
  * eax = 0 - success, otherwise file system error code
3571
  * eax = 0 - success, otherwise file system error code
3585
  * ebx = number of files, information on which was written to
3572
  * ebx = number of files, information on which was written to
3586
    the buffer, or -1=0xffffffff, if folder was not found
3573
    the buffer, or -1=0xffffffff, if folder was not found
3587
Structure of the buffer:
3574
Structure of the buffer:
3588
  * +0: 32*byte: header
3575
  * +0: 32*byte: header
3589
  * +32 = +0x20: n1*byte: block with information on file 1
3576
  * +32 = +0x20: n1*byte: block with information on file 1
3590
  * +32+n1: n2*byte: block with information on file 2
3577
  * +32+n1: n2*byte: block with information on file 2
3591
  * ...
3578
  * ...
3592
Structure of header:
3579
Structure of header:
3593
  * +0: dword: version of structure (current is 1)
3580
  * +0: dword: version of structure (current is 1)
3594
  * +4: dword: number of placed blocks; is not greater than requested
3581
  * +4: dword: number of placed blocks; is not greater than requested
3595
    in the field +12 of information structure; can be less, if
3582
    in the field +12 of information structure; can be less, if
3596
    there are no more files in folder (the same as in ebx)
3583
    there are no more files in folder (the same as in ebx)
3597
  * +8: dword: total number of files in folder
3584
  * +8: dword: total number of files in folder
3598
  * +12 = +0xC: 20*byte: reserved (zeroed)
3585
  * +12 = +0xC: 20*byte: reserved (zeroed)
3599
Structure of block of data for folder entry (BDFE):
3586
Structure of block of data for folder entry (BDFE):
3600
  * +0: dword: attributes of file:
3587
  * +0: dword: attributes of file:
3601
    * bit 0 (mask 1): file is read-only
3588
    * bit 0 (mask 1): file is read-only
3602
    * bit 1 (mask 2): file is hidden
3589
    * bit 1 (mask 2): file is hidden
3603
    * bit 2 (mask 4): file is system
3590
    * bit 2 (mask 4): file is system
3604
    * bit 3 (mask 8): this is not a file but volume label
3591
    * bit 3 (mask 8): this is not a file but volume label
3605
      (for one partition meets no more than once and
3592
      (for one partition meets no more than once and
3606
      only in root folder)
3593
      only in root folder)
3607
    * bit 4 (mask 0x10): this is a folder
3594
    * bit 4 (mask 0x10): this is a folder
3608
    * bit 5 (mask 0x20): file was not archived - many archivation
3595
    * bit 5 (mask 0x20): file was not archived - many archivation
3609
      programs have an option to archive only files with this bit set,
3596
      programs have an option to archive only files with this bit set,
3610
      and after archiving this bit is cleared - it can be useful
3597
      and after archiving this bit is cleared - it can be useful
3611
      for automatically creating of backup-archives as at writing
3598
      for automatically creating of backup-archives as at writing
3612
      this bit is usually set
3599
      this bit is usually set
3613
  * +4: byte: type of name data:
3600
  * +4: byte: type of name data:
3614
    (coincides with bit 0 of flags in the information structure)
3601
    (coincides with bit 0 of flags in the information structure)
3615
    * 0 = ASCII = 1-byte representation of each character
3602
    * 0 = ASCII = 1-byte representation of each character
3616
    * 1 = UNICODE = 2-byte representation of each character
3603
    * 1 = UNICODE = 2-byte representation of each character
3617
  * +5: 3*byte: reserved (zero)
3604
  * +5: 3*byte: reserved (zero)
3618
  * +8: 4*byte: time of file creation
3605
  * +8: 4*byte: time of file creation
3619
  * +12 = +0xC: 4*byte: date of file creation
3606
  * +12 = +0xC: 4*byte: date of file creation
3620
  * +16 = +0x10: 4*byte: time of last access (read or write)
3607
  * +16 = +0x10: 4*byte: time of last access (read or write)
3621
  * +20 = +0x14: 4*byte: date of last access
3608
  * +20 = +0x14: 4*byte: date of last access
3622
  * +24 = +0x18: 4*byte: time of last modification
3609
  * +24 = +0x18: 4*byte: time of last modification
3623
  * +28 = +0x1C: 4*byte: date of last modification
3610
  * +28 = +0x1C: 4*byte: date of last modification
3624
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3611
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3625
  * +40 = +0x28: name
3612
  * +40 = +0x28: name
3626
    * for ASCII format: maximum length is 263 characters
3613
    * for ASCII format: maximum length is 263 characters
3627
      (263 bytes), byte after the name has value 0
3614
      (263 bytes), byte after the name has value 0
3628
    * for UNICODE format: maximum length is 259 characters
3615
    * for UNICODE format: maximum length is 259 characters
3629
      (518 bytes), 2 bytes after the name have value 0
3616
      (518 bytes), 2 bytes after the name have value 0
3630
Time format:
3617
Time format:
3631
  * +0: byte: seconds
3618
  * +0: byte: seconds
3632
  * +1: byte: minutes
3619
  * +1: byte: minutes
3633
  * +2: byte: hours
3620
  * +2: byte: hours
3634
  * +3: byte: reserved (0)
3621
  * +3: byte: reserved (0)
3635
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3622
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3636
Date format:
3623
Date format:
3637
  * +0: byte: day
3624
  * +0: byte: day
3638
  * +1: byte: month
3625
  * +1: byte: month
3639
  * +2: word: year
3626
  * +2: word: year
3640
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3627
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3641
Remarks:
3628
Remarks:
3642
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3629
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3643
    if UNICODE name - 560 bytes. Value of length is aligned
3630
    if UNICODE name - 560 bytes. Value of length is aligned
3644
    on 16-byte bound (to accelerate processing in CPU cache).
3631
    on 16-byte bound (to accelerate processing in CPU cache).
3645
  * First character after a name is zero (ASCIIZ-string). The further
3632
  * First character after a name is zero (ASCIIZ-string). The further
3646
    data contain garbage.
3633
    data contain garbage.
3647
  * If files in folder were ended before requested number was read,
3634
  * If files in folder were ended before requested number was read,
3648
    the function will read as many as it can, and after that return
3635
    the function will read as many as it can, and after that return
3649
    eax=6 (EOF).
3636
    eax=6 (EOF).
3650
  * Any folder on the disk, except for root, contains two special
3637
  * Any folder on the disk, except for root, contains two special
3651
    entries "." and "..", identifying accordingly the folder itself
3638
    entries "." and "..", identifying accordingly the folder itself
3652
    and the parent folder.
3639
    and the parent folder.
3653
  * The function allows also to read virtual folders "/", "/rd",
3640
  * The function allows also to read virtual folders "/", "/rd",
3654
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
3641
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
3655
    and times and dates are zeroed. An alternative way to get the
3642
    and times and dates are zeroed. An alternative way to get the
3656
    equipment information - subfunction 11 of function 18.
3643
    equipment information - subfunction 11 of function 18.
3657
 
3644
 
3658
======================================================================
3645
======================================================================
3659
===================== Function 70, subfunction 2 =====================
3646
===================== Function 70, subfunction 2 =====================
3660
============ Create/rewrite file with long names support. ============
3647
============ Create/rewrite file with long names support. ============
3661
======================================================================
3648
======================================================================
3662
Parameters:
3649
Parameters:
3663
  * eax = 70 - function number
3650
  * eax = 70 - function number
3664
  * ebx = pointer to the information structure
3651
  * ebx = pointer to the information structure
3665
Format of the information structure:
3652
Format of the information structure:
3666
  * +0: dword: 2 = subfunction number
3653
  * +0: dword: 2 = subfunction number
3667
  * +4: dword: 0 (reserved)
3654
  * +4: dword: 0 (reserved)
3668
  * +8: dword: 0 (reserved)
3655
  * +8: dword: 0 (reserved)
3669
  * +12 = +0xC: dword: number of bytes to write
3656
  * +12 = +0xC: dword: number of bytes to write
3670
  * +16 = +0x10: dword: pointer to data
3657
  * +16 = +0x10: dword: pointer to data
3671
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3658
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3672
    given in the general description
3659
    given in the general description
3673
    or
3660
    or
3674
  * +20 = +0x14: db 0
3661
  * +20 = +0x14: db 0
3675
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3662
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3676
Returned value:
3663
Returned value:
3677
  * eax = 0 - success, otherwise file system error code
3664
  * eax = 0 - success, otherwise file system error code
3678
  * ebx = number of written bytes (possibly 0)
3665
  * ebx = number of written bytes (possibly 0)
3679
Remarks:
3666
Remarks:
3680
  * If a file with given name did not exist, it is created;
3667
  * If a file with given name did not exist, it is created;
3681
    if it existed, it is rewritten.
3668
    if it existed, it is rewritten.
3682
  * If there is not enough free space on disk, the function will
3669
  * If there is not enough free space on disk, the function will
3683
    write as many as can and then return error code 8.
3670
    write as many as can and then return error code 8.
3684
  * The function is not supported for CD (returns error code 2).
3671
  * The function is not supported for CD (returns error code 2).
3685
 
3672
 
3686
======================================================================
3673
======================================================================
3687
===================== Function 70, subfunction 3 =====================
3674
===================== Function 70, subfunction 3 =====================
3688
=========== Write to existing file with long names support. ==========
3675
=========== Write to existing file with long names support. ==========
3689
======================================================================
3676
======================================================================
3690
Parameters:
3677
Parameters:
3691
  * eax = 70 - function number
3678
  * eax = 70 - function number
3692
  * ebx = pointer to the information structure
3679
  * ebx = pointer to the information structure
3693
Format of the information structure:
3680
Format of the information structure:
3694
  * +0: dword: 3 = subfunction number
3681
  * +0: dword: 3 = subfunction number
3695
  * +4: dword: file offset (in bytes)
3682
  * +4: dword: file offset (in bytes)
3696
  * +8: dword: high dword of offset (must be 0 for FAT)
3683
  * +8: dword: high dword of offset (must be 0 for FAT)
3697
  * +12 = +0xC: dword: number of bytes to write
3684
  * +12 = +0xC: dword: number of bytes to write
3698
  * +16 = +0x10: dword: pointer to data
3685
  * +16 = +0x10: dword: pointer to data
3699
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3686
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3700
    given in the general description
3687
    given in the general description
3701
    or
3688
    or
3702
  * +20 = +0x14: db 0
3689
  * +20 = +0x14: db 0
3703
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3690
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3704
Returned value:
3691
Returned value:
3705
  * eax = 0 - success, otherwise file system error code
3692
  * eax = 0 - success, otherwise file system error code
3706
  * ebx = number of written bytes (possibly 0)
3693
  * ebx = number of written bytes (possibly 0)
3707
Remarks:
3694
Remarks:
3708
  * The file must already exist, otherwise function returns eax=5.
3695
  * The file must already exist, otherwise function returns eax=5.
3709
  * The only result of write 0 bytes is update in the file attributes
3696
  * The only result of write 0 bytes is update in the file attributes
3710
    date/time of modification and access to the current date/time.
3697
    date/time of modification and access to the current date/time.
3711
  * If beginning and/or ending position is greater than file size
3698
  * If beginning and/or ending position is greater than file size
3712
    (except for the previous case), the file is expanded to needed
3699
    (except for the previous case), the file is expanded to needed
3713
    size with zero characters.
3700
    size with zero characters.
3714
  * The function is not supported for CD (returns error code 2).
3701
  * The function is not supported for CD (returns error code 2).
3715
 
3702
 
3716
======================================================================
3703
======================================================================
3717
============ Function 70, subfunction 4 - set end of file. ===========
3704
============ Function 70, subfunction 4 - set end of file. ===========
3718
======================================================================
3705
======================================================================
3719
Parameters:
3706
Parameters:
3720
  * eax = 70 - function number
3707
  * eax = 70 - function number
3721
  * ebx = pointer to the information structure
3708
  * ebx = pointer to the information structure
3722
Format of the information structure:
3709
Format of the information structure:
3723
  * +0: dword: 4 = subfunction number
3710
  * +0: dword: 4 = subfunction number
3724
  * +4: dword: low dword of new file size
3711
  * +4: dword: low dword of new file size
3725
  * +8: dword: high dword of new file size (must be 0 for FAT)
3712
  * +8: dword: high dword of new file size (must be 0 for FAT)
3726
  * +12 = +0xC: dword: 0 (reserved)
3713
  * +12 = +0xC: dword: 0 (reserved)
3727
  * +16 = +0x10: dword: 0 (reserved)
3714
  * +16 = +0x10: dword: 0 (reserved)
3728
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3715
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3729
    given in the general description
3716
    given in the general description
3730
    or
3717
    or
3731
  * +20 = +0x14: db 0
3718
  * +20 = +0x14: db 0
3732
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3719
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3733
Returned value:
3720
Returned value:
3734
  * eax = 0 - success, otherwise file system error code
3721
  * eax = 0 - success, otherwise file system error code
3735
  * ebx destroyed
3722
  * ebx destroyed
3736
Remarks:
3723
Remarks:
3737
  * If the new file size is less than old one, file is truncated.
3724
  * If the new file size is less than old one, file is truncated.
3738
    If the new size is greater than old one, file is expanded with
3725
    If the new size is greater than old one, file is expanded with
3739
    characters with code 0. If the new size is equal to old one,
3726
    characters with code 0. If the new size is equal to old one,
3740
    the only result of call is set date/time of modification and
3727
    the only result of call is set date/time of modification and
3741
    access to the current date/time.
3728
    access to the current date/time.
3742
  * If there is not enough free space on disk for expansion, the
3729
  * If there is not enough free space on disk for expansion, the
3743
    function will expand to maximum possible size and then return
3730
    function will expand to maximum possible size and then return
3744
    error code 8.
3731
    error code 8.
3745
  * The function is not supported for CD (returns error code 2).
3732
  * The function is not supported for CD (returns error code 2).
3746
 
3733
 
3747
======================================================================
3734
======================================================================
3748
==== Function 70, subfunction 5 - get information on file/folder. ====
3735
==== Function 70, subfunction 5 - get information on file/folder. ====
3749
======================================================================
3736
======================================================================
3750
Parameters:
3737
Parameters:
3751
  * eax = 70 - function number
3738
  * eax = 70 - function number
3752
  * ebx = pointer to the information structure
3739
  * ebx = pointer to the information structure
3753
Format of the information structure:
3740
Format of the information structure:
3754
  * +0: dword: 5 = subfunction number
3741
  * +0: dword: 5 = subfunction number
3755
  * +4: dword: 0 (reserved)
3742
  * +4: dword: 0 (reserved)
3756
  * +8: dword: 0 (reserved)
3743
  * +8: dword: 0 (reserved)
3757
  * +12 = +0xC: dword: 0 (reserved)
3744
  * +12 = +0xC: dword: 0 (reserved)
3758
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
3745
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
3759
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3746
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3760
    given in the general description
3747
    given in the general description
3761
    or
3748
    or
3762
  * +20 = +0x14: db 0
3749
  * +20 = +0x14: db 0
3763
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3750
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3764
Returned value:
3751
Returned value:
3765
  * eax = 0 - success, otherwise file system error code
3752
  * eax = 0 - success, otherwise file system error code
3766
  * ebx destroyed
3753
  * ebx destroyed
3767
Information on file is returned in the BDFE format (block of data
3754
Information on file is returned in the BDFE format (block of data
3768
for folder entry), explained in the description of
3755
for folder entry), explained in the description of
3769
subfunction 1, but without filename
3756
subfunction 1, but without filename
3770
(i.e. only first 40 = 0x28 bytes).
3757
(i.e. only first 40 = 0x28 bytes).
3771
Remarks:
3758
Remarks:
3772
  * The function does not support virtual folders such as /, /rd and
3759
  * The function does not support virtual folders such as /, /rd and
3773
    root folders like /rd/1.
3760
    root folders like /rd/1.
3774
 
3761
 
3775
======================================================================
3762
======================================================================
3776
===== Function 70, subfunction 6 - set attributes of file/folder. ====
3763
===== Function 70, subfunction 6 - set attributes of file/folder. ====
3777
======================================================================
3764
======================================================================
3778
Parameters:
3765
Parameters:
3779
  * eax = 70 - function number
3766
  * eax = 70 - function number
3780
  * ebx = pointer to the information structure
3767
  * ebx = pointer to the information structure
3781
Format of the information structure:
3768
Format of the information structure:
3782
  * +0: dword: 6 = subfunction number
3769
  * +0: dword: 6 = subfunction number
3783
  * +4: dword: 0 (reserved)
3770
  * +4: dword: 0 (reserved)
3784
  * +8: dword: 0 (reserved)
3771
  * +8: dword: 0 (reserved)
3785
  * +12 = +0xC: dword: 0 (reserved)
3772
  * +12 = +0xC: dword: 0 (reserved)
3786
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
3773
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
3787
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3774
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3788
    given in the general description
3775
    given in the general description
3789
    or
3776
    or
3790
  * +20 = +0x14: db 0
3777
  * +20 = +0x14: db 0
3791
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3778
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3792
Returned value:
3779
Returned value:
3793
  * eax = 0 - success, otherwise file system error code
3780
  * eax = 0 - success, otherwise file system error code
3794
  * ebx destroyed
3781
  * ebx destroyed
3795
File attributes are first 32 bytes in BDFE (block of data
3782
File attributes are first 32 bytes in BDFE (block of data
3796
for folder entry), explained in the description of subfunction 1
3783
for folder entry), explained in the description of subfunction 1
3797
(that is, without name and size of file). Attribute
3784
(that is, without name and size of file). Attribute
3798
file/folder/volume label (bits 3,4 in dword +0) is not changed.
3785
file/folder/volume label (bits 3,4 in dword +0) is not changed.
3799
Byte +4 (name format) is ignored.
3786
Byte +4 (name format) is ignored.
3800
Remarks:
3787
Remarks:
3801
  * The function does not support virtual folders such as /, /rd and
3788
  * The function does not support virtual folders such as /, /rd and
3802
    root folders like /rd/1.
3789
    root folders like /rd/1.
3803
  * The function is not supported for CD (returns error code 2).
3790
  * The function is not supported for CD (returns error code 2).
3804
 
3791
 
3805
======================================================================
3792
======================================================================
3806
=========== Function 70, subfunction 7 - start application. ==========
3793
=========== Function 70, subfunction 7 - start application. ==========
3807
======================================================================
3794
======================================================================
3808
Parameters:
3795
Parameters:
3809
  * eax = 70 - function number
3796
  * eax = 70 - function number
3810
  * ebx = pointer to the information structure
3797
  * ebx = pointer to the information structure
3811
Format of the information structure:
3798
Format of the information structure:
3812
  * +0: dword: 7 = subfunction number
3799
  * +0: dword: 7 = subfunction number
3813
  * +4: dword: flags field:
3800
  * +4: dword: flags field:
3814
    * bit 0: start process as debugged
3801
    * bit 0: start process as debugged
3815
    * other bits are reserved and must be set to 0
3802
    * other bits are reserved and must be set to 0
3816
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3803
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3817
  * +12 = +0xC: dword: 0 (reserved)
3804
  * +12 = +0xC: dword: 0 (reserved)
3818
  * +16 = +0x10: dword: 0 (reserved)
3805
  * +16 = +0x10: dword: 0 (reserved)
3819
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3806
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3820
    given in the general description
3807
    given in the general description
3821
    or
3808
    or
3822
  * +20 = +0x14: db 0
3809
  * +20 = +0x14: db 0
3823
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3810
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3824
Returned value:
3811
Returned value:
3825
  * eax > 0 - program is loaded, eax contains PID
3812
  * eax > 0 - program is loaded, eax contains PID
3826
  * eax < 0 - an error has occured, -eax contains
3813
  * eax < 0 - an error has occured, -eax contains
3827
    file system error code
3814
    file system error code
3828
  * ebx destroyed
3815
  * ebx destroyed
3829
Remarks:
3816
Remarks:
3830
  * Command line must be terminated by the character with the code 0
3817
  * Command line must be terminated by the character with the code 0
3831
    (ASCIIZ-string); function takes into account either all characters
3818
    (ASCIIZ-string); function takes into account either all characters
3832
    up to terminating zero inclusively or first 256 character
3819
    up to terminating zero inclusively or first 256 character
3833
    regarding what is less.
3820
    regarding what is less.
3834
  * If the process is started as debugged, it is created in
3821
  * If the process is started as debugged, it is created in
3835
    the suspended state; to run use subfunction 5 of function 69.
3822
    the suspended state; to run use subfunction 5 of function 69.
3836
 
3823
 
3837
======================================================================
3824
======================================================================
3838
========== Function 70, subfunction 8 - delete file/folder. ==========
3825
========== Function 70, subfunction 8 - delete file/folder. ==========
3839
======================================================================
3826
======================================================================
3840
Parameters:
3827
Parameters:
3841
  * eax = 70 - function number
3828
  * eax = 70 - function number
3842
  * ebx = pointer to the information structure
3829
  * ebx = pointer to the information structure
3843
Format of the information structure:
3830
Format of the information structure:
3844
  * +0: dword: 8 = subfunction number
3831
  * +0: dword: 8 = subfunction number
3845
  * +4: dword: 0 (reserved)
3832
  * +4: dword: 0 (reserved)
3846
  * +8: dword: 0 (reserved)
3833
  * +8: dword: 0 (reserved)
3847
  * +12 = +0xC: dword: 0 (reserved)
3834
  * +12 = +0xC: dword: 0 (reserved)
3848
  * +16 = +0x10: dword: 0 (reserved)
3835
  * +16 = +0x10: dword: 0 (reserved)
3849
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3836
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3850
    given in the general description
3837
    given in the general description
3851
    or
3838
    or
3852
  * +20 = +0x14: db 0
3839
  * +20 = +0x14: db 0
3853
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3840
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3854
Returned value:
3841
Returned value:
3855
  * eax = 0 - success, otherwise file system error code
3842
  * eax = 0 - success, otherwise file system error code
3856
  * ebx destroyed
3843
  * ebx destroyed
3857
Remarks:
3844
Remarks:
3858
  * The function is not supported for CD (returns error code 2).
3845
  * The function is not supported for CD (returns error code 2).
3859
  * The function can delete only empty folders (attempt to delete
3846
  * The function can delete only empty folders (attempt to delete
3860
    nonempty folder results in error with code 10, "access denied").
3847
    nonempty folder results in error with code 10, "access denied").
3861
 
3848
 
3862
======================================================================
3849
======================================================================
3863
============= Function 70, subfunction 9 - create folder. ============
3850
============= Function 70, subfunction 9 - create folder. ============
3864
======================================================================
3851
======================================================================
3865
Parameters:
3852
Parameters:
3866
  * eax = 70 - function number
3853
  * eax = 70 - function number
3867
  * ebx = pointer to the information structure
3854
  * ebx = pointer to the information structure
3868
Format of the information structure:
3855
Format of the information structure:
3869
  * +0: dword: 9 = subfunction number
3856
  * +0: dword: 9 = subfunction number
3870
  * +4: dword: 0 (reserved)
3857
  * +4: dword: 0 (reserved)
3871
  * +8: dword: 0 (reserved)
3858
  * +8: dword: 0 (reserved)
3872
  * +12 = +0xC: dword: 0 (reserved)
3859
  * +12 = +0xC: dword: 0 (reserved)
3873
  * +16 = +0x10: dword: 0 (reserved)
3860
  * +16 = +0x10: dword: 0 (reserved)
3874
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3861
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3875
    given in the general description
3862
    given in the general description
3876
    or
3863
    or
3877
  * +20 = +0x14: db 0
3864
  * +20 = +0x14: db 0
3878
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
3865
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
3879
Returned value:
3866
Returned value:
3880
  * eax = 0 - success, otherwise file system error code
3867
  * eax = 0 - success, otherwise file system error code
3881
  * ebx destroyed
3868
  * ebx destroyed
3882
Remarks:
3869
Remarks:
3883
  * The function is not supported for CD (returns error code 2).
3870
  * The function is not supported for CD (returns error code 2).
3884
  * The parent folder must already exist.
3871
  * The parent folder must already exist.
3885
  * If target folder already exists, function returns success (eax=0).
3872
  * If target folder already exists, function returns success (eax=0).
3886
 
3873
 
3887
======================================================================
3874
======================================================================
3888
========== Function 71, subfunction 1 - set window caption. ==========
3875
========== Function 71, subfunction 1 - set window caption. ==========
3889
======================================================================
3876
======================================================================
3890
Parameters:
3877
Parameters:
3891
  * eax = 71 - function number
3878
  * eax = 71 - function number
3892
  * ebx = 1 - subfunction number
3879
  * ebx = 1 - subfunction number
3893
  * ecx = pointer to zero terminated string
3880
  * ecx = pointer to zero terminated string
3894
Returned value:
3881
Returned value:
3895
  * function does not return value
3882
  * function does not return value
3896
Remarks:
3883
Remarks:
3897
  * You may set the caption string encoding by putting
3884
  * You may set the caption string encoding by putting
3898
    at the start of the string a byte with next values:
3885
    at the start of the string a byte with next values:
3899
    1 = cp866
3886
    1 = cp866
3900
    2 = UTF-16LE
3887
    2 = UTF-16LE
3901
    3 = UTF-8
3888
    3 = UTF-8
3902
    otherwise will be used cp866.
3889
    otherwise will be used cp866.
3903
  * Pass NULL in ecx to remove caption.
3890
  * Pass NULL in ecx to remove caption.
3904
 
3891
 
3905
======================================================================
3892
======================================================================
3906
=============== Function 72 - send message to a window. ==============
3893
=============== Function 72 - send message to a window. ==============
3907
======================================================================
3894
======================================================================
3908
 
3895
 
3909
- Subfunction 1 - send message with parameter to the active window. --
3896
- Subfunction 1 - send message with parameter to the active window. --
3910
Parameters:
3897
Parameters:
3911
  * eax = 72 - function number
3898
  * eax = 72 - function number
3912
  * ebx = 1 - subfunction number
3899
  * ebx = 1 - subfunction number
3913
  * ecx = event code: 2 or 3
3900
  * ecx = event code: 2 or 3
3914
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
3901
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
3915
Returned value:
3902
Returned value:
3916
  * eax = 0 - success
3903
  * eax = 0 - success
3917
  * eax = 1 - buffer is full
3904
  * eax = 1 - buffer is full
3918
 
3905
 
3919
======================================================================
3906
======================================================================
3920
===================== Function 73 - blit bitmap  =====================
3907
===================== Function 73 - blit bitmap  =====================
3921
======================================================================
3908
======================================================================
3922
 
3909
 
3923
Parameters:
3910
Parameters:
3924
  * eax = 73 - function number
3911
  * eax = 73 - function number
3925
 
3912
 
3926
  * ebx = ROP and optional flags
3913
  * ebx = ROP and optional flags
3927
     31           6 5  4 3   0
3914
     31           6 5  4 3   0
3928
     [  reserved  ][T][B][ROP]
3915
     [  reserved  ][T][B][ROP]
3929
     ROP - raster operation code
3916
     ROP - raster operation code
3930
        0: Copy
3917
        0: Copy
3931
     1-15: reserved
3918
     1-15: reserved
3932
     B   - blit into the background surface
3919
     B   - blit into the background surface
3933
     T   - transparent blit
3920
     T   - transparent blit
3934
 
3921
 
3935
  * ecx = pointer to the function parameters
3922
  * ecx = pointer to the function parameters
3936
        destination offset and clipping
3923
        destination offset and clipping
3937
     +0 signed dword: destination rectangle X offset from the window
3924
     +0 signed dword: destination rectangle X offset from the window
3938
                      top-left corner
3925
                      top-left corner
3939
     +4 signed dword: destination rectangle Y offset from the window
3926
     +4 signed dword: destination rectangle Y offset from the window
3940
                      top-left corner
3927
                      top-left corner
3941
     +8 dword:        destination rectangle width
3928
     +8 dword:        destination rectangle width
3942
    +12 dword:        destination rectangle height
3929
    +12 dword:        destination rectangle height
3943
 
3930
 
3944
        source offset and clipping
3931
        source offset and clipping
3945
    +16 signed dword: source rectangle X offset from the bitmap
3932
    +16 signed dword: source rectangle X offset from the bitmap
3946
                      top-left corner
3933
                      top-left corner
3947
    +20 signed dword: source rectangle Y offset from the bitmap
3934
    +20 signed dword: source rectangle Y offset from the bitmap
3948
                      top-left corner
3935
                      top-left corner
3949
    +24 dword:        source rectangle width
3936
    +24 dword:        source rectangle width
3950
    +28 dword:        source rectangle height
3937
    +28 dword:        source rectangle height
3951
 
3938
 
3952
    +32: dword: bitmap data - must be 32bpp
3939
    +32: dword: bitmap data - must be 32bpp
3953
    +36: dword: size of the bitmap row in bytes
3940
    +36: dword: size of the bitmap row in bytes
3954
 
3941
 
3955
Returned value:
3942
Returned value:
3956
  * function does not return value
3943
  * function does not return value
3957
 
3944
 
3958
======================================================================
3945
======================================================================
3959
= Function 74, Subfunction 255, Get number of active network devices. =
3946
= Function 74, Subfunction 255, Get number of active network devices. =
3960
======================================================================
3947
======================================================================
3961
Parameters:
3948
Parameters:
3962
  * eax = 74 - function number
3949
  * eax = 74 - function number
3963
  * bl = 255 - subfunction number
3950
  * bl = 255 - subfunction number
3964
Returned value:
3951
Returned value:
3965
  * eax = number of active network devices
3952
  * eax = number of active network devices
3966
 
3953
 
3967
======================================================================
3954
======================================================================
3968
======== Function 74, Subfunction 0, Get network device type. ========
3955
======== Function 74, Subfunction 0, Get network device type. ========
3969
======================================================================
3956
======================================================================
3970
Parameters:
3957
Parameters:
3971
  * eax = 74 - function number
3958
  * eax = 74 - function number
3972
  * bl = 0 - subfunction number
3959
  * bl = 0 - subfunction number
3973
  * bh = device number
3960
  * bh = device number
3974
Returned value:
3961
Returned value:
3975
  * eax = device type number
3962
  * eax = device type number
3976
 
3963
 
3977
======================================================================
3964
======================================================================
3978
======== Function 74, Subfunction 1, Get network device name. ========
3965
======== Function 74, Subfunction 1, Get network device name. ========
3979
======================================================================
3966
======================================================================
3980
Parameters:
3967
Parameters:
3981
  * eax = 74 - function number
3968
  * eax = 74 - function number
3982
  * bl = 1 - subfunction number
3969
  * bl = 1 - subfunction number
3983
  * bh = device number
3970
  * bh = device number
3984
  * ecx = pointer to 64 byte buffer
3971
  * ecx = pointer to 64 byte buffer
3985
Returned value:
3972
Returned value:
3986
  * eax = -1 on error
3973
  * eax = -1 on error
3987
  * The network device name is written into the buffer, on success
3974
  * The network device name is written into the buffer, on success
3988
 
3975
 
3989
======================================================================
3976
======================================================================
3990
========= Function 74, Subfunction 2, Reset network device. ==========
3977
========= Function 74, Subfunction 2, Reset network device. ==========
3991
======================================================================
3978
======================================================================
3992
Parameters:
3979
Parameters:
3993
  * eax = 74 - function number
3980
  * eax = 74 - function number
3994
  * bl = 2 - subfunction number
3981
  * bl = 2 - subfunction number
3995
  * bh = device number
3982
  * bh = device number
3996
Returned value:
3983
Returned value:
3997
  * eax = -1 on error
3984
  * eax = -1 on error
3998
 
3985
 
3999
======================================================================
3986
======================================================================
4000
========== Function 74, Subfunction 3, Stop network device. ==========
3987
========== Function 74, Subfunction 3, Stop network device. ==========
4001
======================================================================
3988
======================================================================
4002
Parameters:
3989
Parameters:
4003
  * eax = 74 - function number
3990
  * eax = 74 - function number
4004
  * bl = 3 - subfunction number
3991
  * bl = 3 - subfunction number
4005
  * bh = device number
3992
  * bh = device number
4006
Returned value:
3993
Returned value:
4007
  * eax = -1 on error
3994
  * eax = -1 on error
4008
  
3995
  
4009
======================================================================
3996
======================================================================
4010
=========== Function 74, Subfunction 4, Get device pointer. ==========
3997
=========== Function 74, Subfunction 4, Get device pointer. ==========
4011
======================================================================
3998
======================================================================
4012
Parameters:
3999
Parameters:
4013
  * eax = 74 - function number
4000
  * eax = 74 - function number
4014
  * bl = 4 - subfunction number
4001
  * bl = 4 - subfunction number
4015
  * bh = device number
4002
  * bh = device number
4016
Returned value:
4003
Returned value:
4017
  * eax = device pointer, -1 on error  
4004
  * eax = device pointer, -1 on error  
4018
  
4005
  
4019
======================================================================
4006
======================================================================
4020
========= Function 74, Subfunction 6, Get packet TX counter. =========
4007
========= Function 74, Subfunction 6, Get packet TX counter. =========
4021
======================================================================
4008
======================================================================
4022
Parameters:
4009
Parameters:
4023
  * eax = 74 - function number
4010
  * eax = 74 - function number
4024
  * bl = 6 - subfunction number
4011
  * bl = 6 - subfunction number
4025
  * bh = device number
4012
  * bh = device number
4026
Returned value:
4013
Returned value:
4027
  * eax = Number of packets sent since device start, -1 on error
4014
  * eax = Number of packets sent since device start, -1 on error
4028
  
4015
  
4029
======================================================================
4016
======================================================================
4030
========= Function 74, Subfunction 7, Get packet RX counter. =========
4017
========= Function 74, Subfunction 7, Get packet RX counter. =========
4031
======================================================================
4018
======================================================================
4032
Parameters:
4019
Parameters:
4033
  * eax = 74 - function number
4020
  * eax = 74 - function number
4034
  * bl = 7 - subfunction number
4021
  * bl = 7 - subfunction number
4035
  * bh = device number
4022
  * bh = device number
4036
Returned value:
4023
Returned value:
4037
  * eax = Number of packets received since device start, -1 on error
4024
  * eax = Number of packets received since device start, -1 on error
4038
  
4025
  
4039
======================================================================
4026
======================================================================
4040
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4027
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4041
======================================================================
4028
======================================================================
4042
Parameters:
4029
Parameters:
4043
  * eax = 74 - function number
4030
  * eax = 74 - function number
4044
  * bl = 8 - subfunction number
4031
  * bl = 8 - subfunction number
4045
  * bh = device number
4032
  * bh = device number
4046
Returned value:
4033
Returned value:
4047
  * eax = Number of bytes sent since device start (lower dword)
4034
  * eax = Number of bytes sent since device start (lower dword)
4048
                  -1 on error
4035
                  -1 on error
4049
  * ebx = Number of bytes sent since device start (higher dword)
4036
  * ebx = Number of bytes sent since device start (higher dword)
4050
 
4037
 
4051
======================================================================
4038
======================================================================
4052
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4039
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4053
======================================================================
4040
======================================================================
4054
Parameters:
4041
Parameters:
4055
  * eax = 74 - function number
4042
  * eax = 74 - function number
4056
  * bl = 9 - subfunction number
4043
  * bl = 9 - subfunction number
4057
  * bh = device number
4044
  * bh = device number
4058
Returned value:
4045
Returned value:
4059
  * eax = Number of bytes received since device start (lower dword)
4046
  * eax = Number of bytes received since device start (lower dword)
4060
                  -1 on error
4047
                  -1 on error
4061
  * ebx = Number of bytes received since device start (higher dword)
4048
  * ebx = Number of bytes received since device start (higher dword)
4062
  
4049
  
4063
======================================================================
4050
======================================================================
4064
========== Function 74, Subfunction 10, Get link status. =============
4051
========== Function 74, Subfunction 10, Get link status. =============
4065
======================================================================
4052
======================================================================
4066
Parameters:
4053
Parameters:
4067
  * eax = 74 - function number
4054
  * eax = 74 - function number
4068
  * bl = 10 - subfunction number
4055
  * bl = 10 - subfunction number
4069
  * bh = device number
4056
  * bh = device number
4070
Returned value:
4057
Returned value:
4071
  * eax = link status, -1 on error
4058
  * eax = link status, -1 on error
4072
  
4059
  
4073
  Link status:
4060
  Link status:
4074
    ETH_LINK_DOWN   =    0b         ; Link is down
4061
    ETH_LINK_DOWN   =    0b         ; Link is down
4075
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4062
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4076
    ETH_LINK_FD     =   10b         ; full duplex flag
4063
    ETH_LINK_FD     =   10b         ; full duplex flag
4077
    ETH_LINK_10M    =  100b         ; 10 mbit
4064
    ETH_LINK_10M    =  100b         ; 10 mbit
4078
    ETH_LINK_100M   = 1000b         ; 100 mbit
4065
    ETH_LINK_100M   = 1000b         ; 100 mbit
4079
    ETH_LINK_1G     = 1100b         ; gigabit   
4066
    ETH_LINK_1G     = 1100b         ; gigabit   
4080
  
4067
  
4081
======================================================================
4068
======================================================================
4082
============== Function 75, Subfunction 0, Open socket. ==============
4069
============== Function 75, Subfunction 0, Open socket. ==============
4083
======================================================================
4070
======================================================================
4084
Parameters:
4071
Parameters:
4085
  * eax = 75 - function number
4072
  * eax = 75 - function number
4086
  * bl = 0 - subfunction number
4073
  * bl = 0 - subfunction number
4087
  * ecx = domain
4074
  * ecx = domain
4088
  * edx = type
4075
  * edx = type
4089
  * esi = protocol
4076
  * esi = protocol
4090
Returned value:
4077
Returned value:
4091
  * eax = socket number, -1 on error
4078
  * eax = socket number, -1 on error
4092
  * ebx = errorcode
4079
  * ebx = errorcode
4093
 
4080
 
4094
======================================================================
4081
======================================================================
4095
============= Function 75, Subfunction 1, Close socket. ==============
4082
============= Function 75, Subfunction 1, Close socket. ==============
4096
======================================================================
4083
======================================================================
4097
Parameters:
4084
Parameters:
4098
  * eax = 75 - function number
4085
  * eax = 75 - function number
4099
  * bl = 1 - subfunction number
4086
  * bl = 1 - subfunction number
4100
  * ecx = socket number
4087
  * ecx = socket number
4101
Returned value:
4088
Returned value:
4102
  * eax = -1 on error
4089
  * eax = -1 on error
4103
  * ebx = errorcode
4090
  * ebx = errorcode
4104
 
4091
 
4105
======================================================================
4092
======================================================================
4106
================== Function 75, Subfunction 2, Bind. =================
4093
================== Function 75, Subfunction 2, Bind. =================
4107
======================================================================
4094
======================================================================
4108
Parameters:
4095
Parameters:
4109
  * eax = 75 - function number
4096
  * eax = 75 - function number
4110
  * bl = 2 - subfunction number
4097
  * bl = 2 - subfunction number
4111
  * ecx = socket number
4098
  * ecx = socket number
4112
  * edx = pointer to sockaddr structure
4099
  * edx = pointer to sockaddr structure
4113
  * esi = length of sockaddr structure
4100
  * esi = length of sockaddr structure
4114
Returned value:
4101
Returned value:
4115
  * eax = -1 on error
4102
  * eax = -1 on error
4116
  * ebx = errorcode
4103
  * ebx = errorcode
4117
 
4104
 
4118
======================================================================
4105
======================================================================
4119
================= Function 75, Subfunction 3, Listen. ================
4106
================= Function 75, Subfunction 3, Listen. ================
4120
======================================================================
4107
======================================================================
4121
Parameters:
4108
Parameters:
4122
  * eax = 75 - function number
4109
  * eax = 75 - function number
4123
  * bl = 3 - subfunction number
4110
  * bl = 3 - subfunction number
4124
  * ecx = socket number
4111
  * ecx = socket number
4125
  * edx = backlog
4112
  * edx = backlog
4126
Returned value:
4113
Returned value:
4127
  * eax = -1 on error
4114
  * eax = -1 on error
4128
  * ebx = errorcode
4115
  * ebx = errorcode
4129
 
4116
 
4130
======================================================================
4117
======================================================================
4131
================ Function 75, Subfunction 4, Connect. ================
4118
================ Function 75, Subfunction 4, Connect. ================
4132
======================================================================
4119
======================================================================
4133
Parameters:
4120
Parameters:
4134
  * eax = 75 - function number
4121
  * eax = 75 - function number
4135
  * bl = 4 - subfunction number
4122
  * bl = 4 - subfunction number
4136
  * ecx = socket number
4123
  * ecx = socket number
4137
  * edx = pointer to sockaddr structure
4124
  * edx = pointer to sockaddr structure
4138
  * esi = length of sockaddr structure
4125
  * esi = length of sockaddr structure
4139
Returned value:
4126
Returned value:
4140
  * eax = -1 on error
4127
  * eax = -1 on error
4141
  * ebx = errorcode
4128
  * ebx = errorcode
4142
 
4129
 
4143
======================================================================
4130
======================================================================
4144
================= Function 75, Subfunction 5, Accept. ================
4131
================= Function 75, Subfunction 5, Accept. ================
4145
======================================================================
4132
======================================================================
4146
Parameters:
4133
Parameters:
4147
  * eax = 75 - function number
4134
  * eax = 75 - function number
4148
  * bl = 5 - subfunction number
4135
  * bl = 5 - subfunction number
4149
  * ecx = socket number
4136
  * ecx = socket number
4150
  * edx = pointer to sockaddr structure
4137
  * edx = pointer to sockaddr structure
4151
  * esi = length of sockaddr structure
4138
  * esi = length of sockaddr structure
4152
Returned value:
4139
Returned value:
4153
  * eax = socket number of accepted socket, -1 on error
4140
  * eax = socket number of accepted socket, -1 on error
4154
  * ebx = errorcode
4141
  * ebx = errorcode
4155
 
4142
 
4156
======================================================================
4143
======================================================================
4157
================== Function 75, Subfunction 6, Send. =================
4144
================== Function 75, Subfunction 6, Send. =================
4158
======================================================================
4145
======================================================================
4159
Parameters:
4146
Parameters:
4160
  * eax = 75 - function number
4147
  * eax = 75 - function number
4161
  * bl = 6 - subfunction number
4148
  * bl = 6 - subfunction number
4162
  * ecx = socket number
4149
  * ecx = socket number
4163
  * edx = pointer to buffer
4150
  * edx = pointer to buffer
4164
  * esi = length of buffer
4151
  * esi = length of buffer
4165
  * edi = flags
4152
  * edi = flags
4166
Returned value:
4153
Returned value:
4167
  * eax = number of bytes copied, -1 on error
4154
  * eax = number of bytes copied, -1 on error
4168
  * ebx = errorcode
4155
  * ebx = errorcode
4169
 
4156
 
4170
======================================================================
4157
======================================================================
4171
================ Function 75, Subfunction 7, Receive. ================
4158
================ Function 75, Subfunction 7, Receive. ================
4172
======================================================================
4159
======================================================================
4173
Parameters:
4160
Parameters:
4174
  * eax = 75 - function number
4161
  * eax = 75 - function number
4175
  * bl = 7 - subfunction number
4162
  * bl = 7 - subfunction number
4176
  * ecx = socket number
4163
  * ecx = socket number
4177
  * edx = pointer to buffer
4164
  * edx = pointer to buffer
4178
  * esi = length of buffer
4165
  * esi = length of buffer
4179
  * edi = flags
4166
  * edi = flags
4180
Returned value:
4167
Returned value:
4181
  * eax = number of bytes copied, -1 on error
4168
  * eax = number of bytes copied, -1 on error
4182
  * ebx = errorcode
4169
  * ebx = errorcode
4183
 
4170
 
4184
======================================================================
4171
======================================================================
4185
=========== Function 75, Subfunction 8, Set socket options. ==========
4172
=========== Function 75, Subfunction 8, Set socket options. ==========
4186
======================================================================
4173
======================================================================
4187
Parameters:
4174
Parameters:
4188
  * eax = 75 - function number
4175
  * eax = 75 - function number
4189
  * bl = 8 - subfunction number
4176
  * bl = 8 - subfunction number
4190
  * ecx = socket number
4177
  * ecx = socket number
4191
  * edx = pointer to optstruct
4178
  * edx = pointer to optstruct
4192
Returned value:
4179
Returned value:
4193
  * eax = -1 on error
4180
  * eax = -1 on error
4194
  * ebx = errorcode
4181
  * ebx = errorcode
4195
Remarks:
4182
Remarks:
4196
 
4183
 
4197
  Optstruct: 
4184
  Optstruct: 
4198
    dd level
4185
    dd level
4199
    dd optionname
4186
    dd optionname
4200
    dd optlength
4187
    dd optlength
4201
    db options...
4188
    db options...
4202
 
4189
 
4203
======================================================================
4190
======================================================================
4204
=========== Function 75, Subfunction 9, Get socket options. ==========
4191
=========== Function 75, Subfunction 9, Get socket options. ==========
4205
======================================================================
4192
======================================================================
4206
Parameters:
4193
Parameters:
4207
  * eax = 75 - function number
4194
  * eax = 75 - function number
4208
  * bl = 9 - subfunction number
4195
  * bl = 9 - subfunction number
4209
  * ecx = socket number
4196
  * ecx = socket number
4210
  * edx = pointer to optstruct
4197
  * edx = pointer to optstruct
4211
Returned value:
4198
Returned value:
4212
  * eax = -1 on error
4199
  * eax = -1 on error
4213
  * ebx = errorcode
4200
  * ebx = errorcode
4214
Remarks:
4201
Remarks:
4215
 
4202
 
4216
  Optstruct: 
4203
  Optstruct: 
4217
    dd level
4204
    dd level
4218
    dd optionname
4205
    dd optionname
4219
    dd optlength
4206
    dd optlength
4220
    db options...
4207
    db options...
4221
 
4208
 
4222
======================================================================
4209
======================================================================
4223
============ Function 75, Subfunction 10, Get socketpair. ===========
4210
============ Function 75, Subfunction 10, Get socketpair. ===========
4224
======================================================================
4211
======================================================================
4225
Parameters:
4212
Parameters:
4226
  * eax = 75 - function number
4213
  * eax = 75 - function number
4227
  * bl = 10 - subfunction number
4214
  * bl = 10 - subfunction number
4228
Returned value:
4215
Returned value:
4229
  * eax = socketnum1, -1 on error
4216
  * eax = socketnum1, -1 on error
4230
  * ebx = socketnum2, errorcode on error
4217
  * ebx = socketnum2, errorcode on error
4231
  
4218
  
4232
======================================================================
4219
======================================================================
4233
============ Function 76, Network options and statistics. ============
4220
============ Function 76, Network options and statistics. ============
4234
======================================================================
4221
======================================================================
4235
Parameters:
4222
Parameters:
4236
  * eax = 76 - function number
4223
  * eax = 76 - function number
4237
  * high half of ebx = protocol number
4224
  * high half of ebx = protocol number
4238
  * bh = device number
4225
  * bh = device number
4239
  * bl = subfunction number
4226
  * bl = subfunction number
4240
 
4227
 
4241
Ethernet (0)
4228
Ethernet (0)
4242
        0 - Read MAC
4229
        0 - Read MAC
4243
        
4230
        
4244
IPv4 (1)
4231
IPv4 (1)
4245
        0 - Read # IP packets send
4232
        0 - Read # IP packets send
4246
        1 - Read # IP packets received
4233
        1 - Read # IP packets received
4247
        2 - Read IP
4234
        2 - Read IP
4248
        3 - Write IP
4235
        3 - Write IP
4249
        4 - Read DNS
4236
        4 - Read DNS
4250
        5 - Write DNS
4237
        5 - Write DNS
4251
        6 - Read subnet
4238
        6 - Read subnet
4252
        7 - Write subnet
4239
        7 - Write subnet
4253
        8 - Read gateway
4240
        8 - Read gateway
4254
        9 - Write gateway
4241
        9 - Write gateway
4255
        
4242
        
4256
ICMP (2)
4243
ICMP (2)
4257
        0 - Read # ICMP packets send
4244
        0 - Read # ICMP packets send
4258
        1 - Read # ICMP packets received
4245
        1 - Read # ICMP packets received
4259
        3 - enable/disable ICMP echo reply
4246
        3 - enable/disable ICMP echo reply
4260
 
4247
 
4261
UDP (3)
4248
UDP (3)
4262
        0 - Read # UDP packets send
4249
        0 - Read # UDP packets send
4263
        1 - Read # UDP packets received
4250
        1 - Read # UDP packets received
4264
 
4251
 
4265
TCP (4)
4252
TCP (4)
4266
        0 - Read # TCP packets send
4253
        0 - Read # TCP packets send
4267
        1 - Read # TCP packets received 
4254
        1 - Read # TCP packets received 
4268
        
4255
        
4269
ARP (5)
4256
ARP (5)
4270
        0 - Read # ARP packets send
4257
        0 - Read # ARP packets send
4271
        1 - Read # ARP packets received
4258
        1 - Read # ARP packets received
4272
        2 - Read # ARP entry's
4259
        2 - Read # ARP entry's
4273
        3 - Read ARP entry
4260
        3 - Read ARP entry
4274
        4 - Add static ARP entry
4261
        4 - Add static ARP entry
4275
        5 - Remove ARP entry (-1 = remove all)
4262
        5 - Remove ARP entry (-1 = remove all)
4276
        6 - Send ARP announce on specified interface
4263
        6 - Send ARP announce on specified interface
4277
        7 - Read # ARP conflicts (IP address conflicts) 
4264
        7 - Read # ARP conflicts (IP address conflicts) 
4278
 
4265
 
4279
======================================================================
4266
======================================================================
4280
=============== Function -1 - terminate thread/process ===============
4267
=============== Function -1 - terminate thread/process ===============
4281
======================================================================
4268
======================================================================
4282
Parameters:
4269
Parameters:
4283
  * eax = -1 - function number
4270
  * eax = -1 - function number
4284
Returned value:
4271
Returned value:
4285
  * function does not return neither value nor control
4272
  * function does not return neither value nor control
4286
Remarks:
4273
Remarks:
4287
  * If the process did not create threads obviously, it has only
4274
  * If the process did not create threads obviously, it has only
4288
    one thread, which termination results in process termination.
4275
    one thread, which termination results in process termination.
4289
  * If the current thread is last in the process, its termination
4276
  * If the current thread is last in the process, its termination
4290
    also results in process terminates.
4277
    also results in process terminates.
4291
  * This function terminates the current thread. Other thread can be
4278
  * This function terminates the current thread. Other thread can be
4292
    killed by call to subfunction 2 of function 18.
4279
    killed by call to subfunction 2 of function 18.
4293
 
4280
 
4294
======================================================================
4281
======================================================================
4295
=========================== List of events ===========================
4282
=========================== List of events ===========================
4296
======================================================================
4283
======================================================================
4297
Next event can be retrieved by the call of one from functions 10
4284
Next event can be retrieved by the call of one from functions 10
4298
(to wait for event), 11 (to check without waiting), 23
4285
(to wait for event), 11 (to check without waiting), 23
4299
(to wait during the given time).
4286
(to wait during the given time).
4300
These functions return only those events, which enter into a mask set
4287
These functions return only those events, which enter into a mask set
4301
by function 40. By default it is first three,
4288
by function 40. By default it is first three,
4302
there is enough for most applications.
4289
there is enough for most applications.
4303
Codes of events:
4290
Codes of events:
4304
  * 1 = redraw event (is reset by call to function 0)
4291
  * 1 = redraw event (is reset by call to function 0)
4305
  * 2 = key on keyboard is pressed (acts, only when the window is
4292
  * 2 = key on keyboard is pressed (acts, only when the window is
4306
    active) or hotkey is pressed; is reset, when all keys from
4293
    active) or hotkey is pressed; is reset, when all keys from
4307
    the buffer are read out by function 2
4294
    the buffer are read out by function 2
4308
  * 3 = button is pressed, defined earlier by function 8
4295
  * 3 = button is pressed, defined earlier by function 8
4309
    (or close button, created implicitly by function 0;
4296
    (or close button, created implicitly by function 0;
4310
    minimize button is handled by the system and sends no message;
4297
    minimize button is handled by the system and sends no message;
4311
    acts, only when the window is active;
4298
    acts, only when the window is active;
4312
    is reset when all buttons from the buffer
4299
    is reset when all buttons from the buffer
4313
    are read out by function 17)
4300
    are read out by function 17)
4314
  * 4 = reserved (in current implementation never comes even after
4301
  * 4 = reserved (in current implementation never comes even after
4315
    unmasking by function 40)
4302
    unmasking by function 40)
4316
  * 5 = kernel finished redrawing of the desktop background
4303
  * 5 = kernel finished redrawing of the desktop background
4317
  * 6 = mouse event (something happened - button pressing or moving;
4304
  * 6 = mouse event (something happened - button pressing or moving;
4318
    is reset at reading)
4305
    is reset at reading)
4319
  * 7 = IPC event (see function 60 -
4306
  * 7 = IPC event (see function 60 -
4320
    Inter Process Communication; is reset at reading)
4307
    Inter Process Communication; is reset at reading)
4321
  * 8 = network event (is reset at reading)
4308
  * 8 = network event (is reset at reading)
4322
  * 9 = debug event (is reset at reading; see
4309
  * 9 = debug event (is reset at reading; see
4323
    debug subsystem)
4310
    debug subsystem)
4324
  * 16..31 = event with appropriate IRQ
4311
  * 16..31 = event with appropriate IRQ
4325
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4312
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4326
 
4313
 
4327
======================================================================
4314
======================================================================
4328
=================== Error codes of the file system ===================
4315
=================== Error codes of the file system ===================
4329
======================================================================
4316
======================================================================
4330
  * 0 = success
4317
  * 0 = success
4331
  * 1 = base and/or partition of a hard disk is not defined
4318
  * 1 = base and/or partition of a hard disk is not defined
4332
    (by subfunctions 7, 8 of function 21)
4319
    (by subfunctions 7, 8 of function 21)
4333
  * 2 = function is not supported for the given file system
4320
  * 2 = function is not supported for the given file system
4334
  * 3 = unknown file system
4321
  * 3 = unknown file system
4335
  * 4 = reserved, is never returned in the current implementation
4322
  * 4 = reserved, is never returned in the current implementation
4336
  * 5 = file not found
4323
  * 5 = file not found
4337
  * 6 = end of file, EOF
4324
  * 6 = end of file, EOF
4338
  * 7 = pointer lies outside of application memory
4325
  * 7 = pointer lies outside of application memory
4339
  * 8 = disk is full
4326
  * 8 = disk is full
4340
  * 9 = FAT table is destroyed
4327
  * 9 = FAT table is destroyed
4341
  * 10 = access denied
4328
  * 10 = access denied
4342
  * 11 = device error
4329
  * 11 = device error
4343
Application start functions can return also following errors:
4330
Application start functions can return also following errors:
4344
  * 30 = 0x1E = not enough memory
4331
  * 30 = 0x1E = not enough memory
4345
  * 31 = 0x1F = file is not executable
4332
  * 31 = 0x1F = file is not executable
4346
  * 32 = 0x20 = too many processes
4333
  * 32 = 0x20 = too many processes
4347
>
4334
>
4348
>
4335
>