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