Rev 7773 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7773 | Rev 7774 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | 3 | ||
4 | #ifndef INCLUDE_KOLIBRI_H |
4 | #ifndef INCLUDE_KOLIBRI_H |
5 | #include "../lib/kolibri.h" |
5 | #include "../lib/kolibri.h" |
Line 6... | Line 6... | ||
6 | #endif |
6 | #endif |
7 | 7 | ||
8 | :dword mem_init() |
8 | inline dword mem_init() |
9 | { |
9 | { |
10 | $push ebx |
10 | $push ebx |
11 | $mov eax, 68 |
11 | $mov eax, 68 |
Line 12... | Line 12... | ||
12 | $mov ebx, 11 |
12 | $mov ebx, 11 |
13 | $int 0x40 |
- | |
14 | 13 | $int 0x40 |
|
Line 15... | Line 14... | ||
15 | $pop ebx |
14 | |
16 | return EAX; |
15 | $pop ebx |
17 | } |
16 | } |
Line 96... | Line 95... | ||
96 | CLD |
95 | CLD |
97 | L2: |
96 | L2: |
98 | } |
97 | } |
99 | } |
98 | } |
Line -... | Line 99... | ||
- | 99 | ||
- | 100 | #define SHM_OPEN 0x00 |
|
- | 101 | #define SHM_OPEN_ALWAYS 0x04 |
|
- | 102 | #define SHM_CREATE 0x08 |
|
- | 103 | #define SHM_READ 0x00 |
|
100 | 104 | #define SHM_WRITE 0x01 |
|
101 | inline fastcall dword memopen(ECX, EDX, ESI) |
105 | inline fastcall dword memopen(ECX, EDX, ESI) |
102 | { |
- | |
103 | $push ebx |
106 | { |
104 | $mov eax, 68 |
107 | $mov eax, 68 |
105 | $mov ebx, 22 |
108 | $mov ebx, 22 |
106 | // ecx = area name, 31 symbols max |
109 | // ecx = area name, 31 symbols max |
107 | // edx = area size for SHM_CREATE SHM_OPEN_ALWAYS |
110 | // edx = area size for SHM_CREATE SHM_OPEN_ALWAYS |
108 | // esi = flags, see the list below: |
- | |
109 | #define SHM_OPEN 0x00 |
- | |
110 | #define SHM_OPEN_ALWAYS 0x04 |
- | |
111 | #define SHM_CREATE 0x08 |
- | |
112 | #define SHM_READ 0x00 |
- | |
113 | #define SHM_WRITE 0x01 |
111 | // esi = flags, see the list below: |
114 | $int 0x40 |
- | |
115 | $pop ebx |
112 | $int 0x40 |
116 | // eax, edx - please check system documentation |
113 | // eax, edx - please check system documentation |
Line 117... | Line 114... | ||
117 | } |
114 | } |
118 | 115 | ||
119 | inline fastcall dword memclose(ECX) |
- | |
120 | { |
116 | inline fastcall dword memclose(ECX) |
121 | $push ebx |
117 | { |
122 | $mov eax, 68 |
118 | $mov eax, 68 |
123 | $mov ebx, 23 |
- | |
124 | $int 0x40 |
119 | $mov ebx, 23 |
125 | $pop ebx |
120 | $int 0x40 |
Line 126... | Line 121... | ||
126 | // eax destroyed |
121 | // eax destroyed |
127 | } |
122 | } |