Subversion Repositories Kolibri OS

Rev

Rev 6887 | Rev 7746 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6058 leency 1
#ifndef INCLUDE_DEBUG_H
2
#define INCLUDE_DEBUG_H
3
 
4
#ifndef INCLUDE_STRING_H
5
#include "../lib/strings.h"
6
#endif
7
 
8
inline fastcall void debugch( ECX)
9
{
10
	$push eax
11
	$push ebx
12
	$mov eax,63
13
	$mov ebx,1
14
	$int 0x40
15
	$pop ebx
16
	$pop eax
17
}
18
 
19
inline fastcall void debug( EDX)
20
{
21
	$push eax
22
	$push ebx
23
	$push ecx
24
	$mov eax, 63
25
	$mov ebx, 1
26
NEXT_CHAR:
27
	$mov ecx, DSDWORD[edx]
28
	$or	 cl, cl
29
	$jz  DONE
30
	$int 0x40
31
	$inc edx
32
	$jmp NEXT_CHAR
33
DONE:
34
	$pop ecx
35
	$pop ebx
36
	$pop eax
37
}
38
 
39
inline fastcall void debugln( EDX)
40
{
41
	debug( EDX);
6152 leency 42
	debugch(10);
6058 leency 43
}
44
 
45
inline void debugi(dword d_int)
46
{
47
	char tmpch[12];
48
	itoa_(#tmpch, d_int);
49
	debugln(#tmpch);
50
}
51
 
6278 leency 52
:void debugval(dword text,number)
53
{
54
	debug(text);
55
	debug(": ");
56
	debugi(number);
57
}
58
 
6058 leency 59
#endif