4a858df6ed1954a313c659afceffd288bee500a9
[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 _DbgBreakPointNoBugCheck@0
18
19 /* FUNCTIONS ***************************************************************/
20
21 .func DbgBreakPointNoBugCheck@0
22 _DbgBreakPointNoBugCheck@0:
23 int 3
24 ret
25 .endfunc
26
27 .func DbgBreakPoint@0
28 _DbgBreakPoint@0:
29 _DbgUserBreakPoint@0:
30 int 3
31 ret
32 .endfunc
33
34 .func DbgBreakPointWithStatus@4
35 _DbgBreakPointWithStatus@4:
36 mov eax, [esp+4]
37 int 3
38 ret 4
39 .endfunc
40
41 .func DebugService@20
42 _DebugService@20:
43
44 /* Setup the stack */
45 push ebp
46 mov ebp, esp
47
48 /* Save the registers */
49 push ecx
50 push ebx
51 push edi
52 push edi
53 push ebx
54
55 /* Call the Interrupt */
56 mov eax, [ebp+8]
57 mov ecx, [ebp+12]
58 mov edx, [ebp+16]
59 mov ebx, [ebp+20]
60 mov edi, [ebp+24]
61 int 0x2D
62 //int 3
63
64 /* Restore registers */
65 pop ebx
66 pop edi
67 pop edi
68 pop ebx
69
70 /* Return */
71 leave
72 ret 20
73 .endfunc