Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
609 | andrew_pro | 1 | format ELF |
2 | section '.text' executable |
||
3 | |||
4 | public console_init |
||
5 | public console_printf |
||
6 | public console_exit |
||
7 | |||
8 | align 4 |
||
9 | console_init: |
||
10 | |||
11 | pushad |
||
12 | |||
13 | mov eax,[console_init_status] |
||
14 | test eax,eax |
||
15 | jnz console_initializated |
||
16 | |||
17 | mov [console_init_status],1 |
||
18 | |||
19 | mov eax,68 |
||
20 | mov ebx,19 |
||
21 | mov ecx,console_path |
||
22 | int 0x40 |
||
23 | |||
24 | test eax,eax |
||
25 | jz console_not_loaded |
||
26 | |||
27 | mov ebx,[eax+4] |
||
28 | mov [con_start],ebx |
||
29 | |||
30 | mov ebx,[eax+4+16] |
||
31 | mov [con_init],ebx |
||
32 | |||
33 | mov ebx,[eax+4+32] |
||
34 | mov [con_printf],ebx |
||
35 | |||
36 | push 1 |
||
37 | call [con_start] |
||
38 | |||
39 | push caption |
||
40 | push -1 |
||
41 | push -1 |
||
42 | push -1 |
||
43 | push -1 |
||
44 | call [con_init] |
||
45 | |||
46 | console_not_loaded: |
||
47 | |||
48 | console_initializated: |
||
49 | |||
50 | popad |
||
51 | |||
52 | ret |
||
53 | |||
54 | align 4 |
||
55 | console_printf: |
||
56 | |||
57 | pop [return_addres] |
||
58 | |||
59 | call [con_printf] |
||
60 | ;add esp,8 |
||
61 | |||
62 | push [return_addres] |
||
63 | |||
64 | ret |
||
65 | |||
66 | align 4 |
||
67 | console_exit: |
||
68 | |||
69 | push 0 |
||
70 | call [con_exit] |
||
71 | |||
72 | ret |
||
73 | |||
74 | |||
75 | ;----------------------------- |
||
76 | console_path db '/sys/dll/console.obj',0 |
||
77 | caption db 'Console',0 |
||
78 | |||
79 | align 4 |
||
80 | con_start rd 1 |
||
81 | con_init rd 1 |
||
82 | con_printf rd 1 |
||
83 | con_exit rd 1 |
||
84 | console_init_status rd 1 |
||
85 | return_addres rd 1 |