Rev 1904 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1698 | IgorA | 1 | ; |
1727 | IgorA | 2 | ; в этом файле собраны функции создающие програмный код |
1698 | IgorA | 3 | ; |
1727 | IgorA | 4 | u_object object ;временный объект для задания смещений |
1698 | IgorA | 5 | |
6 | macro insert_coma |
||
7 | { |
||
8 | stdcall [ted_text_add], tedit0,txt_coma,1,ted_opt_ed_move_cursor |
||
9 | } |
||
10 | macro insert_nl |
||
11 | { |
||
12 | stdcall [ted_text_add], tedit0,txt_nl,1,ted_opt_ed_move_cursor |
||
13 | } |
||
14 | macro insert_com |
||
15 | { |
||
16 | stdcall [ted_text_add], tedit0,txt_com,1,ted_opt_ed_move_cursor |
||
17 | } |
||
18 | macro insert_sp |
||
19 | { |
||
20 | stdcall [ted_text_add], tedit0,txt_sp,1,ted_opt_ed_move_cursor |
||
21 | } |
||
22 | |||
1727 | IgorA | 23 | ;функция вставляет текстовую строку в текстовый редактор |
1698 | IgorA | 24 | align 4 |
25 | proc insert_text, txt:dword |
||
26 | push eax |
||
27 | stdcall str_len,dword[txt] |
||
28 | cmp eax,1 |
||
29 | jl @f |
||
30 | stdcall [ted_text_add], tedit0,dword[txt],eax,ted_opt_ed_move_cursor |
||
31 | @@: |
||
32 | pop eax |
||
33 | ret |
||
34 | endp |
||
35 | |||
1727 | IgorA | 36 | ;вставляет указанное текстовое свойство из объекта в текстовый редактор |
1698 | IgorA | 37 | align 4 |
38 | proc insert_text_prop, p_obj:dword,index:dword |
||
39 | push eax edx |
||
40 | mov eax,[p_obj] |
||
41 | mov edx,[index] |
||
42 | stdcall get_obj_text_col,eax,edx |
||
43 | stdcall str_len,edx |
||
44 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
45 | pop edx eax |
||
46 | ret |
||
47 | endp |
||
48 | |||
1727 | IgorA | 49 | ;вставляет указанное битовое свойство из объекта в текстовый редактор |
50 | align 4 |
||
51 | proc insert_bit_prop, p_obj:dword,index:dword |
||
52 | push ebx ecx edi |
||
53 | mov ebx,[p_obj] |
||
54 | mov ecx,[index] |
||
55 | test_bool_prop ebx,ecx |
||
56 | jnc @f ;если пользователь не выбрал в объекте данное свойство |
||
57 | mov ebx,dword[ebx] |
||
58 | call find_obj_in_opt |
||
59 | mov ecx,dword[edi+obj_opt.bit_val-obj_opt] ;ecx - смещение значений свойств (констант) |
||
60 | cmp byte[ecx],0 |
||
61 | je @f ;если у объекта нет заданных битовых свойств |
||
62 | add ecx,obj_opt ;добавляем начало файла с опциями |
||
63 | stdcall get_string_by_ind, ecx,[index] |
||
64 | cmp byte[edi],0 |
||
65 | je @f ;если у объекта битовое свойство пустое |
||
66 | stdcall insert_text, txt_plus |
||
67 | stdcall insert_text, edi |
||
68 | @@: |
||
69 | pop edi ecx ebx |
||
70 | ret |
||
71 | endp |
||
72 | |||
73 | ;функция вставляет 2 параметра по 16 бит в виде: |
||
1720 | IgorA | 74 | ; (_p1_ shl 16 + _p2_) |
75 | align 4 |
||
76 | proc insert_2_prop_16_bit, obj:dword, p_hi:dword, p_lo:dword |
||
77 | stdcall insert_text, txt_skob_o |
||
78 | stdcall insert_text_prop, [obj],[p_hi] |
||
79 | stdcall insert_text, txt_shl_16 |
||
80 | stdcall insert_text, txt_skob_c |
||
81 | stdcall insert_text, txt_plus |
||
82 | stdcall insert_text_prop, [obj],[p_lo] |
||
83 | ret |
||
84 | endp |
||
85 | |||
1727 | IgorA | 86 | ;вставляем строку вида: |
1720 | IgorA | 87 | ; txt_(n) db (s) |
88 | align 4 |
||
89 | proc insert_text_label_data, obj:dword, col:dword |
||
90 | push eax edx |
||
91 | mov eax,[obj] |
||
92 | stdcall insert_text, txt_txt |
||
3465 | IgorA | 93 | mov edx,file_name |
1720 | IgorA | 94 | stdcall get_obj_id_str, eax,edx ;edx = 'n' |
95 | stdcall str_cat, edx,txt_db ;edx = 'n db ' |
||
96 | stdcall insert_text, edx |
||
97 | stdcall insert_text_prop, eax,[col] |
||
98 | insert_nl |
||
99 | pop edx eax |
||
100 | ret |
||
101 | endp |
||
102 | |||
1698 | IgorA | 103 | macro insert_tab |
104 | { |
||
105 | stdcall [ted_text_add], tedit0,txt_tab,1,ted_opt_ed_move_cursor |
||
106 | } |
||
107 | macro insert_br |
||
108 | { |
||
109 | stdcall [ted_text_add], tedit0,txt_br,3,ted_opt_ed_move_cursor |
||
110 | } |
||
111 | macro insert_a_met |
||
112 | { |
||
113 | stdcall [ted_text_add], tedit0,txt_a_met,3,ted_opt_ed_move_cursor |
||
114 | } |
||
115 | macro insert_0 |
||
116 | { |
||
117 | stdcall [ted_text_add], tedit0,txt_0,1,ted_opt_ed_move_cursor |
||
118 | } |
||
119 | macro insert_plus |
||
120 | { |
||
121 | stdcall [ted_text_add], tedit0,txt_plus,1,ted_opt_ed_move_cursor |
||
122 | } |
||
123 | macro insert_xor |
||
124 | { |
||
125 | stdcall [ted_text_add], tedit0,txt_xor,4,ted_opt_ed_move_cursor |
||
126 | } |
||
127 | macro insert_cmp |
||
128 | { |
||
129 | stdcall [ted_text_add], tedit0,txt_cmp,4,ted_opt_ed_move_cursor |
||
130 | } |
||
131 | macro insert_reg reg_name |
||
132 | { |
||
133 | stdcall [ted_text_add], tedit0,reg_name,3,ted_opt_ed_move_cursor |
||
134 | } |
||
135 | macro insert_reg8 reg_name |
||
136 | { |
||
137 | stdcall [ted_text_add], tedit0,reg_name,2,ted_opt_ed_move_cursor |
||
138 | } |
||
139 | |||
140 | ; |
||
141 | macro insert_key_beg |
||
142 | { |
||
143 | stdcall [ted_text_add], tedit0,txt_key_1,txt_key_2-txt_key_1,ted_opt_ed_move_cursor |
||
144 | } |
||
145 | macro insert_key_end |
||
146 | { |
||
147 | stdcall [ted_text_add], tedit0,txt_key_2,txt_key_3-txt_key_2,ted_opt_ed_move_cursor |
||
148 | } |
||
149 | |||
150 | macro insert_d_poi |
||
151 | { |
||
152 | stdcall [ted_text_add], tedit0,txt_d_poi,1,ted_opt_ed_move_cursor |
||
153 | } |
||
154 | macro insert_ret |
||
155 | { |
||
156 | stdcall [ted_text_add], tedit0,txt_ret,4,ted_opt_ed_move_cursor |
||
157 | } |
||
158 | |||
159 | |||
160 | align 4 |
||
1711 | IgorA | 161 | but_update: |
162 | call draw_constructor |
||
1727 | IgorA | 163 | cmp byte[show_mode],0 ;условие видимости окна конструктора |
1711 | IgorA | 164 | jne @f |
165 | stdcall [buf2d_draw], buf_fon |
||
166 | @@: |
||
1698 | IgorA | 167 | call code_gen |
1727 | IgorA | 168 | cmp byte[show_mode],1 ;условие видимости текстового окна |
1698 | IgorA | 169 | jne @f |
170 | stdcall [ted_draw], tedit0 |
||
171 | @@: |
||
172 | ret |
||
173 | |||
1727 | IgorA | 174 | ;функция создающая код всего файла |
1698 | IgorA | 175 | align 4 |
176 | code_gen: |
||
177 | stdcall [ted_clear], tedit0,1 |
||
178 | pushad |
||
179 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
180 | pop esi |
||
181 | xor bl,bl |
||
182 | call code_gen_obj |
||
183 | stdcall [ted_text_add], tedit0,\ |
||
1727 | IgorA | 184 | txt_nl,1,ted_opt_ed_move_cursor+ted_opt_ed_change_time ;добавляем символ новой строки с опцией ted_opt_ed_change_time для возможности сохранения файла |
185 | stdcall [ted_init_scroll_bars], tedit0, 4 ;меняем размеры скроллингов |
||
1698 | IgorA | 186 | popad |
187 | ret |
||
188 | |||
189 | ;input: |
||
1727 | IgorA | 190 | ; bl - уровень объекта |
191 | ; esi - указатель на узел |
||
1698 | IgorA | 192 | align 4 |
193 | code_gen_obj: |
||
1732 | IgorA | 194 | push eax ebx edx |
1698 | IgorA | 195 | .beg_iterat: |
196 | cmp esi,0 |
||
197 | je .find_no |
||
198 | |||
199 | cmp byte[esi+2],bl ;lev |
||
200 | jl .find_no |
||
201 | |||
202 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 203 | pop eax ;получаем данные узла |
1698 | IgorA | 204 | cmp eax,0 |
205 | je .find_no |
||
206 | |||
1717 | IgorA | 207 | cmp dword[eax],C_STR |
1720 | IgorA | 208 | jne .no_struct |
1727 | IgorA | 209 | stdcall get_obj_text_col, eax,1 ;edx - указатель на 1-е свойство структуры |
1720 | IgorA | 210 | stdcall insert_text,txt_struc |
211 | cmp byte[edx],0 |
||
212 | jne @f |
||
213 | stdcall insert_text,txt_t |
||
214 | @@: |
||
215 | insert_sp |
||
1717 | IgorA | 216 | stdcall insert_text_prop, eax,0 |
1720 | IgorA | 217 | |
218 | cmp byte[edx],0 |
||
219 | je @f |
||
1727 | IgorA | 220 | ;если структура задана макросом |
1720 | IgorA | 221 | insert_sp |
222 | stdcall insert_text_prop, eax,1 |
||
223 | insert_nl |
||
224 | stdcall insert_text, txt_skob_fo |
||
225 | @@: |
||
1717 | IgorA | 226 | insert_nl |
1732 | IgorA | 227 | stdcall get_code_children_objects, esi |
228 | call move_next_no_child_objects ;пропуск дочерних обектов |
||
1720 | IgorA | 229 | cmp byte[edx],0 |
230 | je @f |
||
1727 | IgorA | 231 | ;если структура задана макросом |
1720 | IgorA | 232 | stdcall insert_text, txt_skob_fc |
233 | insert_nl |
||
234 | @@: |
||
1717 | IgorA | 235 | stdcall insert_text,txt_ends |
1720 | IgorA | 236 | .no_struct: |
1717 | IgorA | 237 | cmp dword[eax],C_TXT |
1698 | IgorA | 238 | jne @f |
1727 | IgorA | 239 | stdcall get_code_text,eax ;обработка объекта |
1698 | IgorA | 240 | @@: |
1717 | IgorA | 241 | cmp dword[eax],C_INC |
1698 | IgorA | 242 | jne @f |
1727 | IgorA | 243 | stdcall get_code_incl,eax ;обработка объекта |
1698 | IgorA | 244 | @@: |
1717 | IgorA | 245 | cmp dword[eax],C_VAR |
1698 | IgorA | 246 | jne @f |
1727 | IgorA | 247 | stdcall get_code_variable,eax,ebx ;обработка объекта |
1698 | IgorA | 248 | @@: |
1717 | IgorA | 249 | cmp dword[eax],C_WND |
1698 | IgorA | 250 | jne @f |
1727 | IgorA | 251 | stdcall get_code_window,eax ;обработка объекта |
1732 | IgorA | 252 | stdcall get_code_children_objects, esi ;обработка дочерних обектов |
253 | call move_next_no_child_objects ;пропуск дочерних обектов |
||
254 | stdcall insert_text, txt_draw_we ;код завершающий функцию рисования |
||
1698 | IgorA | 255 | @@: |
1717 | IgorA | 256 | cmp dword[eax],C_ACO |
1698 | IgorA | 257 | jne @f |
1732 | IgorA | 258 | stdcall get_code_auto,esi ;обработка объекта |
259 | call move_next_no_child_objects ;пропуск дочерних обектов |
||
1698 | IgorA | 260 | @@: |
1727 | IgorA | 261 | cmp dword[eax],C_KEY ;клавиатура |
1698 | IgorA | 262 | jne @f |
1727 | IgorA | 263 | stdcall get_code_key,eax ;обработка объекта |
1698 | IgorA | 264 | @@: |
265 | |||
266 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 267 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 268 | |
269 | jmp .beg_iterat |
||
270 | .find_no: |
||
1732 | IgorA | 271 | pop edx ebx eax |
1698 | IgorA | 272 | ret |
273 | |||
1732 | IgorA | 274 | ;взять коды дочерних объектов |
275 | align 4 |
||
276 | proc get_code_children_objects, p_node:dword |
||
277 | push ebx esi |
||
278 | mov esi,[p_node] |
||
279 | mov bl,byte[esi+2] ;сохраняем уровень текущего объекта |
||
280 | |||
281 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
282 | pop esi ;переходим к следущему узлу |
||
283 | cmp esi,0 ;если достигли конца списка объектов |
||
284 | je @f |
||
285 | cmp byte[esi+2],bl ;если уровень следующего объекта больше или равен текущему |
||
286 | jle @f ;то дочерних узлов нет |
||
287 | mov bl,byte[esi+2] |
||
288 | call code_gen_obj ;рекурсивный вызов дочерних объектов |
||
289 | @@: |
||
290 | pop esi ebx |
||
291 | ret |
||
292 | endp |
||
293 | |||
294 | ;пропуск всех дочерних объектов |
||
295 | ;input: |
||
296 | ; esi - указатель на узел |
||
297 | ;outpet: |
||
298 | ; esi - указатель следущий не дочерний (относительно входящего) на узел |
||
299 | align 4 |
||
300 | move_next_no_child_objects: |
||
301 | push eax ebx |
||
302 | mov bl,byte[esi+2] ;сохраняем уровень текущего объекта |
||
303 | @@: |
||
304 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
305 | pop eax ;переходим к следущему узлу |
||
306 | cmp eax,0 ;если достигли конца списка объектов |
||
307 | je @f |
||
308 | cmp byte[eax+2],bl ;если уровень следующего объекта больше или равен текущему |
||
309 | jle @f ;то дочерних узлов нет |
||
310 | mov esi,eax ;если следущий узел оказался дочерним, переставляем указатель |
||
311 | jmp @b |
||
312 | @@: |
||
313 | pop ebx eax |
||
314 | ret |
||
315 | |||
1727 | IgorA | 316 | ;добавление объекта с програмным кодом (текстом) |
1698 | IgorA | 317 | align 4 |
318 | proc get_code_text, p_obj:dword |
||
1717 | IgorA | 319 | ;pushad |
1698 | IgorA | 320 | insert_nl |
1717 | IgorA | 321 | stdcall insert_text_prop, dword[p_obj],0 |
1698 | IgorA | 322 | insert_nl |
1717 | IgorA | 323 | ;popad |
1698 | IgorA | 324 | ret |
325 | endp |
||
326 | |||
1727 | IgorA | 327 | ;обработка объекта создающего автоматичексие коды |
1698 | IgorA | 328 | align 4 |
1732 | IgorA | 329 | proc get_code_auto, p_node:dword |
1698 | IgorA | 330 | pushad |
331 | insert_nl |
||
1732 | IgorA | 332 | mov esi,dword[p_node] |
333 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
334 | pop ebx ;получаем данные узла |
||
335 | |||
1720 | IgorA | 336 | test_bool_prop ebx,BIT_MOD_ACI |
337 | jae @f |
||
338 | mov edx,C_CHB |
||
339 | stdcall find_obj_in_file,edx ;eax - указатель на структуру check_box |
||
340 | cmp eax,0 |
||
341 | je @f |
||
342 | stdcall insert_text, txt_std_init_cb |
||
343 | @@: |
||
1717 | IgorA | 344 | test_bool_prop ebx,BIT_MOD_ACM |
1698 | IgorA | 345 | jae @f |
1727 | IgorA | 346 | ;автоматические события от мыши |
1698 | IgorA | 347 | call get_code_auto_m |
348 | @@: |
||
1717 | IgorA | 349 | test_bool_prop ebx,BIT_MOD_ABU |
1698 | IgorA | 350 | jae @f |
1727 | IgorA | 351 | ;создание функции button |
1732 | IgorA | 352 | stdcall insert_text, txt_but_beg |
1727 | IgorA | 353 | call get_code_auto_but ;коды вызова кнопок |
1732 | IgorA | 354 | stdcall insert_text, txt_but_mid |
355 | stdcall get_code_children_objects, esi |
||
356 | ;конец функции button (кнопка id=-1, завершение программы) |
||
357 | stdcall insert_text, txt_but_end |
||
358 | |||
1727 | IgorA | 359 | call get_code_a_but_fun ;коды функций, вызываемых при нажатии кнопок |
1698 | IgorA | 360 | @@: |
1717 | IgorA | 361 | test_bool_prop ebx,BIT_MOD_ACD |
1698 | IgorA | 362 | jae @f |
363 | call get_code_auto_data_el |
||
1720 | IgorA | 364 | |
365 | mov edx,C_CHB |
||
366 | stdcall find_obj_in_file,edx ;eax - указатель на структуру check_box |
||
367 | cmp eax,0 |
||
368 | je .no_check |
||
369 | stdcall insert_text, txt_cb_b |
||
370 | call get_code_auto_data_el_cbox |
||
371 | stdcall insert_text, txt_cb_e |
||
372 | .no_check: |
||
373 | |||
1698 | IgorA | 374 | call get_code_auto_data_dop |
1706 | IgorA | 375 | |
1717 | IgorA | 376 | mov edx,C_LIB |
1727 | IgorA | 377 | stdcall find_obj_in_file,edx ;eax - указатель на структуру библиотеки |
1706 | IgorA | 378 | cmp eax,0 |
379 | je @f |
||
1720 | IgorA | 380 | insert_nl |
1706 | IgorA | 381 | stdcall insert_text, txt_head_i |
382 | stdcall insert_text, txt_d_poi |
||
383 | insert_nl |
||
384 | stdcall insert_text, txt_head_l |
||
385 | stdcall insert_text, txt_db |
||
386 | stdcall insert_text, txt_str_beg |
||
387 | stdcall insert_text, txt_sys_err |
||
388 | stdcall insert_text, txt_str_end |
||
389 | insert_nl |
||
390 | |||
391 | call get_code_auto_data_libs_param |
||
392 | stdcall insert_text, txt_ll_start |
||
393 | call get_code_auto_data_libs_struc |
||
394 | stdcall insert_text, txt_ll_end |
||
1727 | IgorA | 395 | call get_code_auto_data_libs ;таблицы импорта библиотек |
1698 | IgorA | 396 | @@: |
397 | insert_nl |
||
398 | popad |
||
399 | ret |
||
400 | endp |
||
401 | |||
402 | align 4 |
||
403 | proc get_code_auto_m |
||
404 | pushad |
||
405 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
406 | pop esi |
||
407 | .beg_iterat: |
||
408 | cmp esi,0 |
||
409 | je .find_no |
||
410 | |||
411 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 412 | pop ebx ;получаем данные узла |
1698 | IgorA | 413 | cmp ebx,0 |
414 | je .find_no |
||
415 | |||
1717 | IgorA | 416 | cmp dword[ebx],C_EDB |
1698 | IgorA | 417 | jne @f |
418 | stdcall insert_text, txt_std_mouse_ed |
||
1720 | IgorA | 419 | stdcall insert_text_prop, ebx,0 |
1698 | IgorA | 420 | insert_nl |
421 | @@: |
||
1717 | IgorA | 422 | cmp dword[ebx],C_CHB |
1698 | IgorA | 423 | jne @f |
424 | stdcall insert_text, txt_std_mouse_cb |
||
1720 | IgorA | 425 | stdcall insert_text_prop, ebx,0 |
1698 | IgorA | 426 | insert_nl |
427 | @@: |
||
428 | |||
429 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 430 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 431 | |
432 | jmp .beg_iterat |
||
433 | .find_no: |
||
434 | popad |
||
435 | ret |
||
436 | endp |
||
437 | |||
1727 | IgorA | 438 | ;создание данных (структур объектов) |
1698 | IgorA | 439 | align 4 |
440 | proc get_code_auto_data_el |
||
441 | pushad |
||
1727 | IgorA | 442 | insert_nl ;отступ для форматирования |
1698 | IgorA | 443 | |
444 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
445 | pop esi |
||
446 | .beg_iterat: |
||
447 | cmp esi,0 |
||
448 | je .find_no |
||
449 | |||
450 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 451 | pop ebx ;получаем данные узла |
1698 | IgorA | 452 | cmp ebx,0 |
453 | je .find_no |
||
454 | |||
1717 | IgorA | 455 | cmp dword[ebx],C_EDB |
1698 | IgorA | 456 | jne @f |
457 | ;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt |
||
1705 | IgorA | 458 | stdcall insert_text_prop, ebx,0 |
1698 | IgorA | 459 | stdcall insert_text, txt_ebox |
460 | |||
461 | mov ecx,1 |
||
462 | .prop: |
||
463 | insert_sp |
||
1705 | IgorA | 464 | stdcall insert_text_prop, ebx,ecx |
1698 | IgorA | 465 | insert_coma |
466 | inc ecx |
||
467 | cmp ecx,10 |
||
468 | jl .prop |
||
469 | |||
470 | insert_br |
||
471 | stdcall insert_text, txt_txt |
||
472 | |||
3465 | IgorA | 473 | mov edx,file_name |
1714 | IgorA | 474 | stdcall get_obj_id_str, ebx,edx |
1720 | IgorA | 475 | stdcall insert_text, edx |
1698 | IgorA | 476 | |
477 | stdcall insert_text, txt_mouse_dd |
||
1711 | IgorA | 478 | |
1727 | IgorA | 479 | stdcall insert_text, txt_0 ;свойства editbox |
480 | stdcall insert_bit_prop, ebx,BIT_MOD_EDIT_FOC |
||
481 | stdcall insert_bit_prop, ebx,BIT_MOD_EDIT_FIO |
||
482 | |||
483 | xchg eax,edx ;сохраняем значение edx |
||
1711 | IgorA | 484 | stdcall get_obj_text_col,ebx,10 |
1727 | IgorA | 485 | cmp byte[edx],0 ;проверяем пустая ли строка при запуске editbox |
1711 | IgorA | 486 | je .null_string |
1727 | IgorA | 487 | xchg eax,edx ;востанавливаем значение edx |
1711 | IgorA | 488 | stdcall insert_text, txt_coma |
489 | |||
490 | stdcall insert_text, txt_txt |
||
1727 | IgorA | 491 | stdcall insert_text, edx |
492 | stdcall insert_text, txt_met_end |
||
493 | stdcall insert_text, txt_minus |
||
1711 | IgorA | 494 | stdcall insert_text, txt_txt |
1727 | IgorA | 495 | stdcall insert_text, edx |
496 | stdcall insert_text, txt_minus |
||
1711 | IgorA | 497 | stdcall insert_text, txt_1 |
498 | stdcall insert_text, txt_coma |
||
499 | |||
500 | stdcall insert_text, txt_txt |
||
1727 | IgorA | 501 | stdcall insert_text, edx |
502 | stdcall insert_text, txt_met_end |
||
503 | stdcall insert_text, txt_minus |
||
1711 | IgorA | 504 | stdcall insert_text, txt_txt |
1727 | IgorA | 505 | stdcall insert_text, edx |
506 | stdcall insert_text, txt_minus |
||
1711 | IgorA | 507 | stdcall insert_text, txt_1 |
508 | .null_string: |
||
1698 | IgorA | 509 | insert_nl |
510 | @@: |
||
1717 | IgorA | 511 | cmp dword[ebx],C_DTT |
1711 | IgorA | 512 | jne @f |
1720 | IgorA | 513 | stdcall insert_text_label_data, ebx,0 |
514 | @@: |
||
515 | |||
516 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 517 | pop esi ;переходим к следущему узлу |
1720 | IgorA | 518 | |
519 | jmp .beg_iterat |
||
520 | .find_no: |
||
521 | popad |
||
522 | ret |
||
523 | endp |
||
524 | |||
525 | align 4 |
||
526 | proc get_code_auto_data_el_cbox |
||
527 | pushad |
||
1727 | IgorA | 528 | insert_nl ;отступ для форматирования |
1720 | IgorA | 529 | |
530 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
531 | pop esi |
||
532 | .beg_iterat: |
||
533 | cmp esi,0 |
||
534 | je .find_no |
||
535 | |||
536 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 537 | pop ebx ;получаем данные узла |
1720 | IgorA | 538 | cmp ebx,0 |
539 | je .find_no |
||
540 | |||
541 | cmp dword[ebx],C_CHB |
||
542 | jne .no_check |
||
543 | ;1,2,3,4,5, 6,7,8, 9 - ot_x,ot_y,w,h,ot_w_txt, col_fon,col_frame,col_txt, txt |
||
544 | |||
545 | stdcall insert_text_prop, ebx,0 |
||
546 | stdcall insert_text, txt_cbox |
||
547 | insert_sp |
||
548 | |||
549 | stdcall insert_2_prop_16_bit, ebx,1,3 |
||
550 | stdcall insert_text, txt_coma |
||
551 | stdcall insert_2_prop_16_bit, ebx,2,4 |
||
552 | stdcall insert_text, txt_coma |
||
553 | |||
554 | stdcall insert_text_prop, ebx,5 |
||
555 | stdcall insert_text, txt_coma |
||
556 | insert_sp |
||
557 | |||
558 | stdcall insert_text_prop, ebx,6 |
||
559 | stdcall insert_text, txt_coma |
||
560 | stdcall insert_text_prop, ebx,7 |
||
561 | stdcall insert_text, txt_coma |
||
562 | stdcall insert_text_prop, ebx,8 |
||
563 | stdcall insert_text, txt_coma |
||
564 | stdcall insert_text, txt_br |
||
565 | |||
1711 | IgorA | 566 | stdcall insert_text, txt_txt |
3465 | IgorA | 567 | mov edx,file_name |
1714 | IgorA | 568 | stdcall get_obj_id_str, ebx,edx |
1720 | IgorA | 569 | stdcall insert_text, edx |
570 | stdcall insert_text, txt_coma |
||
571 | |||
1727 | IgorA | 572 | ;флаги |
1720 | IgorA | 573 | stdcall insert_text,txt_0 |
1727 | IgorA | 574 | stdcall insert_bit_prop, ebx,BIT_MOD_CHE |
575 | stdcall insert_bit_prop, ebx,BIT_MOD_CHE_T |
||
576 | stdcall insert_bit_prop, ebx,BIT_MOD_CHE_M |
||
577 | stdcall insert_bit_prop, ebx,BIT_MOD_CHE_B |
||
1720 | IgorA | 578 | |
1711 | IgorA | 579 | insert_nl |
1720 | IgorA | 580 | .no_check: |
581 | cmp dword[ebx],C_DTT |
||
582 | jne @f |
||
583 | stdcall insert_text_label_data, ebx,0 |
||
1711 | IgorA | 584 | @@: |
1698 | IgorA | 585 | |
586 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 587 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 588 | |
589 | jmp .beg_iterat |
||
590 | .find_no: |
||
591 | popad |
||
592 | ret |
||
593 | endp |
||
594 | |||
1727 | IgorA | 595 | ;данные для библиотек |
1705 | IgorA | 596 | align 4 |
1706 | IgorA | 597 | proc get_code_auto_data_libs_param |
598 | pushad |
||
1727 | IgorA | 599 | insert_nl ;отступ для форматирования |
1706 | IgorA | 600 | |
601 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
602 | pop esi |
||
603 | .beg_iterat: |
||
604 | cmp esi,0 |
||
605 | je .find_no |
||
606 | |||
607 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 608 | pop ebx ;получаем данные узла |
1706 | IgorA | 609 | cmp ebx,0 |
610 | je .find_no |
||
611 | |||
1717 | IgorA | 612 | cmp dword[ebx],C_LIB |
1706 | IgorA | 613 | jne @f |
614 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
615 | |||
616 | stdcall insert_text, txt_sys_dir |
||
617 | ;object code |
||
3465 | IgorA | 618 | mov edx,file_name |
1714 | IgorA | 619 | stdcall get_obj_id_str, ebx,edx |
1706 | IgorA | 620 | stdcall insert_text,edx |
621 | stdcall insert_text,txt_db |
||
622 | ;stdcall insert_text, txt_str_beg |
||
623 | stdcall insert_text_prop, ebx,1 |
||
624 | ;stdcall insert_text, txt_str_end |
||
625 | insert_nl |
||
626 | |||
627 | stdcall insert_text, txt_lib_name |
||
628 | stdcall insert_text,edx |
||
629 | stdcall insert_text,txt_db |
||
630 | stdcall insert_text, txt_str_beg |
||
631 | stdcall insert_text_prop, ebx,0 |
||
632 | stdcall insert_text, txt_str_end |
||
633 | insert_nl |
||
634 | |||
635 | stdcall insert_text,txt_err_m_f_lib |
||
636 | stdcall insert_text,edx |
||
637 | stdcall insert_text,txt_db |
||
638 | stdcall insert_text, txt_str_beg |
||
639 | stdcall insert_text_prop, ebx,4 |
||
640 | stdcall insert_text, txt_str_end |
||
641 | insert_nl |
||
642 | |||
643 | stdcall insert_text,txt_err_m_i_lib |
||
644 | stdcall insert_text,edx |
||
645 | stdcall insert_text,txt_db |
||
646 | stdcall insert_text, txt_str_beg |
||
647 | stdcall insert_text_prop, ebx,5 |
||
648 | stdcall insert_text, txt_str_end |
||
649 | insert_nl |
||
650 | |||
651 | insert_nl |
||
652 | @@: |
||
653 | |||
654 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 655 | pop esi ;переходим к следущему узлу |
1706 | IgorA | 656 | |
657 | jmp .beg_iterat |
||
658 | .find_no: |
||
659 | popad |
||
660 | ret |
||
661 | endp |
||
662 | |||
1727 | IgorA | 663 | ;данные для библиотек |
1706 | IgorA | 664 | align 4 |
665 | proc get_code_auto_data_libs_struc |
||
666 | pushad |
||
1727 | IgorA | 667 | ;insert_nl ;отступ для форматирования |
1706 | IgorA | 668 | |
669 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
670 | pop esi |
||
671 | .beg_iterat: |
||
672 | cmp esi,0 |
||
673 | je .find_no |
||
674 | |||
675 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 676 | pop ebx ;получаем данные узла |
1706 | IgorA | 677 | cmp ebx,0 |
678 | je .find_no |
||
679 | |||
1717 | IgorA | 680 | cmp dword[ebx],C_LIB |
1706 | IgorA | 681 | jne @f |
682 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
683 | |||
684 | stdcall insert_text, txt_lib |
||
685 | ;object code |
||
3465 | IgorA | 686 | mov edx,file_name |
1714 | IgorA | 687 | stdcall get_obj_id_str, ebx,edx |
1706 | IgorA | 688 | stdcall insert_text,edx |
689 | insert_sp |
||
690 | stdcall insert_text, txt_ll |
||
691 | stdcall insert_text, txt_lib_name |
||
692 | stdcall insert_text,edx |
||
693 | stdcall insert_text,txt_coma |
||
694 | |||
695 | stdcall insert_text, txt_lib_path |
||
696 | |||
697 | stdcall insert_text, txt_sys_dir |
||
698 | stdcall insert_text,edx |
||
699 | stdcall insert_text,txt_coma |
||
700 | stdcall insert_text,txt_br |
||
701 | stdcall insert_text,txt_tab |
||
702 | |||
703 | stdcall insert_text,txt_err_m_f_lib |
||
704 | stdcall insert_text,edx |
||
705 | stdcall insert_text,txt_coma |
||
706 | stdcall insert_text,txt_head_l |
||
707 | stdcall insert_text,txt_coma |
||
708 | |||
709 | stdcall insert_text_prop, ebx,2 |
||
710 | stdcall insert_text,txt_coma |
||
711 | |||
712 | stdcall insert_text,txt_err_m_i_lib |
||
713 | stdcall insert_text,edx |
||
714 | stdcall insert_text,txt_coma |
||
715 | stdcall insert_text,txt_head_i |
||
716 | |||
717 | insert_nl |
||
718 | @@: |
||
719 | |||
720 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 721 | pop esi ;переходим к следущему узлу |
1706 | IgorA | 722 | |
723 | jmp .beg_iterat |
||
724 | .find_no: |
||
725 | popad |
||
726 | ret |
||
727 | endp |
||
728 | |||
1727 | IgorA | 729 | ;данные для библиотек |
1706 | IgorA | 730 | align 4 |
1705 | IgorA | 731 | proc get_code_auto_data_libs |
732 | pushad |
||
1727 | IgorA | 733 | insert_nl ;отступ для форматирования |
1705 | IgorA | 734 | |
735 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
736 | pop esi |
||
737 | .beg_iterat: |
||
738 | cmp esi,0 |
||
739 | je .find_no |
||
740 | |||
741 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 742 | pop ebx ;получаем данные узла |
1705 | IgorA | 743 | cmp ebx,0 |
744 | je .find_no |
||
745 | |||
1717 | IgorA | 746 | cmp dword[ebx],C_LIB |
1705 | IgorA | 747 | jne @f |
748 | ;0,1,2,3,4,5 - l_nam,s_dir,i_met,... |
||
749 | stdcall insert_text, txt_align_4 |
||
750 | stdcall insert_text_prop, ebx,2 |
||
751 | stdcall insert_text, txt_d_poi |
||
752 | insert_nl |
||
753 | |||
754 | call get_code_lib_table |
||
755 | @@: |
||
756 | |||
757 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 758 | pop esi ;переходим к следущему узлу |
1705 | IgorA | 759 | |
760 | jmp .beg_iterat |
||
761 | .find_no: |
||
762 | popad |
||
763 | ret |
||
764 | endp |
||
765 | |||
766 | ;input: |
||
767 | ; esi |
||
768 | align 4 |
||
769 | get_code_lib_table: |
||
770 | pushad |
||
771 | mov bl,byte[esi+2] |
||
772 | mov edi,esi |
||
773 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 774 | pop edx ;получение данных родительского объекта |
1705 | IgorA | 775 | cmp edx,0 |
776 | je @f |
||
777 | @@: |
||
778 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 779 | pop esi ;переходим к следущему узлу |
1705 | IgorA | 780 | cmp esi,0 |
781 | je @f |
||
782 | cmp byte[esi+2],bl ;lev |
||
783 | jle @f |
||
784 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 785 | pop ecx ;получаем данные узла |
1705 | IgorA | 786 | cmp ecx,0 |
787 | je @f |
||
1717 | IgorA | 788 | cmp dword[ecx],C_IFN |
1705 | IgorA | 789 | jne @b |
1727 | IgorA | 790 | ;вставка указателя на функцию |
1720 | IgorA | 791 | test_bool_prop ecx,BIT_MOD_IMPORT_FUNCT_COMMENT |
792 | jae .no_com_0 |
||
793 | stdcall insert_text, txt_com |
||
794 | .no_com_0: |
||
1705 | IgorA | 795 | insert_tab |
796 | stdcall insert_text_prop, ecx,0 |
||
797 | stdcall insert_text, txt_dd |
||
1727 | IgorA | 798 | stdcall insert_text_prop, edx,3 ;приставка к функции |
1705 | IgorA | 799 | stdcall insert_text_prop, ecx,0 |
800 | insert_nl |
||
801 | jmp @b |
||
802 | @@: |
||
803 | stdcall insert_text, txt_dd_0_0 |
||
804 | mov esi,edi |
||
805 | @@: |
||
806 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 807 | pop esi ;переходим к следущему узлу |
1705 | IgorA | 808 | cmp esi,0 |
809 | je @f |
||
810 | cmp byte[esi+2],bl ;lev |
||
811 | jle @f |
||
812 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 813 | pop ecx ;получаем данные узла |
1705 | IgorA | 814 | cmp ecx,0 |
815 | je @f |
||
1717 | IgorA | 816 | cmp dword[ecx],C_IFN |
1705 | IgorA | 817 | jne @b |
1727 | IgorA | 818 | ;вставка имени импортированной функции |
1720 | IgorA | 819 | test_bool_prop ecx,BIT_MOD_IMPORT_FUNCT_COMMENT |
820 | jae .no_com_1 |
||
821 | stdcall insert_text, txt_com |
||
822 | .no_com_1: |
||
1705 | IgorA | 823 | insert_tab |
1727 | IgorA | 824 | stdcall insert_text_prop, edx,3 ;приставка к функции |
1705 | IgorA | 825 | stdcall insert_text_prop, ecx,0 |
826 | stdcall insert_text, txt_db |
||
827 | stdcall insert_text, txt_str_beg |
||
828 | stdcall insert_text_prop, ecx,1 |
||
829 | stdcall insert_text, txt_str_end |
||
830 | insert_nl |
||
831 | jmp @b |
||
832 | @@: |
||
833 | popad |
||
834 | ret |
||
835 | |||
1698 | IgorA | 836 | ; |
837 | align 4 |
||
838 | proc get_code_auto_data_dop |
||
839 | pushad |
||
1727 | IgorA | 840 | insert_nl ;отступ для форматирования |
1698 | IgorA | 841 | |
842 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
843 | pop esi |
||
844 | .beg_iterat: |
||
845 | cmp esi,0 |
||
846 | je .find_no |
||
847 | |||
848 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 849 | pop ebx ;получаем данные узла |
1698 | IgorA | 850 | cmp ebx,0 |
851 | je .find_no |
||
852 | |||
1717 | IgorA | 853 | cmp dword[ebx],C_EDB |
1698 | IgorA | 854 | jne @f |
855 | ;1,2,3,4,...,6,...8,...,10 - w,x,y,col_fon,...,col_frame,...,col_txt,...,txt |
||
1727 | IgorA | 856 | |
857 | ;формируем текстовые данные для editbox-ов |
||
1698 | IgorA | 858 | stdcall insert_text, txt_txt |
3465 | IgorA | 859 | mov edx,file_name |
1714 | IgorA | 860 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 861 | stdcall insert_text,edx |
1698 | IgorA | 862 | |
1711 | IgorA | 863 | stdcall get_obj_text_col,ebx,10 |
864 | cmp byte[edx],0 |
||
865 | je .no_text |
||
866 | stdcall insert_text, txt_d_poi |
||
867 | stdcall insert_text, txt_db |
||
868 | stdcall insert_text, txt_str_beg |
||
869 | stdcall str_len,edx |
||
870 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
871 | stdcall insert_text, txt_str_end |
||
872 | insert_nl |
||
1698 | IgorA | 873 | |
1711 | IgorA | 874 | insert_tab |
875 | stdcall insert_text, txt_met_end |
||
876 | stdcall insert_text, txt_rb |
||
877 | stdcall insert_text, txt_txt |
||
3465 | IgorA | 878 | mov edx,file_name |
1714 | IgorA | 879 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 880 | stdcall insert_text,edx |
881 | |||
882 | stdcall insert_text, txt_minus |
||
883 | stdcall insert_text, txt_txt |
||
884 | stdcall insert_text,edx |
||
885 | stdcall insert_text, txt_met_end |
||
886 | |||
887 | insert_plus |
||
888 | stdcall insert_text_prop,ebx,9 |
||
889 | insert_plus |
||
890 | stdcall insert_text, txt_3 |
||
891 | |||
892 | insert_nl |
||
893 | |||
894 | jmp @f |
||
895 | |||
1727 | IgorA | 896 | .no_text: ;первоначально текст не задан |
1711 | IgorA | 897 | stdcall insert_text, txt_times |
898 | |||
899 | stdcall insert_text_prop,ebx,9 |
||
900 | insert_plus |
||
901 | stdcall insert_text, txt_2 |
||
902 | stdcall insert_text, txt_db |
||
903 | insert_0 |
||
904 | insert_nl |
||
1698 | IgorA | 905 | @@: |
1720 | IgorA | 906 | cmp dword[ebx],C_CHB |
907 | jne @f |
||
908 | stdcall insert_text_label_data, ebx,9 |
||
909 | @@: |
||
1698 | IgorA | 910 | |
911 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 912 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 913 | |
914 | jmp .beg_iterat |
||
915 | .find_no: |
||
916 | popad |
||
917 | ret |
||
918 | endp |
||
919 | |||
1727 | IgorA | 920 | ;связываем кнопки с функциями |
1698 | IgorA | 921 | align 4 |
922 | proc get_code_auto_but |
||
923 | pushad |
||
924 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
925 | pop esi |
||
926 | .beg_iterat: |
||
927 | cmp esi,0 |
||
928 | je .find_no |
||
929 | |||
930 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 931 | pop ebx ;получаем данные узла |
1698 | IgorA | 932 | cmp ebx,0 |
933 | je .find_no |
||
934 | |||
1717 | IgorA | 935 | cmp dword[ebx],C_BUT |
1698 | IgorA | 936 | jne @f |
937 | insert_tab |
||
938 | insert_cmp |
||
939 | insert_reg8 txt_ah |
||
940 | insert_coma |
||
941 | stdcall get_obj_text_col,ebx,0 |
||
942 | stdcall str_len,edx |
||
943 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
944 | insert_nl |
||
945 | insert_tab |
||
946 | stdcall insert_text, txt_jne_f |
||
947 | insert_nl |
||
948 | insert_tab |
||
949 | insert_tab |
||
950 | stdcall insert_text, txt_call |
||
951 | stdcall get_obj_text_col,ebx,6 |
||
952 | stdcall str_len,edx |
||
953 | cmp eax,1 |
||
954 | jl .c_fun |
||
955 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
956 | .c_fun: |
||
957 | insert_nl |
||
958 | insert_tab |
||
959 | insert_a_met ;@@: |
||
960 | insert_nl |
||
961 | @@: |
||
962 | |||
963 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 964 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 965 | |
966 | jmp .beg_iterat |
||
967 | .find_no: |
||
968 | popad |
||
969 | ret |
||
970 | endp |
||
971 | |||
1727 | IgorA | 972 | ;берем коды для функций нажатий на кнопки |
1698 | IgorA | 973 | align 4 |
974 | proc get_code_a_but_fun |
||
975 | pushad |
||
976 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
977 | pop esi |
||
978 | .beg_iterat: |
||
979 | cmp esi,0 |
||
980 | je .find_no |
||
981 | |||
982 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 983 | pop ebx ;получаем данные узла |
1698 | IgorA | 984 | cmp ebx,0 |
985 | je .find_no |
||
986 | |||
1717 | IgorA | 987 | cmp dword[ebx],C_BUT |
1698 | IgorA | 988 | jne @f |
989 | stdcall get_obj_text_col,ebx,6 |
||
990 | stdcall str_len,edx |
||
991 | cmp eax,1 |
||
992 | jl .c_fun |
||
993 | insert_nl |
||
994 | stdcall insert_text, txt_align_4 |
||
995 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
996 | insert_d_poi |
||
997 | insert_nl |
||
998 | insert_tab |
||
999 | insert_ret |
||
1000 | .c_fun: |
||
1001 | @@: |
||
1002 | |||
1003 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 1004 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 1005 | |
1006 | jmp .beg_iterat |
||
1007 | .find_no: |
||
1008 | popad |
||
1009 | ret |
||
1010 | endp |
||
1011 | |||
1012 | align 4 |
||
1013 | proc get_code_key, p_obj:dword |
||
1014 | pushad |
||
1015 | insert_nl |
||
1016 | mov ebx,dword[p_obj] |
||
1017 | |||
1018 | insert_key_beg |
||
1727 | IgorA | 1019 | call get_code_funct_key ;коды вызова кнопок |
1698 | IgorA | 1020 | insert_key_end |
1021 | |||
1022 | insert_nl |
||
1023 | popad |
||
1024 | ret |
||
1025 | endp |
||
1026 | |||
1027 | align 4 |
||
1028 | proc get_code_funct_key |
||
1029 | pushad |
||
1030 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
1031 | pop esi |
||
1032 | .beg_iterat: |
||
1033 | cmp esi,0 |
||
1034 | je .find_no |
||
1035 | |||
1036 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 1037 | pop ebx ;получаем данные узла |
1698 | IgorA | 1038 | cmp ebx,0 |
1039 | je .find_no |
||
1040 | |||
1717 | IgorA | 1041 | cmp dword[ebx],C_EDB |
1698 | IgorA | 1042 | jne @f |
1043 | stdcall insert_text, txt_std_key_ed |
||
1044 | stdcall insert_text_prop,ebx,0 |
||
1045 | insert_nl |
||
1046 | @@: |
||
1047 | |||
1048 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
||
1727 | IgorA | 1049 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 1050 | |
1051 | jmp .beg_iterat |
||
1052 | .find_no: |
||
1053 | popad |
||
1054 | ret |
||
1055 | endp |
||
1056 | |||
1727 | IgorA | 1057 | ;объекты подключения файлов 'include ...' |
1698 | IgorA | 1058 | align 4 |
1059 | proc get_code_incl, p_obj:dword |
||
1060 | pushad |
||
1061 | stdcall insert_text, txt_incl |
||
1062 | mov ebx,dword[p_obj] |
||
1063 | stdcall insert_text_prop,ebx,0 |
||
1064 | |||
1065 | stdcall get_obj_text_col,ebx,1 |
||
1066 | stdcall str_len,edx |
||
1067 | cmp eax,1 |
||
1068 | jl @f |
||
1069 | insert_sp |
||
1070 | insert_com |
||
1071 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
1072 | @@: |
||
1073 | |||
1074 | insert_nl |
||
1075 | popad |
||
1076 | ret |
||
1077 | endp |
||
1078 | |||
1727 | IgorA | 1079 | ;создаем код задания окна |
1698 | IgorA | 1080 | align 4 |
1081 | proc get_code_window, p_obj:dword |
||
1082 | pushad |
||
1083 | mov ebx,dword[p_obj] |
||
1084 | ;2,3,4,5,6 - x,y,w,h,col_bkg |
||
1085 | |||
1086 | stdcall insert_text, txt_draw_wb |
||
1087 | |||
1088 | insert_tab |
||
1089 | insert_xor |
||
1090 | insert_reg txt_eax |
||
1091 | insert_coma |
||
1092 | insert_reg txt_eax |
||
1093 | insert_nl |
||
1094 | |||
1904 | IgorA | 1095 | ;mov ebx,... задается ширина окна и отступ от левого края экрана |
1698 | IgorA | 1096 | insert_tab |
1097 | stdcall insert_text, txt_mov |
||
1098 | insert_reg txt_ebx |
||
1099 | insert_coma |
||
1720 | IgorA | 1100 | stdcall insert_2_prop_16_bit, ebx,2,4 |
1698 | IgorA | 1101 | insert_nl |
1102 | |||
1904 | IgorA | 1103 | ;mov ecx,... задается высота окна и отступ от верхнего края экрана |
1698 | IgorA | 1104 | insert_tab |
1105 | stdcall insert_text, txt_mov |
||
1106 | insert_reg txt_ecx |
||
1107 | insert_coma |
||
1720 | IgorA | 1108 | stdcall insert_2_prop_16_bit, ebx,3,5 |
1698 | IgorA | 1109 | insert_nl |
1110 | |||
1904 | IgorA | 1111 | ;mov edx,... задается цвет рабочей области окна |
1698 | IgorA | 1112 | insert_tab |
1113 | stdcall insert_text, txt_mov |
||
1114 | insert_reg txt_edx |
||
1115 | insert_coma |
||
1116 | stdcall insert_text_prop, ebx,6 |
||
1117 | insert_nl |
||
1118 | |||
1119 | ;or edx,0x33000000 |
||
1705 | IgorA | 1120 | insert_tab |
1698 | IgorA | 1121 | stdcall insert_text, txt_or |
1122 | insert_reg txt_edx |
||
1123 | insert_coma |
||
1904 | IgorA | 1124 | stdcall insert_text,txt_skob_o |
1125 | stdcall insert_text_prop, ebx,1 ;стиль окна |
||
1126 | stdcall insert_text,txt_shl_24 |
||
1127 | stdcall insert_text,txt_skob_c |
||
1128 | stdcall insert_bit_prop, ebx,BIT_MOD_WI_CAPT |
||
1129 | stdcall insert_bit_prop, ebx,BIT_MOD_WI_CORD_OTN_CL_OBL |
||
1130 | stdcall insert_bit_prop, ebx,BIT_MOD_WI_REDR |
||
1131 | stdcall insert_bit_prop, ebx,BIT_MOD_WI_GRAD |
||
1698 | IgorA | 1132 | insert_nl |
1133 | |||
1134 | ;mov edi,... |
||
1135 | insert_tab |
||
1136 | stdcall insert_text, txt_mov |
||
1137 | insert_reg txt_edi |
||
1138 | insert_coma |
||
1139 | stdcall insert_text_prop, ebx,0 |
||
1140 | insert_nl |
||
1141 | |||
1142 | insert_tab |
||
1143 | stdcall insert_text, txt_i_40 |
||
1705 | IgorA | 1144 | insert_nl |
1698 | IgorA | 1145 | |
1146 | call get_code_draw_obj |
||
1147 | popad |
||
1148 | ret |
||
1149 | endp |
||
1150 | |||
1151 | |||
1727 | IgorA | 1152 | ;формируем вызов функций для рисования объектов |
1698 | IgorA | 1153 | align 4 |
1154 | proc get_code_draw_obj |
||
1155 | pushad |
||
1156 | stdcall dword[tl_node_poi_get_info], 0,tree2 |
||
1157 | pop esi |
||
1158 | .beg_iterat: |
||
1159 | cmp esi,0 |
||
1160 | je .find_no |
||
1161 | |||
1162 | stdcall dword[tl_node_poi_get_data], esi,tree2 |
||
1727 | IgorA | 1163 | pop ebx ;получаем данные узла |
1698 | IgorA | 1164 | cmp ebx,0 |
1165 | je .find_no |
||
1166 | |||
1717 | IgorA | 1167 | cmp dword[ebx],C_EDB |
1698 | IgorA | 1168 | jne @f |
1169 | stdcall insert_text, txt_editb_draw |
||
1170 | stdcall insert_text_prop, ebx,0 |
||
1171 | insert_nl |
||
1172 | @@: |
||
1717 | IgorA | 1173 | cmp dword[ebx],C_CHB |
1698 | IgorA | 1174 | jne @f |
1175 | stdcall insert_text, txt_cbox_draw |
||
1176 | stdcall insert_text_prop, ebx,0 |
||
1177 | insert_nl |
||
1178 | @@: |
||
1717 | IgorA | 1179 | cmp dword[ebx],C_BUT |
1180 | jne .ob_draw_but |
||
1698 | IgorA | 1181 | insert_tab |
1182 | stdcall insert_text, txt_mov |
||
1183 | insert_reg txt_eax |
||
1184 | insert_coma |
||
1185 | stdcall insert_text, txt_8 |
||
1186 | insert_nl |
||
1187 | |||
1188 | insert_tab |
||
1189 | stdcall insert_text, txt_mov |
||
1190 | insert_reg txt_ebx |
||
1191 | insert_coma |
||
1720 | IgorA | 1192 | stdcall insert_2_prop_16_bit, ebx,1,3 |
1698 | IgorA | 1193 | insert_nl |
1194 | |||
1195 | insert_tab |
||
1196 | stdcall insert_text, txt_mov |
||
1197 | insert_reg txt_ecx |
||
1198 | insert_coma |
||
1720 | IgorA | 1199 | stdcall insert_2_prop_16_bit, ebx,2,4 |
1698 | IgorA | 1200 | insert_nl |
1201 | |||
1202 | insert_tab |
||
1203 | stdcall insert_text, txt_mov |
||
1204 | insert_reg txt_edx |
||
1205 | insert_coma |
||
1206 | stdcall insert_text_prop, ebx,0 |
||
1717 | IgorA | 1207 | test_bool_prop ebx,BIT_MOD_BUT_NFON |
1208 | jnc @f |
||
1209 | stdcall insert_text, txt_plus |
||
1210 | stdcall insert_text, txt_bit_30 |
||
1211 | @@: |
||
1212 | test_bool_prop ebx,BIT_MOD_BUT_NBORD |
||
1213 | jnc @f |
||
1214 | stdcall insert_text, txt_plus |
||
1215 | stdcall insert_text, txt_bit_29 |
||
1216 | @@: |
||
1698 | IgorA | 1217 | insert_nl |
1218 | |||
1219 | insert_tab |
||
1220 | stdcall insert_text, txt_mov |
||
1221 | insert_reg txt_esi |
||
1222 | insert_coma |
||
1223 | stdcall insert_text_prop, ebx,5 ;button color |
||
1224 | insert_nl |
||
1225 | |||
1226 | insert_tab |
||
1227 | stdcall insert_text, txt_i_40 |
||
1228 | insert_nl |
||
1717 | IgorA | 1229 | .ob_draw_but: |
1230 | cmp dword[ebx],C_REC |
||
1698 | IgorA | 1231 | jne @f |
1232 | insert_tab |
||
1233 | stdcall insert_text, txt_mov |
||
1234 | insert_reg txt_eax |
||
1235 | insert_coma |
||
1236 | stdcall insert_text, txt_1 |
||
1237 | stdcall insert_text, txt_3 |
||
1238 | insert_nl |
||
1239 | |||
1240 | insert_tab |
||
1241 | stdcall insert_text, txt_mov |
||
1242 | insert_reg txt_ebx |
||
1243 | insert_coma |
||
1720 | IgorA | 1244 | stdcall insert_2_prop_16_bit, ebx,1,3 |
1698 | IgorA | 1245 | insert_nl |
1246 | |||
1247 | insert_tab |
||
1248 | stdcall insert_text, txt_mov |
||
1249 | insert_reg txt_ecx |
||
1250 | insert_coma |
||
1720 | IgorA | 1251 | stdcall insert_2_prop_16_bit, ebx,2,4 |
1698 | IgorA | 1252 | insert_nl |
1253 | |||
1254 | insert_tab |
||
1255 | stdcall insert_text, txt_mov |
||
1256 | insert_reg txt_edx |
||
1257 | insert_coma |
||
1258 | stdcall insert_text_prop, ebx,0 ;rect color |
||
1259 | insert_nl |
||
1260 | |||
1261 | insert_tab |
||
1262 | stdcall insert_text, txt_i_40 |
||
1263 | insert_nl |
||
1264 | @@: |
||
1727 | IgorA | 1265 | cmp dword[ebx],C_DTT ;рисование текста через сист. ф. 4 |
1717 | IgorA | 1266 | jne .ob_draw_text |
1711 | IgorA | 1267 | insert_tab |
1268 | stdcall insert_text, txt_mov |
||
1269 | insert_reg txt_eax |
||
1270 | insert_coma |
||
1271 | stdcall insert_text, txt_4 |
||
1272 | insert_nl |
||
1698 | IgorA | 1273 | |
1711 | IgorA | 1274 | insert_tab |
1275 | stdcall insert_text, txt_mov |
||
1276 | insert_reg txt_ebx |
||
1277 | insert_coma |
||
1720 | IgorA | 1278 | stdcall insert_2_prop_16_bit, ebx,1,2 |
1711 | IgorA | 1279 | insert_nl |
1280 | |||
1281 | insert_tab |
||
1282 | stdcall insert_text, txt_mov |
||
1283 | insert_reg txt_ecx |
||
1284 | insert_coma |
||
1285 | stdcall insert_text_prop, ebx,3 |
||
1727 | IgorA | 1286 | stdcall insert_bit_prop, ebx,BIT_MOD_TXT_ASCII_0 ;31 - бит для строки ASCIIZ |
1287 | stdcall insert_bit_prop, ebx,BIT_MOD_TXT_NO_TRAN ;30 - бит для не прозрачного текста |
||
1288 | stdcall insert_bit_prop, ebx,BIT_MOD_TXT_CHAR2 ;28 - бит для 2-го сист. шрифта |
||
1711 | IgorA | 1289 | insert_nl |
1290 | |||
1291 | insert_tab |
||
1292 | stdcall insert_text, txt_mov |
||
1293 | insert_reg txt_edx |
||
1294 | insert_coma |
||
1295 | stdcall insert_text, txt_txt |
||
3465 | IgorA | 1296 | mov edx,file_name |
1714 | IgorA | 1297 | stdcall get_obj_id_str, ebx,edx |
1711 | IgorA | 1298 | stdcall insert_text,edx |
1299 | insert_nl |
||
1300 | |||
1301 | ;mov esi,... |
||
1717 | IgorA | 1302 | test_bool_prop ebx,BIT_MOD_TXT_NO_TRAN |
1303 | jnc @f |
||
1304 | insert_tab |
||
1305 | stdcall insert_text, txt_mov |
||
1306 | insert_reg txt_edi |
||
1307 | insert_coma |
||
1727 | IgorA | 1308 | stdcall insert_text_prop, ebx,4 ;цвет фона |
1717 | IgorA | 1309 | insert_nl |
1310 | @@: |
||
1711 | IgorA | 1311 | |
1312 | insert_tab |
||
1313 | stdcall insert_text, txt_i_40 |
||
1314 | insert_nl |
||
1717 | IgorA | 1315 | .ob_draw_text: |
1711 | IgorA | 1316 | |
1698 | IgorA | 1317 | stdcall dword[tl_node_poi_get_next_info], esi,tree2 |
1727 | IgorA | 1318 | pop esi ;переходим к следущему узлу |
1698 | IgorA | 1319 | |
1320 | jmp .beg_iterat |
||
1321 | .find_no: |
||
1322 | popad |
||
1323 | ret |
||
1324 | endp |
||
1325 | |||
1727 | IgorA | 1326 | ;создать код объявления переменной |
1698 | IgorA | 1327 | align 4 |
1328 | proc get_code_variable, p_obj:dword,o_lev:dword |
||
1329 | pushad |
||
1330 | mov ebx,dword[p_obj] |
||
1331 | ;0,1,2 - name,value,comment |
||
1332 | |||
1333 | mov ecx,dword[o_lev] |
||
1334 | cmp cl,0 |
||
1727 | IgorA | 1335 | je .no_tab ;избегаем зацикливания (0-1 = 2^32-1) |
1717 | IgorA | 1336 | and ecx,0xff |
1698 | IgorA | 1337 | cld |
1338 | @@: |
||
1727 | IgorA | 1339 | insert_tab ;формирование отступа перед переменной |
1698 | IgorA | 1340 | loop @b |
1341 | .no_tab: |
||
1342 | |||
1727 | IgorA | 1343 | stdcall insert_text_prop, ebx,0 ;имя переменной |
1698 | IgorA | 1344 | insert_sp |
1345 | |||
1727 | IgorA | 1346 | mov ecx,dword[ebx+u_object.typid-u_object] ;ecx - относительный индекс родительского объекта (в памяти) |
1698 | IgorA | 1347 | xor eax,eax |
1348 | mov ax,[tree2.info_size] |
||
1727 | IgorA | 1349 | imul ecx,eax ;умножаем индекс на размер структуры |
1350 | add ecx,[tree2.data_info] ;ecx - указатель данные родительского узла |
||
1698 | IgorA | 1351 | |
1727 | IgorA | 1352 | ;проверку на правильность ecx ??? |
1698 | IgorA | 1353 | |
1727 | IgorA | 1354 | stdcall insert_text_prop, ecx,0 ;тип переменной |
1698 | IgorA | 1355 | insert_sp |
1727 | IgorA | 1356 | stdcall insert_text_prop, ebx,1 ;значение |
1698 | IgorA | 1357 | |
1727 | IgorA | 1358 | stdcall get_obj_text_col,ebx,2 ;комментарий |
1698 | IgorA | 1359 | stdcall str_len,edx |
1360 | cmp eax,1 |
||
1361 | jl @f |
||
1362 | insert_sp |
||
1363 | insert_com |
||
1364 | stdcall [ted_text_add], tedit0,edx,eax,ted_opt_ed_move_cursor |
||
1365 | @@: |
||
1366 | insert_nl |
||
1367 | |||
1368 | popad |
||
1369 | ret |
||
1370 | endp |
||
1371 | |||
1372 | |||
1373 | |||
1727 | IgorA | 1374 | ;--- текстовые константы --- |
1705 | IgorA | 1375 | txt_str_beg db 39,0 |
1376 | txt_str_end db 39,',0',0 |
||
1698 | IgorA | 1377 | txt_coma db ',',0 |
1720 | IgorA | 1378 | txt_skob_o db '(',0 |
1379 | txt_skob_c db ')',0 |
||
1727 | IgorA | 1380 | txt_skob_fo db '{',0 ;скобка фигурная открывающая |
1381 | txt_skob_fc db '}',0 ;скобка фигурная закрывающая |
||
1698 | IgorA | 1382 | txt_i_40 db 'int 0x40',13,0 |
1383 | txt_0 db '0',0 |
||
1384 | txt_1 db '1',0 |
||
1385 | txt_2 db '2',0 |
||
1386 | txt_3 db '3',0 |
||
1387 | txt_4 db '4',0 |
||
1388 | txt_8 db '8',0 |
||
1389 | txt_plus db '+',0 |
||
1711 | IgorA | 1390 | txt_minus db '-',0 |
1391 | ;txt_dol db '$',0 |
||
1698 | IgorA | 1392 | txt_nl db 13,0 |
1393 | txt_com db ';',0 |
||
1394 | txt_sp db ' ',0 |
||
1395 | txt_tab db 9,0 |
||
1396 | txt_br db '\',13,9,0 |
||
1705 | IgorA | 1397 | txt_txt db 'txt_',0 |
1398 | txt_db db ' db ',0 |
||
1399 | txt_dd db ' dd ',0 |
||
1711 | IgorA | 1400 | txt_rb db ' rb ',0 |
1705 | IgorA | 1401 | txt_dd_0_0 db 9,'dd 0,0',13,0 |
1402 | txt_mouse_dd db ', mouse_dd, ',0 |
||
1403 | txt_times db ':',13,9,'times ',0 |
||
1698 | IgorA | 1404 | txt_draw_wb: |
1405 | db 13,'align 4',13,'draw_window:',13,'pushad',13,9,'mcall 12,1',13,0 |
||
1406 | txt_draw_we: |
||
1407 | db 9,'mcall 12,2',13,'popad',13,9,'ret',13,0 |
||
1706 | IgorA | 1408 | txt_sys_dir db 'system_dir_',0 |
1409 | txt_lib_name db 'lib_name_',0 |
||
1410 | txt_lib_path db ' sys_path, library_path, ',0 |
||
1411 | txt_sys_err db 'Системная ошибка',0 |
||
1412 | txt_ll_start db 'l_libs_start:',13,0 |
||
1413 | txt_lib db 9,'lib_',0 |
||
1414 | txt_ll db 'l_libs ',0 |
||
1415 | txt_err_m_f_lib db 'err_msg_found_lib_',0 |
||
1416 | txt_head_l db 'head_f_l',0 |
||
1417 | txt_err_m_i_lib db 'err_msg_import_',0 |
||
1418 | txt_head_i db 'head_f_i',0 |
||
1419 | txt_ll_end db 'l_libs_end:',13,0 |
||
1727 | IgorA | 1420 | ;txt_bit_28 db '0x10000000',0 |
1717 | IgorA | 1421 | txt_bit_29 db '0x20000000',0 |
1422 | txt_bit_30 db '0x40000000',0 |
||
1727 | IgorA | 1423 | ;txt_bit_31 db '0x80000000',0 |
1720 | IgorA | 1424 | txt_struc db 'struc',0 |
1425 | txt_t db 't',0 |
||
1711 | IgorA | 1426 | txt_met_end db '.end',0 |
1698 | IgorA | 1427 | txt_ends db 'ends',13,13,0 |
1428 | txt_mov db 'mov ',0 |
||
1429 | txt_xor db 'xor ',0 |
||
1430 | txt_or db 'or ',0 |
||
1431 | txt_cmp db 'cmp ',0 |
||
1432 | txt_call db 'call ',0 |
||
1433 | txt_jne_f db 'jne @f',0 |
||
1434 | txt_a_met db '@@:',0 |
||
1435 | txt_ah db 'ah',0 |
||
1436 | txt_eax db 'eax',0 |
||
1437 | txt_ebx db 'ebx',0 |
||
1438 | txt_ecx db 'ecx',0 |
||
1439 | txt_edx db 'edx',0 |
||
1440 | txt_edi db 'edi',0 |
||
1441 | txt_esi db 'esi',0 |
||
1442 | txt_align_4 db 'align 4',13,0 |
||
1443 | txt_d_poi db ':',0 |
||
1444 | txt_ret db 'ret',13,0 |
||
1720 | IgorA | 1445 | txt_shl_16 db ' shl 16',0 |
1904 | IgorA | 1446 | txt_shl_24 db ' shl 24',0 |
1698 | IgorA | 1447 | txt_std_mouse_ed: |
1448 | db 9,'stdcall [edit_box_mouse], ',0 |
||
1720 | IgorA | 1449 | txt_std_init_cb: |
1450 | db 9,'init_checkboxes2 check_boxes,check_boxes_end',13,0 |
||
1698 | IgorA | 1451 | txt_std_mouse_cb: |
1452 | db 9,'stdcall [check_box_mouse], ',0 |
||
1453 | txt_std_key_ed: |
||
1454 | db 9,'stdcall [edit_box_key], ',0 |
||
1455 | txt_incl: |
||
1456 | db 'include ',0 |
||
1720 | IgorA | 1457 | |
1458 | txt_cbox db ' check_box2',0 |
||
1459 | txt_cb_b db 13,'check_boxes:',0 |
||
1460 | txt_cb_e db 'check_boxes_end:',13,0 |
||
1461 | |||
1706 | IgorA | 1462 | txt_ebox db ' edit_box',0 |
1732 | IgorA | 1463 | txt_editb_draw db 9,'stdcall [edit_box_draw], ',0 |
1464 | txt_cbox_draw db 9,'stdcall [check_box_draw], ',0 |
||
1698 | IgorA | 1465 | |
1732 | IgorA | 1466 | ;начало функции кнопок |
1467 | txt_but_beg db 'align 4',13,'button:',13,9,'mcall 17',13,0 |
||
1468 | txt_but_mid db 9,'cmp ah,1',13,9,'jne still',13,'.exit:',13,0 |
||
1469 | ;конец функции кнопок (завершение програмы) |
||
1470 | txt_but_end db 9,'mcall -1',13,0 |
||
1698 | IgorA | 1471 | |
1472 | txt_key_1: |
||
1473 | db 'align 4',13,'key:',13,9,'mcall 2',13 |
||
1474 | txt_key_2: |
||
1475 | db 9,'jmp still',13 |
||
1476 | txt_key_3: |
||
1477 | |||
1727 | IgorA | 1478 | ;получаем порядковый номер объекта относительно памяти элемента tree2 |
1714 | IgorA | 1479 | ;output: |
1727 | IgorA | 1480 | ; txt_buf - строка с номером объекта |
1698 | IgorA | 1481 | align 4 |
1714 | IgorA | 1482 | proc get_obj_id_str, p_obj:dword, txt_buf:dword |
1698 | IgorA | 1483 | push eax ecx edx |
1484 | mov eax,dword[p_obj] |
||
1485 | sub eax,[tree2.data_info] |
||
1486 | xor edx,edx |
||
1487 | xor ecx,ecx |
||
1488 | mov cx,word[tree2.info_size] |
||
1489 | div ecx |
||
1490 | |||
1491 | mov edx,dword[txt_buf] |
||
1492 | mov byte[edx],0 |
||
1493 | stdcall str_cat_value,edx,eax |
||
1494 | pop edx ecx eax |
||
1495 | ret |
||
1496 | endp |
||
1497 | |||
1727 | IgorA | 1498 | ;получаем порядковый номер объекта относительно памяти элемента tree2 |
1714 | IgorA | 1499 | ;output: |
1727 | IgorA | 1500 | ; eax - номер объекта |
1714 | IgorA | 1501 | align 4 |
1502 | proc get_obj_id, p_obj:dword |
||
1503 | push ecx edx |
||
1504 | mov eax,dword[p_obj] |
||
1505 | sub eax,[tree2.data_info] |
||
1506 | xor edx,edx |
||
1507 | xor ecx,ecx |
||
1508 | mov cx,word[tree2.info_size] |
||
1509 | div ecx |
||
1510 | pop edx ecx |
||
1511 | ret |
||
1512 | endp |
||
1513 | |||
1727 | IgorA | 1514 | ;--- текстовые функции --- |
1698 | IgorA | 1515 | |
1727 | IgorA | 1516 | ;выбираем строку из масива, по указанному индексу |
1517 | ;input: |
||
1518 | ; str - указатель на масив строк |
||
1519 | ; ind - индекс искомой строки |
||
1520 | ;output: |
||
1521 | ; edi - указатель на найденую строку |
||
1698 | IgorA | 1522 | align 4 |
1727 | IgorA | 1523 | proc get_string_by_ind, str:dword, ind:dword |
1524 | push eax ebx ecx |
||
1525 | mov edi,[str] |
||
1526 | mov ebx,[ind] |
||
1527 | xor al,al ;0 - символ конца строки |
||
1528 | @@: |
||
1529 | cmp ebx,0 |
||
1530 | jle @f ;если найдена строка с указанным индексом |
||
1531 | xor ecx,ecx |
||
1532 | dec ecx ;ecx - число просматриваемых байт |
||
1533 | cld |
||
1534 | repne scasb ;ищем конец строки (al=0) |
||
1535 | cmp byte[edi],0 |
||
1536 | je @f ;если следующей строки нет выход из цикла |
||
1537 | dec ebx |
||
1538 | jmp @b |
||
1539 | @@: |
||
1540 | pop ecx ebx eax |
||
1541 | ret |
||
1542 | endp |
||
1543 | |||
1544 | align 4 |
||
1698 | IgorA | 1545 | proc mem_clear, mem:dword, len:dword |
1546 | push eax ecx edi |
||
1547 | cld |
||
1548 | xor al,al |
||
1549 | mov edi, dword[mem] |
||
1550 | mov ecx, dword[len] |
||
1551 | repne stosb |
||
1552 | pop edi ecx eax |
||
1553 | ret |
||
1554 | endp |
||
1555 | |||
1556 | align 4 |
||
1557 | proc str_cat, str1:dword, str2:dword |
||
1558 | push eax ecx edi esi |
||
1559 | mov esi,dword[str2] |
||
1560 | stdcall str_len,esi |
||
1561 | mov ecx,eax |
||
1562 | inc ecx |
||
1563 | mov edi,dword[str1] |
||
1564 | stdcall str_len,edi |
||
1565 | add edi,eax |
||
1566 | cld |
||
1567 | repne movsb |
||
1568 | pop esi edi ecx eax |
||
1569 | ret |
||
1570 | endp |
||
1571 | |||
1572 | align 4 |
||
1573 | proc str_cat_value, str1:dword, value:dword |
||
1574 | pushad |
||
1575 | mov edi,[str1] |
||
1576 | stdcall str_len,edi |
||
1577 | add edi,eax |
||
1578 | mov eax,[value] |
||
1579 | call tl_convert_to_str |
||
1580 | popad |
||
1581 | ret |
||
1582 | endp |
||
1583 | |||
1584 | ;output: |
||
1585 | ; eax = strlen |
||
1586 | align 4 |
||
1587 | proc str_len, str1:dword |
||
1588 | mov eax,[str1] |
||
1589 | @@: |
||
1590 | cmp byte[eax],0 |
||
1591 | je @f |
||
1592 | inc eax |
||
1593 | jmp @b |
||
1594 | @@: |
||
1595 | sub eax,[str1] |
||
1596 | ret |
||
1597 | endp |
||
1598 | |||
1599 | ;input: |
||
1600 | ; eax = value |
||
1601 | ; edi = string buffer |
||
1602 | align 4 |
||
1603 | tl_convert_to_str: |
||
1604 | pushad |
||
1605 | stdcall mem_clear,edi,12 |
||
1606 | call .str |
||
1607 | popad |
||
1608 | ret |
||
1609 | |||
1610 | align 4 |
||
1611 | .str: |
||
1727 | IgorA | 1612 | mov ecx,0x0a ;задается система счисления изменяются регистры ebx,eax,ecx,edx входные параметры eax - число |
1613 | ;преревод числа в ASCII строку входные данные ecx=система счисленя edi адрес куда записывать, будем строку, причем конец переменной |
||
1614 | cmp eax,ecx ;сравнить если в eax меньше чем в ecx то перейти на @@-1 т.е. на pop eax |
||
1698 | IgorA | 1615 | jb @f |
1727 | IgorA | 1616 | xor edx,edx ;очистить edx |
1617 | div ecx ;разделить - остаток в edx |
||
1618 | push edx ;положить в стек |
||
1619 | ;dec edi ;смещение необходимое для записи с конца строки |
||
1620 | call .str ;перейти на саму себя т.е. вызвать саму себя и так до того момента пока в eax не станет меньше чем в ecx |
||
1698 | IgorA | 1621 | pop eax |
1727 | IgorA | 1622 | @@: ;cmp al,10 ;проверить не меньше ли значение в al чем 10 (для системы счисленя 10 данная команда - лишная)) |
1623 | or al,0x30 ;данная команда короче чем две выше |
||
1624 | stosb ;записать элемент из регистра al в ячеку памяти es:edi |
||
1698 | IgorA | 1625 | ret |