Subversion Repositories Kolibri OS

Rev

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

Rev 447 Rev 485
1
;
1
;
2
;   DEBUG BOARD for APPLICATIONS and KERNEL DEVELOPMENT
2
;   DEBUG BOARD for APPLICATIONS and KERNEL DEVELOPMENT
3
;
3
;
4
;   See f63
4
;   See f63
5
;
5
;
6
;   Compile with FASM for Menuet
6
;   Compile with FASM for Menuet
7
;
7
;
8
LMARGIN equ (15+5)
8
LMARGIN equ (15+5)
9
TMARGIN equ (35+5)
9
TMARGIN equ (35+5)
10
HSPACE  equ 16		
10
HSPACE  equ 16		
11
VSPACE  equ 12
11
VSPACE  equ 12
12
IPC_BUF equ 160
12
IPC_BUF equ 160
13
DR_GRID equ 0;1
13
DR_GRID equ 0;1
14
 
14
 
15
FL_KRNL equ 1
15
FL_KRNL equ 1
16
 
16
 
17
include 'lang.inc'
17
include 'lang.inc'
18
 
18
 
19
   use32
19
   use32
20
   org    0x0
20
   org    0x0
21
   db     'MENUET01'              ; 8 byte id
21
   db     'MENUET01'              ; 8 byte id
22
   dd     0x01                    ; header version
22
   dd     0x01                    ; header version
23
   dd     START                   ; start of code
23
   dd     START                   ; start of code
24
   dd     I_END                   ; size of image
24
   dd     I_END                   ; size of image
25
   dd     i_end+0x2000                  ; memory for app (4 Kb)
25
   dd     i_end+0x2000                  ; memory for app (4 Kb)
26
   dd     i_end+0x2000                  ; esp
26
   dd     i_end+0x2000                  ; esp
27
   dd     0x0 , 0x0               ; I_Param , I_Icon
27
   dd     0x0 , 0x0               ; I_Param , I_Icon
28
include 'MACROS.INC'
28
include '..\..\..\MACROS.INC'
29
include 'debug.inc'
29
include 'debug.inc'
30
purge newline
30
purge newline
31
MAXSTRINGS = 16
31
MAXSTRINGS = 16
32
TMP = 80*(MAXSTRINGS+1)
32
TMP = 80*(MAXSTRINGS+1)
33
 
33
 
34
START:                          ; start of execution
34
START:                          ; start of execution
35
 
35
 
36
     mcall 60,1,ipcbuff,IPC_BUF+20
36
     mcall 60,1,ipcbuff,IPC_BUF+20
37
     mcall 40,1000111b
37
     mcall 40,1000111b
38
     mov  [ipcbuff+4],8
38
     mov  [ipcbuff+4],8
39
     mov  ecx,4096
39
     mov  ecx,4096
40
    flush:
40
    flush:
41
     mov  eax,63
41
     mov  eax,63
42
     mov  ebx,2
42
     mov  ebx,2
43
     mcall
43
     mcall
44
     loop flush
44
     loop flush
45
 
45
 
46
     mov  ecx, TMP
46
     mov  ecx, TMP
47
     xor  eax, eax
47
     xor  eax, eax
48
     mov  edi, [targ]
48
     mov  edi, [targ]
49
     rep  stosb
49
     rep  stosb
50
 
50
 
51
     mov  [tmp1],'x'
51
     mov  [tmp1],'x'
52
     mov  [tmp2],'x'
52
     mov  [tmp2],'x'
53
 
53
 
54
     mov  eax,14
54
     mov  eax,14
55
     mcall
55
     mcall
56
     and  eax,0xffff0000
56
     and  eax,0xffff0000
57
     sub  eax,399 shl 16
57
     sub  eax,399 shl 16
58
     add  eax,399
58
     add  eax,399
59
     mov  [xstart],eax
59
     mov  [xstart],eax
60
 
60
 
61
     mov  eax,48
61
     mov  eax,48
62
     mov  ebx,3
62
     mov  ebx,3
63
     mov  ecx,sc
63
     mov  ecx,sc
64
     mov  edx,sizeof.system_colors
64
     mov  edx,sizeof.system_colors
65
     mcall
65
     mcall
66
 
66
 
67
  red:
67
  red:
68
     call draw_window
68
     call draw_window
69
 
69
 
70
still:
70
still:
71
 
71
 
72
    mov  eax,23                 ; wait here for event
72
    mov  eax,23                 ; wait here for event
73
    mov  ebx,1
73
    mov  ebx,1
74
    mcall
74
    mcall
75
 
75
 
76
    cmp  eax,1                  ; redraw request ?
76
    cmp  eax,1                  ; redraw request ?
77
    je   red
77
    je   red
78
    cmp  eax,2                  ; key in buffer ?
78
    cmp  eax,2                  ; key in buffer ?
79
    je   key
79
    je   key
80
    cmp  eax,3                  ; button in buffer ?
80
    cmp  eax,3                  ; button in buffer ?
81
    je   button
81
    je   button
82
    cmp  eax,7
82
    cmp  eax,7
83
    je   ipc
83
    je   ipc
84
 
84
 
85
    mov  eax,63
85
    mov  eax,63
86
    mov  ebx,2
86
    mov  ebx,2
87
    mcall
87
    mcall
88
 
88
 
89
    cmp  ebx,1
89
    cmp  ebx,1
90
    jne  still
90
    jne  still
91
		
91
		
92
  new_data:
92
  new_data:
93
    mov  ebp,[targ]
93
    mov  ebp,[targ]
94
  .no4:
94
  .no4:
95
    cmp  al,13
95
    cmp  al,13
96
    jne  no13
96
    jne  no13
97
    and  dword[ebp-8],0
97
    and  dword[ebp-8],0
98
    jmp  new_check
98
    jmp  new_check
99
   no13:
99
   no13:
100
    cmp  al,10
100
    cmp  al,10
101
    jne  no10
101
    jne  no10
102
    inc  dword[ebp-4]
102
    inc  dword[ebp-4]
103
    cmp  dword[ebp-4],MAXSTRINGS
103
    cmp  dword[ebp-4],MAXSTRINGS
104
    jbe  .noypos
104
    jbe  .noypos
105
    mov  dword[ebp-4],MAXSTRINGS
105
    mov  dword[ebp-4],MAXSTRINGS
106
    lea  esi,[ebp+80]
106
    lea  esi,[ebp+80]
107
    mov  edi,ebp
107
    mov  edi,ebp
108
    mov  ecx,80*(MAXSTRINGS)
108
    mov  ecx,80*(MAXSTRINGS)
109
    cld
109
    cld
110
    rep  movsb
110
    rep  movsb
111
 
111
 
112
    mov  esi,[ebp-4]
112
    mov  esi,[ebp-4]
113
    imul esi,80
113
    imul esi,80
114
    add  esi,[ebp-8]
114
    add  esi,[ebp-8]
115
    add  esi,ebp
115
    add  esi,ebp
116
    mov  ecx,80
116
    mov  ecx,80
117
    xor  al,al
117
    xor  al,al
118
    rep  stosb
118
    rep  stosb
119
  .noypos:
119
  .noypos:
120
    mov  [targ],text2
120
    mov  [targ],text2
121
    and  [krnl_cnt],0
121
    and  [krnl_cnt],0
122
    jmp  new_check
122
    jmp  new_check
123
  no10:
123
  no10:
124
    cmp  ebp,text1
124
    cmp  ebp,text1
125
    je   add2
125
    je   add2
126
  		mov  ecx,[krnl_cnt]
126
  		mov  ecx,[krnl_cnt]
127
		  cmp  al,[krnl_msg+ecx]
127
		  cmp  al,[krnl_msg+ecx]
128
  		jne  .noknl
128
  		jne  .noknl
129
		  inc  [krnl_cnt]
129
		  inc  [krnl_cnt]
130
  		cmp  [krnl_cnt],4
130
  		cmp  [krnl_cnt],4
131
  		jne  new_check
131
  		jne  new_check
132
    mov  [targ],text1
132
    mov  [targ],text1
133
  	.noknl:
133
  	.noknl:
134
    mov  ebp,[targ]
134
    mov  ebp,[targ]
135
	   jecxz .add
135
	   jecxz .add
136
    push eax
136
    push eax
137
    mov  esi,krnl_msg
137
    mov  esi,krnl_msg
138
   .l1:
138
   .l1:
139
    lodsb
139
    lodsb
140
    call add_char
140
    call add_char
141
    loop .l1
141
    loop .l1
142
    pop  eax
142
    pop  eax
143
   .add:
143
   .add:
144
    and  [krnl_cnt],0
144
    and  [krnl_cnt],0
145
  add2:
145
  add2:
146
    call add_char
146
    call add_char
147
 
147
 
148
  new_check:
148
  new_check:
149
 
149
 
150
    mov  eax,63
150
    mov  eax,63
151
    mov  ebx,2
151
    mov  ebx,2
152
    mcall
152
    mcall
153
 
153
 
154
    cmp  ebx,1
154
    cmp  ebx,1
155
    je   new_data
155
    je   new_data
156
 
156
 
157
    cmp  [vmode],2
157
    cmp  [vmode],2
158
    je   still
158
    je   still
159
    call draw_window
159
    call draw_window
160
 
160
 
161
    jmp  still
161
    jmp  still
162
 
162
 
163
  ipc:
163
  ipc:
164
    mov  [vmode],2
164
    mov  [vmode],2
165
    mov  eax,ipcbuff
165
    mov  eax,ipcbuff
166
    mov  esi,[eax+8]
166
    mov  esi,[eax+8]
167
    mov  byte[eax],1
167
    mov  byte[eax],1
168
    push dword[eax+12]
168
    push dword[eax+12]
169
    pop  [dump_len]
169
    pop  [dump_len]
170
    mcall 9,work,-1
170
    mcall 9,work,-1
171
    mov  ecx,eax
171
    mov  ecx,eax
172
   .lp:
172
   .lp:
173
    mcall 9
173
    mcall 9
174
    cmp  [ebx+30],esi
174
    cmp  [ebx+30],esi
175
    je   .ok
175
    je   .ok
176
    loop .lp
176
    loop .lp
177
    and  [dump_len],0
177
    and  [dump_len],0
178
    jmp  red
178
    jmp  red
179
  .ok:
179
  .ok:
180
    mov  [pid],esi
180
    mov  [pid],esi
181
    lea  esi,[ebx+10]
181
    lea  esi,[ebx+10]
182
    mov  edi,dump_title+10
182
    mov  edi,dump_title+10
183
    mov  ecx,12
183
    mov  ecx,12
184
    rep  movsb
184
    rep  movsb
185
    jmp  red
185
    jmp  red
186
  key:                          ; key
186
  key:                          ; key
187
    mov  al,2                  ; just read it and ignore
187
    mov  al,2                  ; just read it and ignore
188
    mcall
188
    mcall
189
    cmp  ah,' '
189
    cmp  ah,' '
190
    je   button.no_krnl_flt
190
    je   button.no_krnl_flt
191
    cmp  [vmode],2
191
    cmp  [vmode],2
192
    jne  still
192
    jne  still
193
    cmp  ah,176 ;left
193
    cmp  ah,176 ;left
194
    jb   still
194
    jb   still
195
    cmp  ah,179 ;right
195
    cmp  ah,179 ;right
196
    ja  still
196
    ja  still
197
    mov  ecx,[offs]
197
    mov  ecx,[offs]
198
    shr  eax,8
198
    shr  eax,8
199
    sub  eax,176
199
    sub  eax,176
200
    add  ecx,[arrows+eax*4]
200
    add  ecx,[arrows+eax*4]
201
    shl  ecx,12
201
    shl  ecx,12
202
    shr  cx,12
202
    shr  cx,12
203
    jmp  button.check_sel
203
    jmp  button.check_sel
204
  .nol:
204
  .nol:
205
    jmp  still
205
    jmp  still
206
 
206
 
207
arrows dd -1,16,-16,1
207
arrows dd -1,16,-16,1
208
 
208
 
209
  button:                       ; button
209
  button:                       ; button
210
    mov  al,17                 ; get id
210
    mov  al,17                 ; get id
211
    mcall
211
    mcall
212
 
212
 
213
    cmp  ah,1                   ; button id=1 ?
213
    cmp  ah,1                   ; button id=1 ?
214
    jne  .noclose
214
    jne  .noclose
215
 
215
 
216
    or   eax,-1                 ; close this program
216
    or   eax,-1                 ; close this program
217
    mcall
217
    mcall
218
  .noclose:
218
  .noclose:
219
   	shr  eax,8
219
   	shr  eax,8
220
  		cmp  eax,10
220
  		cmp  eax,10
221
  		jb   .nodump
221
  		jb   .nodump
222
		  lea  edi,[eax-10]
222
		  lea  edi,[eax-10]
223
  		mcall 37,1
223
  		mcall 37,1
224
		  sub  eax,[edi*4+dump_cell_marg]
224
		  sub  eax,[edi*4+dump_cell_marg]
225
  		sub  eax,TMARGIN+VSPACE
225
  		sub  eax,TMARGIN+VSPACE
226
  		push eax
226
  		push eax
227
    and  eax,0xffff
227
    and  eax,0xffff
228
		  xor  edx,edx
228
		  xor  edx,edx
229
  		div  word[edi*4+dump_cell_size+2]
229
  		div  word[edi*4+dump_cell_size+2]
230
		  mov  ecx,eax
230
		  mov  ecx,eax
231
    shl  ecx,16
231
    shl  ecx,16
232
  		xor  edx,edx
232
  		xor  edx,edx
233
		  pop  eax
233
		  pop  eax
234
  		shr  eax,16
234
  		shr  eax,16
235
  		div  word[edi*4+dump_cell_size]
235
  		div  word[edi*4+dump_cell_size]
236
  		mov  cx,ax
236
  		mov  cx,ax
237
  .check_sel:
237
  .check_sel:
238
  		mov  eax,ecx
238
  		mov  eax,ecx
239
    shl  ax,12
239
    shl  ax,12
240
    shr  eax,12
240
    shr  eax,12
241
    inc  eax
241
    inc  eax
242
    cmp  eax,[dump_len]
242
    cmp  eax,[dump_len]
243
    ja   still;.nosel
243
    ja   still;.nosel
244
    mov  dword[sel_byte],ecx
244
    mov  dword[sel_byte],ecx
245
    dec  eax
245
    dec  eax
246
    mov  [offs],eax
246
    mov  [offs],eax
247
    jmp  red
247
    jmp  red
248
 
248
 
249
  .nodump:
249
  .nodump:
250
    cmp  eax,2
250
    cmp  eax,2
251
    jne  .no_krnl_flt
251
    jne  .no_krnl_flt
252
    xor  [flag],FL_KRNL
252
    xor  [flag],FL_KRNL
253
    jmp  still
253
    jmp  still
254
  .no_krnl_flt:
254
  .no_krnl_flt:
255
    mov  [ipcbuff+4],8
255
    mov  [ipcbuff+4],8
256
    and  byte[ipcbuff],0
256
    and  byte[ipcbuff],0
257
    inc  [vmode]
257
    inc  [vmode]
258
    cmp  [vmode],3
258
    cmp  [vmode],3
259
    jb   .vmok
259
    jb   .vmok
260
    and  [vmode],0
260
    and  [vmode],0
261
  .vmok:
261
  .vmok:
262
    jmp  red
262
    jmp  red
263
 
263
 
264
add_char:
264
add_char:
265
    push esi
265
    push esi
266
    mov  esi,[ebp-4]
266
    mov  esi,[ebp-4]
267
    imul esi,80
267
    imul esi,80
268
    add  esi,[ebp-8]
268
    add  esi,[ebp-8]
269
    mov  [ebp+esi],al
269
    mov  [ebp+esi],al
270
    inc  dword[ebp-8]
270
    inc  dword[ebp-8]
271
    cmp  dword[ebp-8],80
271
    cmp  dword[ebp-8],80
272
    jb   .ok
272
    jb   .ok
273
    mov  dword[ebp-8],79
273
    mov  dword[ebp-8],79
274
  .ok:
274
  .ok:
275
    pop  esi
275
    pop  esi
276
    ret
276
    ret
277
 
277
 
278
;   *********************************************
278
;   *********************************************
279
;   *******  WINDOW DEFINITIONS AND DRAW ********
279
;   *******  WINDOW DEFINITIONS AND DRAW ********
280
;   *********************************************
280
;   *********************************************
281
 
281
 
282
 
282
 
283
draw_window:
283
draw_window:
284
 
284
 
285
    mov  eax,12                    ; function 12:tell os about windowdraw
285
    mov  eax,12                    ; function 12:tell os about windowdraw
286
    mov  ebx,1                     ; 1, start of draw
286
    mov  ebx,1                     ; 1, start of draw
287
    mcall
287
    mcall
288
 
288
 
289
                                   ; DRAW WINDOW
289
                                   ; DRAW WINDOW
290
    xor  eax,eax                     ; function 0 : define and draw window
290
    xor  eax,eax                     ; function 0 : define and draw window
291
;   mov  ebx,50*65536+400          ; [x start] *65536 + [x size]
291
;   mov  ebx,50*65536+400          ; [x start] *65536 + [x size]
292
    mov  ebx,[xstart]
292
    mov  ebx,[xstart]
293
    mov  ecx,MAXSTRINGS*10+45      ; [y start] *65536 + [y size]
293
    mov  ecx,MAXSTRINGS*10+45      ; [y start] *65536 + [y size]
294
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color gl
294
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color gl
295
    or   edx,0x13000000
295
    or   edx,0x13000000
296
    mov  edi,header                ; WINDOW LABEL
296
    mov  edi,title                ; WINDOW LABEL
297
    mcall
297
    mcall
298
    
298
    
299
    mov  ecx,4
299
    mov  ecx,4
300
    mov  esi,[sc.work]
300
    mov  esi,[sc.work]
301
    mov  ebx,296 shl 16+5*6
301
    mov  ebx,296 shl 16+5*6
302
    mov  edx,3;+1 shl 30
302
    mov  edx,3;+1 shl 30
303
    mcall 8,,<5,12>
303
    mcall 8,,<5,12>
304
    mov  edx,[vmode]
304
    mov  edx,[vmode]
305
    lea  edx,[edx*4+duk]
305
    lea  edx,[edx*4+duk]
306
    mcall 4,<300,8>,,,4
306
    mcall 4,<300,8>,,,4
307
 
307
 
308
    cmp  [vmode],2
308
    cmp  [vmode],2
309
    je   no_mdbg
309
    je   no_mdbg
310
    mov  ebx,15*65536+33           ; draw info text with function 4
310
    mov  ebx,15*65536+33           ; draw info text with function 4
311
    mov  ecx,[sc.work_text]
311
    mov  ecx,[sc.work_text]
312
    mov  edx,text1
312
    mov  edx,text1
313
    cmp  [vmode],0
313
    cmp  [vmode],0
314
    je   .kern
314
    je   .kern
315
    mov  edx,text2
315
    mov  edx,text2
316
  .kern:
316
  .kern:
317
    mov  esi,80
317
    mov  esi,80
318
    mov  eax,4
318
    mov  eax,4
319
  newline:
319
  newline:
320
    mcall
320
    mcall
321
    add  ebx,10
321
    add  ebx,10
322
    add  edx,80
322
    add  edx,80
323
    cmp  [edx],byte 'x'
323
    cmp  [edx],byte 'x'
324
    jne  newline
324
    jne  newline
325
    jmp  enddraw
325
    jmp  enddraw
326
  no_mdbg:
326
  no_mdbg:
327
  if DUMP_TEST eq 1
327
  if DUMP_TEST eq 1
328
    mov  esi,0
328
    mov  esi,0
329
    mov  [dump_len],100;IPC_BUF
329
    mov  [dump_len],100;IPC_BUF
330
  else
330
  else
331
    mov  esi,ipcbuff+16
331
    mov  esi,ipcbuff+16
332
  end if
332
  end if
333
    mov  ecx,[dump_len]
333
    mov  ecx,[dump_len]
334
    call dump_btn
334
    call dump_btn
335
  		call draw_dump
335
  		call draw_dump
336
		enddraw:
336
		enddraw:
337
    mov  eax,12                    ; function 12:tell os about windowdraw
337
    mov  eax,12                    ; function 12:tell os about windowdraw
338
    mov  ebx,2                     ; 2, end of draw
338
    mov  ebx,2                     ; 2, end of draw
339
    mcall
339
    mcall
340
 
340
 
341
    ret
341
    ret
342
 
342
 
343
if DR_GRID eq 1
343
if DR_GRID eq 1
344
draw_grid:
344
draw_grid:
345
  mov  ecx,11
345
  mov  ecx,11
346
  mov  edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE
346
  mov  edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE
347
 .l1:
347
 .l1:
348
  push ecx
348
  push ecx
349
  mov  ebx,LMARGIN shl 16+LMARGIN+16*HSPACE
349
  mov  ebx,LMARGIN shl 16+LMARGIN+16*HSPACE
350
  mcall 38,,edi,0
350
  mcall 38,,edi,0
351
  add  edi,VSPACE shl 16+VSPACE
351
  add  edi,VSPACE shl 16+VSPACE
352
  pop  ecx
352
  pop  ecx
353
  loop .l1
353
  loop .l1
354
  mov  ecx,17
354
  mov  ecx,17
355
  mov  edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE*10
355
  mov  edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE*10
356
  mov  ebx,LMARGIN shl 16+LMARGIN
356
  mov  ebx,LMARGIN shl 16+LMARGIN
357
 .l2:
357
 .l2:
358
  push ecx
358
  push ecx
359
  mcall 38,,edi,0
359
  mcall 38,,edi,0
360
  add  ebx,HSPACE shl 16+HSPACE
360
  add  ebx,HSPACE shl 16+HSPACE
361
  pop  ecx
361
  pop  ecx
362
  loop .l2
362
  loop .l2
363
  ret
363
  ret
364
end if
364
end if
365
 
365
 
366
draw_numbers:
366
draw_numbers:
367
  mcall 4,(LMARGIN+2) shl 16+180,0,numb,numb_len-numb
367
  mcall 4,(LMARGIN+2) shl 16+180,0,numb,numb_len-numb
368
  mov  eax,dword[sel_byte]
368
  mov  eax,dword[sel_byte]
369
  shl  ax,12
369
  shl  ax,12
370
  shr  eax,12
370
  shr  eax,12
371
  mov  edi,eax
371
  mov  edi,eax
372
if ~ DUMP_TEST eq 1
372
if ~ DUMP_TEST eq 1
373
  add  edi,ipcbuff+16
373
  add  edi,ipcbuff+16
374
end if
374
end if
375
  mov  edx,(LMARGIN+2+6*6)shl 16+180
375
  mov  edx,(LMARGIN+2+6*6)shl 16+180
376
  mov  ebx,0x30000
376
  mov  ebx,0x30000
377
  movzx ecx,byte[edi]
377
  movzx ecx,byte[edi]
378
  mcall 47,,,,0x4e00e7
378
  mcall 47,,,,0x4e00e7
379
  add  ebx,0x20000
379
  add  ebx,0x20000
380
  add  edx,(6*10)shl 16
380
  add  edx,(6*10)shl 16
381
  movzx ecx,word[edi]
381
  movzx ecx,word[edi]
382
  mcall
382
  mcall
383
  add  ebx,0x50000
383
  add  ebx,0x50000
384
  add  edx,(6*13)shl 16
384
  add  edx,(6*13)shl 16
385
  mov  ecx,[edi]
385
  mov  ecx,[edi]
386
  mcall
386
  mcall
387
  mov  ebx,0x80100
387
  mov  ebx,0x80100
388
  add  edx,(6*19)shl 16
388
  add  edx,(6*19)shl 16
389
  mcall
389
  mcall
390
.ex:
390
.ex:
391
  ret
391
  ret
392
 
392
 
393
draw_dump:
393
draw_dump:
394
; esi - data ptr, ecx - length
394
; esi - data ptr, ecx - length
395
  jecxz draw_numbers.ex
395
  jecxz draw_numbers.ex
396
  pusha
396
  pusha
397
  call draw_numbers
397
  call draw_numbers
398
  mcall 4,(LMARGIN+2) shl 16+27,0,dump_title,dump_t_len-dump_title
398
  mcall 4,(LMARGIN+2) shl 16+27,0,dump_title,dump_t_len-dump_title
399
  mcall 47,0x30101,ipcbuff+8,(LMARGIN+2+6*29)shl 16+27
399
  mcall 47,0x30101,ipcbuff+8,(LMARGIN+2+6*29)shl 16+27
400
  add   edx,(6*27) shl 16
400
  add   edx,(6*27) shl 16
401
  mov   ecx,offs
401
  mov   ecx,offs
402
  mcall
402
  mcall
403
  sub   edx,(5*6)shl 16
403
  sub   edx,(5*6)shl 16
404
  mcall ,0x30001
404
  mcall ,0x30001
405
  mov  ecx,16
405
  mov  ecx,16
406
  mov  edi,HSPACE shl 16
406
  mov  edi,HSPACE shl 16
407
  mov  ebx,(LMARGIN+5)shl 16+42
407
  mov  ebx,(LMARGIN+5)shl 16+42
408
  call draw_marks
408
  call draw_marks
409
  mov  ecx,[esp+24]
409
  mov  ecx,[esp+24]
410
  dec  ecx
410
  dec  ecx
411
  shr  ecx,4
411
  shr  ecx,4
412
  inc  ecx
412
  inc  ecx
413
  mov  ebx,(LMARGIN-10)shl 16+TMARGIN+2+VSPACE
413
  mov  ebx,(LMARGIN-10)shl 16+TMARGIN+2+VSPACE
414
  mov  edi,VSPACE
414
  mov  edi,VSPACE
415
  call draw_marks
415
  call draw_marks
416
  popa
416
  popa
417
		mov  edx,TMARGIN+2
417
		mov  edx,TMARGIN+2
418
		mov  edi,ecx
418
		mov  edi,ecx
419
	.lp:	
419
	.lp:	
420
		add  edx,(LMARGIN+2) shl 16+VSPACE
420
		add  edx,(LMARGIN+2) shl 16+VSPACE
421
		mov  ecx,16
421
		mov  ecx,16
422
		cmp  edi,ecx
422
		cmp  edi,ecx
423
		jae  .less
423
		jae  .less
424
		mov  ecx,edi
424
		mov  ecx,edi
425
	.less:	
425
	.less:	
426
		sub  edi,ecx
426
		sub  edi,ecx
427
		push esi ecx
427
		push esi ecx
428
		mov  ebx,0x20100
428
		mov  ebx,0x20100
429
	.lp1:	
429
	.lp1:	
430
		push ecx esi
430
		push ecx esi
431
		movzx ecx,byte[esi]
431
		movzx ecx,byte[esi]
432
		mcall 47,,,,0
432
		mcall 47,,,,0
433
		add  edx,HSPACE shl 16
433
		add  edx,HSPACE shl 16
434
		pop  esi ecx
434
		pop  esi ecx
435
		inc  esi
435
		inc  esi
436
		loop .lp1
436
		loop .lp1
437
		pusha
437
		pusha
438
		mov  ebx,edx
438
		mov  ebx,edx
439
		and  ebx,0xffff
439
		and  ebx,0xffff
440
		add  ebx,(LMARGIN+16*HSPACE+15)shl 16
440
		add  ebx,(LMARGIN+16*HSPACE+15)shl 16
441
		mov  edx,[esp+36]
441
		mov  edx,[esp+36]
442
		mov  esi,[esp+32]
442
		mov  esi,[esp+32]
443
		mcall 4,,0
443
		mcall 4,,0
444
		popa
444
		popa
445
		add  esp,8
445
		add  esp,8
446
		and  edx,0xffff
446
		and  edx,0xffff
447
		test edi,edi
447
		test edi,edi
448
		jnz  .lp
448
		jnz  .lp
449
.ex:
449
.ex:
450
		ret
450
		ret
451
 
451
 
452
draw_marks:
452
draw_marks:
453
; ebx -xy, edi-addition, ecx -cycles
453
; ebx -xy, edi-addition, ecx -cycles
454
		pusha
454
		pusha
455
  mov  edx,__hexdigits
455
  mov  edx,__hexdigits
456
  mov  eax,4
456
  mov  eax,4
457
  mov  esi,1
457
  mov  esi,1
458
.tt:
458
.tt:
459
  push ecx
459
  push ecx
460
  mcall ,,0xffffff
460
  mcall ,,0xffffff
461
  add  ebx,edi
461
  add  ebx,edi
462
  inc  edx
462
  inc  edx
463
  pop  ecx
463
  pop  ecx
464
  loop .tt
464
  loop .tt
465
  popa
465
  popa
466
  ret
466
  ret
467
 
467
 
468
dump_btn: ; ecx-length
468
dump_btn: ; ecx-length
469
  jecxz draw_dump.ex
469
  jecxz draw_dump.ex
470
		pusha
470
		pusha
471
		test ecx,0xffff
471
		test ecx,0xffff
472
		je   .even
472
		je   .even
473
		add  ecx,16
473
		add  ecx,16
474
	.even:	
474
	.even:	
475
		shr  ecx,4
475
		shr  ecx,4
476
		imul ecx,VSPACE
476
		imul ecx,VSPACE
477
		add  ecx,(TMARGIN+VSPACE)shl 16-5
477
		add  ecx,(TMARGIN+VSPACE)shl 16-5
478
		mcall 8,LMARGIN shl 16+16*HSPACE-5,,10+3 shl 29,[sc.work]
478
		mcall 8,LMARGIN shl 16+16*HSPACE-5,,10+3 shl 29,[sc.work]
479
		inc  edx
479
		inc  edx
480
		mcall ,(LMARGIN+16*HSPACE+15)shl 16+6*16
480
		mcall ,(LMARGIN+16*HSPACE+15)shl 16+6*16
481
		mov  edx,0xff0000
481
		mov  edx,0xff0000
482
		mov  esi,dump_cell_size
482
		mov  esi,dump_cell_size
483
		xor  eax,eax
483
		xor  eax,eax
484
		movzx ebx,[sel_byte]
484
		movzx ebx,[sel_byte]
485
		lodsw
485
		lodsw
486
		imul bx,ax
486
		imul bx,ax
487
		shl  ebx,16
487
		shl  ebx,16
488
		lea  ebx,[ebx+eax+LMARGIN shl 16]
488
		lea  ebx,[ebx+eax+LMARGIN shl 16]
489
		movzx ecx,[sel_byte+2]
489
		movzx ecx,[sel_byte+2]
490
		lodsw
490
		lodsw
491
		imul cx,ax
491
		imul cx,ax
492
		shl  ecx,16
492
		shl  ecx,16
493
		lea  ecx,[ecx+eax+(TMARGIN+VSPACE) shl 16]
493
		lea  ecx,[ecx+eax+(TMARGIN+VSPACE) shl 16]
494
		mcall 13
494
		mcall 13
495
		movzx ebx,[sel_byte]
495
		movzx ebx,[sel_byte]
496
		lodsw
496
		lodsw
497
		imul bx,ax
497
		imul bx,ax
498
		shl  ebx,16
498
		shl  ebx,16
499
		lea  ebx,[ebx+eax+(LMARGIN+16*HSPACE+15)shl 16]
499
		lea  ebx,[ebx+eax+(LMARGIN+16*HSPACE+15)shl 16]
500
  mcall 13
500
  mcall 13
501
		popa
501
		popa
502
.ex:
502
.ex:
503
		ret		
503
		ret		
504
 
504
 
505
krnl_msg db 'K : '
505
krnl_msg db 'K : '
506
duk db 'KernUserDump'
506
duk db 'KernUserDump'
507
numb db 'Byte:     Word:       Dword:               Hex:'
507
numb db 'Byte:     Word:       Dword:               Hex:'
508
numb_len:
508
numb_len:
509
dump_title db 'Dump from              (pid=    h)         Offset:     (   h)'
509
dump_title db 'Dump from              (pid=    h)         Offset:     (   h)'
510
dump_t_len:
510
dump_t_len:
511
 
511
 
512
; DATA AREA
512
; DATA AREA
513
 
513
 
514
dump_cell_marg dd LMARGIN shl 16,(LMARGIN+16*HSPACE+15)shl 16
514
dump_cell_marg dd LMARGIN shl 16,(LMARGIN+16*HSPACE+15)shl 16
515
dump_cell_size dw HSPACE,VSPACE,6,VSPACE
515
dump_cell_size dw HSPACE,VSPACE,6,VSPACE
516
; 11,11 > 0,-1
516
; 11,11 > 0,-1
517
; 5,11  > 0,-1
517
; 5,11  > 0,-1
518
if lang eq ru
518
if lang eq ru
519
   header    db   '„®áª  ®â« ¤ª¨ ¨ á®®¡é¥­¨©',0
519
   title    db   '„®áª  ®â« ¤ª¨ ¨ á®®¡é¥­¨©',0
520
else if lang eq en
520
else if lang eq en
521
   header    db   'General debug & message board',0
521
   title    db   'General debug & message board',0
522
else
522
else
523
   header    db   'Allgemeines debug- & nachrichtenboard',0
523
   title    db   'Allgemeines debug- & nachrichtenboard',0
524
end if
524
end if
525
   krnl_cnt dd 0
525
   krnl_cnt dd 0
526
   vmode dd 0
526
   vmode dd 0
527
   targ  dd text2
527
   targ  dd text2
528
I_END:
528
I_END:
529
     offs dd ?
529
     offs dd ?
530
     flag rb 1
530
     flag rb 1
531
     ipcbuff rb IPC_BUF+20
531
     ipcbuff rb IPC_BUF+20
532
     rd 2
532
     rd 2
533
;     x1pos  dd ?
533
;     x1pos  dd ?
534
;     y1pos  dd ?
534
;     y1pos  dd ?
535
     text1 rb 80*(MAXSTRINGS+1)
535
     text1 rb 80*(MAXSTRINGS+1)
536
     tmp1  db ?
536
     tmp1  db ?
537
     rd 2
537
     rd 2
538
;     x2pos  dd ?
538
;     x2pos  dd ?
539
;     y2pos  dd ?
539
;     y2pos  dd ?
540
     text2 rb 80*(MAXSTRINGS+1)
540
     text2 rb 80*(MAXSTRINGS+1)
541
     tmp2  db ?
541
     tmp2  db ?
542
     work rb 4096
542
     work rb 4096
543
     sel_byte  dw ?,?
543
     sel_byte  dw ?,?
544
     pid  dd ?
544
     pid  dd ?
545
     xstart dd ?
545
     xstart dd ?
546
     dump_len dd ?
546
     dump_len dd ?
547
     sc system_colors
547
     sc system_colors
548
i_end:
548
i_end: