Subversion Repositories Kolibri OS

Rev

Rev 6818 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6818 Rev 7657
Line 10... Line 10...
10
 
10
 
11
; to be defined:
11
; to be defined:
12
;   __DEBUG__ equ 1
12
;   __DEBUG__ equ 1
Line -... Line 13...
-
 
13
;   __DEBUG_LEVEL__ equ 5
-
 
14
 
-
 
15
_esp equ esp
-
 
16
 
-
 
17
macro put_board {
-
 
18
        mcall   63
13
;   __DEBUG_LEVEL__ equ 5
19
}
14
 
20
 
15
macro debug_func name {
21
macro debug_func name {
16
 if used name
22
 if used name
Line 50... Line 56...
50
 common
56
 common
51
  if is_str = 1
57
  if is_str = 1
52
   jmp ..label
58
        jmp     ..label
53
   ..str db _str,0
59
   ..str db _str,0
54
   ..label:
60
   ..label:
55
   add  esp,4*8+4
-
 
56
   mov  edx,..str
61
        mov     edx, ..str
57
   sub  esp,4*8+4
-
 
58
  else
62
  else
-
 
63
esp equ esp+4*8+4
59
   mov  edx,_str
64
        mov     edx, _str
-
 
65
esp equ _esp
60
  end if
66
  end if
61
  if ~_num eq
67
  if ~_num eq
62
   if _num eqtype eax
68
   if _num eqtype eax
63
    if _num in 
69
    if _num in 
64
     mov esi,_num
70
        mov     esi, _num
Line 136... Line 142...
136
   end if
142
   end if
137
  end if
143
  end if
138
 else if _dec eqtype 0
144
 else if _dec eqtype 0
139
  mov eax,_dec
145
        mov     eax, _dec
140
 else
146
 else
141
  add esp,4*8+4
147
;  add esp,4*8+4
-
 
148
esp equ esp+4*8+4
142
  if _num eq
149
  if _num eq
143
   mov eax,dword _dec
150
        mov     eax, dword _dec
144
  else if _num = 1
151
  else if _num = 1
145
   if _sign = 1
152
   if _sign = 1
146
    movsx eax,byte _dec
153
        movsx   eax, byte _dec
Line 154... Line 161...
154
    movzx eax,word _dec
161
        movzx   eax, word _dec
155
   end if
162
   end if
156
  else
163
  else
157
   mov eax,dword _dec
164
        mov     eax, dword _dec
158
  end if
165
  end if
-
 
166
esp equ _esp
159
  sub esp,4*8+4
167
;  sub esp,4*8+4
160
 end if
168
 end if
161
 mov cl,_sign
169
        mov     cl, _sign
162
 call fdo_debug_outdec
170
        call    fdo_debug_outdec
163
 popad
171
        popad
164
 popf
172
        popf
Line 185... Line 193...
185
 if _hex eqtype eax
193
 if _hex eqtype eax
186
  if _hex in 
194
  if _hex in 
187
   if ~_hex eq eax
195
   if ~_hex eq eax
188
    mov eax,_hex
196
        mov     eax, _hex
189
   end if
197
   end if
-
 
198
        mov     edx, 8
190
  else if _hex in 
199
  else if _hex in 
191
   if ~_hex eq ax
200
   if ~_hex eq ax
192
    movzx eax,_hex
201
        movzx   eax, _hex
193
   end if
202
   end if
194
   shl eax,16
-
 
195
   if (_num eq)
203
   if (_num eq)
196
    mov edx,4
204
        mov     edx, 4
197
   end if
205
   end if
198
  else if _hex in 
206
  else if _hex in 
199
   if ~_hex eq al
207
   if ~_hex eq al
200
    movzx eax,_hex
208
        movzx   eax, _hex
201
   end if
209
   end if
202
   shl eax,24
-
 
203
   if (_num eq)
210
   if (_num eq)
204
    mov edx,2
211
        mov     edx, 2
205
   end if
212
   end if
206
  end if
213
  end if
207
 else if _hex eqtype 0
214
 else if _hex eqtype 0
208
  mov eax,_hex
215
        mov     eax, _hex
209
 else
216
 else
210
  add esp,4*8+4
217
;  add esp,4*8+4
-
 
218
esp equ esp+4*8+4
211
  mov eax,dword _hex
219
        mov     eax, dword _hex
-
 
220
esp equ _esp
212
  sub esp,4*8+4
221
;  sub esp,4*8+4
213
 end if
222
 end if
214
 if ~_num eq
223
 if ~_num eq
215
  mov edx,_num
224
        mov     edx, _num
216
 else
225
 else
-
 
226
  if ~_hex eqtype eax
217
  mov edx,8
227
        mov     edx, 8
218
 end if
228
  end if
-
 
229
 end if
219
 call fdo_debug_outhex
230
        call    fdo_debug_outhex
220
 popad
231
        popad
221
 popf
232
        popf
222
}
233
}
Line 223... Line 234...
223
 
234
 
Line 224... Line 235...
224
;-----------------------------------------------------------------------------
235
;-----------------------------------------------------------------------------
225
 
236
 
226
debug_func fdo_debug_outchar
237
debug_func fdo_debug_outchar
227
debug_beginf
238
debug_beginf
228
        pushad
239
        pushad
229
        mov     cl,al
-
 
230
        mov     ebx,1
240
        movzx   ecx, al
231
        mov     eax,63
241
        mov     ebx, 1
232
        mcall
242
        put_board
233
        popad
243
        popad
Line 234... Line 244...
234
        ret
244
        ret
235
debug_endf
245
debug_endf
236
 
-
 
237
debug_func fdo_debug_outstr
246
 
-
 
247
debug_func fdo_debug_outstr
238
debug_beginf
248
debug_beginf
239
        mov     eax,63
249
        mov     ebx, 1
240
        mov     ebx,1
250
  .l1:
241
  .l1:  dec     esi
251
        dec     esi
242
        js      .l2
252
        js      .l2
243
        mov     cl,[edx]
253
        movzx   ecx, byte[edx]
244
        or      cl,cl
254
        or      cl, cl
245
        jz      .l2
255
        jz      .l2
-
 
256
        put_board
246
        mcall
257
        inc     edx
247
        inc     edx
258
        jmp     .l1
Line 248... Line 259...
248
        jmp     .l1
259
  .l2:
249
  .l2:  ret
260
        ret
250
debug_endf
261
debug_endf
Line 258... Line 269...
258
        neg     eax
269
        neg     eax
259
        push    eax
270
        push    eax
260
        mov     al,'-'
271
        mov     al, '-'
261
        call    fdo_debug_outchar
272
        call    fdo_debug_outchar
262
        pop     eax
273
        pop     eax
263
    @@: push    10
274
    @@:
264
        pop     ecx
275
        movi    ecx, 10
265
        push    -'0'
276
        push    -'0'
-
 
277
  .l1:
266
  .l1:  xor     edx,edx
278
        xor     edx, edx
267
        div     ecx
279
        div     ecx
268
        push    edx
280
        push    edx
269
        test    eax,eax
281
        test    eax, eax
270
        jnz     .l1
282
        jnz     .l1
-
 
283
  .l2:
271
  .l2:  pop     eax
284
        pop     eax
272
        add     al,'0'
285
        add     al, '0'
273
        jz      .l3
286
        jz      .l3
274
        call    fdo_debug_outchar
287
        call    fdo_debug_outchar
275
        jmp     .l2
288
        jmp     .l2
-
 
289
  .l3:
276
  .l3:  ret
290
        ret
277
debug_endf
291
debug_endf
Line 278... Line 292...
278
 
292
 
279
debug_func fdo_debug_outhex
293
debug_func fdo_debug_outhex
280
  __fdo_hexdigits db '0123456789ABCDEF'
294
  __fdo_hexdigits db '0123456789ABCDEF'
281
debug_beginf
295
debug_beginf
282
        mov     cl,dl
296
        mov     cl, dl
283
        neg     cl
297
        neg     cl
284
        add     cl,8
298
        add     cl, 8
285
        shl     cl,2
299
        shl     cl, 2
-
 
300
        rol     eax, cl
286
        rol     eax,cl
301
  .l1:
287
  .l1:  rol     eax,4
302
        rol     eax, 4
288
        push    eax
303
        push    eax
289
        and     eax,0x0000000F
304
        and     eax, 0x0000000F
290
        mov     al,[__fdo_hexdigits+eax]
305
        mov     al, [__fdo_hexdigits+eax]
291
        call    fdo_debug_outchar
306
        call    fdo_debug_outchar