832502df61419200d8053b24d89536beb092b4ba
[reactos.git] / reactos / lib / rtl / i386 / debug_asm.S
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Run-Time Library
4 * PURPOSE: Debug Routines
5 * FILE: lib/rtl/i386/debug.S
6 * PROGRAMER: Alex Ionescu (alex@relsoft.net)
7 */
8
9 .intel_syntax noprefix
10
11 /* GLOBALS ****************************************************************/
12
13 .globl _DbgBreakPoint@0
14 .globl _DbgBreakPointWithStatus@4
15 .globl _DbgUserBreakPoint@0
16 .globl _DebugService@20
17 .globl _DebugService2@12
18 .globl _DbgBreakPointNoBugCheck@0
19
20 /* FUNCTIONS ***************************************************************/
21
22 .func DbgBreakPointNoBugCheck@0
23 _DbgBreakPointNoBugCheck@0:
24 int 3
25 ret
26 .endfunc
27
28 .func DbgBreakPoint@0
29 _DbgBreakPoint@0:
30 _DbgUserBreakPoint@0:
31 int 3
32 ret
33 .endfunc
34
35 .func DbgBreakPointWithStatus@4
36 _DbgBreakPointWithStatus@4:
37 mov eax, [esp+4]
38 int 3
39 ret 4
40 .endfunc
41
42 .func DebugService2@12
43 _DebugService2@12:
44
45 /* Setup the stack */
46 push ebp
47 mov ebp, esp
48
49 /* Call the interrupt */
50 mov eax, [ebp+16]
51 mov ecx, [ebp+8]
52 mov edx, [ebp+12]
53 int 0x2D
54 //int 3
55
56 /* Restore stack */
57 pop ebp
58 ret 12
59 .endfunc
60
61 .func DebugService@20
62 _DebugService@20:
63
64 /* Setup the stack */
65 push ebp
66 mov ebp, esp
67
68 /* Save the registers */
69 push ecx
70 push ebx
71 push edi
72 push edi
73 push ebx
74
75 /* Call the Interrupt */
76 mov eax, [ebp+8]
77 mov ecx, [ebp+12]
78 mov edx, [ebp+16]
79 mov ebx, [ebp+20]
80 mov edi, [ebp+24]
81 int 0x2D
82 //int 3
83
84 /* Restore registers */
85 pop ebx
86 pop edi
87 pop edi
88 pop ebx
89
90 /* Return */
91 leave
92 ret 20
93 .endfunc