Subversion Repositories Kolibri OS

Rev

Rev 1443 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1443 Rev 1617
Line 93... Line 93...
93
 
93
 
94
   mov	   [_mode],CONSOLE_MODE
94
   mov	   [_mode],CONSOLE_MODE
Line 95... Line 95...
95
   jmp	   start
95
   jmp	   start
-
 
96
 
96
 
97
start_1:
97
start_1:
-
 
Line 98... Line 98...
98
sys_load_library  library_name, cur_dir_path, library_path, system_path, \
98
;sys_
99
  err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
99
load_libraries l_libs_start,load_lib_end
100
 
100
 
101
  cmp eax,-1
101
  cmp eax,-1
Line 106... Line 106...
106
 
106
 
107
  get_sys_colors 1,0
107
  get_sys_colors 1,0
108
  edit_boxes_set_sys_color edit1,editboxes_end,sc
108
  edit_boxes_set_sys_color edit1,editboxes_end,sc
Line -... Line 109...
-
 
109
  check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc
-
 
110
 
-
 
111
  ; OpenDialog initialisation
-
 
112
  push dword OpenDialog_data
109
  check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc
113
  call dword [OpenDialog_Init]
110
 
114
 
Line 111... Line 115...
111
red:	; Redraw
115
red:	; Redraw
112
    call draw_window
116
    call draw_window
Line 148... Line 152...
148
    jne     noclose
152
    jne     noclose
149
    or	    eax,-1
153
    or	    eax,-1
150
    mcall
154
    mcall
Line 151... Line 155...
151
 
155
 
-
 
156
noclose:    
-
 
157
	cmp ah,5 ;press button for OpenDialog
-
 
158
	jne @f
-
 
159
		call fun_opn_dlg
152
noclose:    
160
	@@:
153
    cmp  ah,2	      ; Start compiling
161
    cmp  ah,2	      ; Start compiling
154
    je	 start
162
    je	 start
155
    cmp  ah,3	      ; Start compiled file
163
    cmp  ah,3	      ; Start compiled file
Line 221... Line 229...
221
    madd  ecx, (14*3+16)/3+1,0
229
    madd  ecx, (14*3+16)/3+1,0
222
    mcall  ,,,0x00000003
230
    mcall  ,,,0x00000003
223
    madd  ecx, (14*3+16)/3+1,0
231
    madd  ecx, (14*3+16)/3+1,0
224
    mcall ,,,4
232
    mcall ,,,4
Line -... Line 233...
-
 
233
 
-
 
234
	;button for OpenDialog [..]
-
 
235
	mov ebx, 5*65536+47
-
 
236
	mov ecx, 33*65536+14
-
 
237
	mcall ,,,5
225
 
238
 
226
    mpack ebx,6,0    ; Draw Window Text
239
    mpack ebx,6,0    ; Draw Window Text
227
    add  ebx,1+ 14/2-3
240
    add  ebx,1+ 14/2-3
228
    mov  ecx,[sc.work_text]
241
    mov  ecx,[sc.work_text]
229
    mov  edx,text
242
    mov  edx,text
230
    mov  esi,text.line_size
243
    mov  esi,text.line_size
-
 
244
    mov  eax,4
231
    mov  eax,4
245
 
-
 
246
    mcall ;InFile
-
 
247
    add  ebx, 16 ;14
232
   newline:
248
    add  edx,text.line_size
-
 
249
    mcall ;OutFile
233
    mcall
250
	mov ecx,[sc.work_button_text]
234
    add  ebx, 16 ;14
251
    add  ebx, 16 ;14
235
    add  edx,text.line_size
-
 
236
    cmp  byte[edx],'x'
252
    add  edx,text.line_size
Line 237... Line 253...
237
    jne  newline
253
	mcall ;Path
238
 
254
 
239
    mov   ebx,[pinfo.box.width]
255
    mov   ebx,[pinfo.box.width]
240
    sub   ebx,MAGIC1+10+1-9
256
    sub   ebx,MAGIC1+10+1-9
Line 280... Line 296...
280
    popa
296
    popa
281
    ret
297
    ret
Line 282... Line 298...
282
 
298
 
Line -... Line 299...
-
 
299
bottom_right dd ?
-
 
300
 
-
 
301
align 4
-
 
302
fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£ 
-
 
303
	pushad
-
 
304
	copy_path open_dialog_name,communication_area_default_path,library_path,0
-
 
305
	mov [OpenDialog_data.type],0
-
 
306
 
-
 
307
	xor al,al
-
 
308
	mov edi,dword[edit3.text]
-
 
309
	mov ecx,dword[edit3.max]
-
 
310
	cld
-
 
311
	repne scasb
-
 
312
	cmp byte[edi-2],'/'
-
 
313
	jne @f
-
 
314
		mov byte[edi-2],0 ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
-
 
315
	@@:
-
 
316
 
-
 
317
	push dword OpenDialog_data
-
 
318
	call dword [OpenDialog_Start]
-
 
319
	cmp [OpenDialog_data.status],2
-
 
320
	je @f
-
 
321
		xor al,al
-
 
322
		mov edi,dword[edit3.text]
-
 
323
		mov ebx,edi ;copy text pointer
-
 
324
		mov ecx,dword[edit3.max]
-
 
325
		cld
-
 
326
		repne scasb
-
 
327
		cmp byte[edi-2],'/'
-
 
328
		jne .no_slash
-
 
329
			dec edi ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
-
 
330
		.no_slash:
-
 
331
		mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®­æ¥ ¯ã⨠᫥è
-
 
332
		mov byte[edi],0 ;®â१ ¥¬ ¨¬ï ­ ©¤¥­­®£® ä ©« 
-
 
333
		sub edi,ebx ;edi = strlen(edit3.text)
-
 
334
		mov [edit3.size],edi
-
 
335
		mov [edit3.pos],edi
-
 
336
 
-
 
337
		;xor al,al
-
 
338
		mov edi,dword[OpenDialog_data.filename_area]
-
 
339
		mov ebx,edi ;copy text pointer
-
 
340
		mov ecx,dword[edit1.max]
-
 
341
		;cld
-
 
342
		repne scasb
-
 
343
		sub edi,ebx ;edi = strlen(OpenDialog_data.filename_area)
-
 
344
		mov ecx,edi
-
 
345
		dec edi
-
 
346
		mov [edit1.size],edi
-
 
347
		mov [edit1.pos],edi
-
 
348
		mov esi,dword[OpenDialog_data.filename_area]
-
 
349
		mov edi,dword[edit1.text]
-
 
350
		;cld
-
 
351
		rep movsb
-
 
352
 
-
 
353
		push dword edit1
-
 
354
		call dword [edit_box_draw]
-
 
355
		push dword edit3
-
 
356
		call dword [edit_box_draw]
-
 
357
	@@:
-
 
358
	popad
283
bottom_right dd ?
359
	ret
284
 
360
 
285
draw_messages:
361
draw_messages:
286
    mov    eax,13      ; clear work area
362
    mov    eax,13      ; clear work area
287
    mpack  ebx,7-2,[pinfo.box.width]
363
    mpack  ebx,7-2,[pinfo.box.width]
Line 332... Line 408...
332
text:
408
text:
333
  db ' ‚å” ©«:'
409
  db ' ‚å” ©«:'
334
.line_size = $-text
410
.line_size = $-text
335
  db '‚ë唠©«:'
411
  db '‚ë唠©«:'
336
  db '   ãâì:'
412
  db '   ãâì:'
337
  db 'x'
413
  ;db 'x'
Line 338... Line 414...
338
 
414
 
339
  s_compile db 'Š®¬¯¨«.'
415
  s_compile db 'Š®¬¯¨«.'
340
  s_run     db ' ã᪠ '
416
  s_run     db ' ã᪠ '
341
  s_debug   db 'Žâ« ¤ª '
417
  s_debug   db 'Žâ« ¤ª '
342
  s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
418
  s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
Line -... Line 419...
-
 
419
  s_dbgdescr_end:
343
  s_dbgdescr_end:
420
 
-
 
421
  err_message_found_lib0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  box_lib.obj',0  ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
344
 
422
  err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
345
  err_message_import db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠box_lib.obj',0
423
  err_message_found_lib1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  proc_lib.obj',0
346
  err_message_found_lib db 'Žè¨¡ª  ¯à¨ ¯®¨áª¥ box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
424
  err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0
347
  head_f_i: 
-
 
348
  head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
-
 
349
  system_path db '/sys/lib/'
425
  head_f_i:
350
  library_name db 'box_lib.obj',0
426
  head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
351
else
427
else
352
text:
428
text:
353
  db ' INFILE:'
429
  db ' InFile:'
354
.line_size = $-text
430
.line_size = $-text
355
  db 'OUTFILE:'
431
  db 'OutFile:'
Line 356... Line 432...
356
  db '   PATH:'
432
  db '   Path:'
357
  db 'x'
433
  ;db 'x'
358
 
434
 
359
  s_compile db 'COMPILE'
435
  s_compile db 'COMPILE'
360
  s_run     db '  RUN  '
436
  s_run     db '  RUN  '
Line -... Line 437...
-
 
437
  s_debug   db ' DEBUG '
361
  s_debug   db ' DEBUG '
438
  s_dbgdescr db 'Generate debug information',0
362
  s_dbgdescr db 'Generate debug information',0
439
  s_dbgdescr_end:
-
 
440
 
-
 
441
  err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
363
  s_dbgdescr_end:
442
  err_message_import0 db 'Error on load import library box_lib.obj',0
364
 
443
  err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
365
  err_message_import db 'Error on load import library box_lib.obj',0
-
 
366
  err_message_found_lib db 'Sorry I cannot found library box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
-
 
367
  head_f_i: 
444
  err_message_import1 db 'Error on load import library proc_lib.obj',0
Line -... Line 445...
-
 
445
 
-
 
446
  head_f_i:
-
 
447
  head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
-
 
448
end if
-
 
449
 
-
 
450
  system_dir0 db '/sys/lib/'
-
 
451
  lib0_name db 'box_lib.obj',0
-
 
452
 
368
  head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
453
  system_dir1 db '/sys/lib/'
369
  system_path db '/sys/lib/'
454
  lib1_name db 'proc_lib.obj',0
370
  library_name db 'box_lib.obj',0
455
 
371
end if
456
 
372
 
457
align 4
Line 389... Line 474...
389
 
474
 
390
  aCheck_box_draw  db 'check_box_draw',0
475
  aCheck_box_draw  db 'check_box_draw',0
391
  aCheck_box_mouse db 'check_box_mouse',0
476
  aCheck_box_mouse db 'check_box_mouse',0
Line -... Line 477...
-
 
477
  ;aVersion_ch      db 'version_ch',0
-
 
478
 
-
 
479
align 4
-
 
480
import_proc_lib:
-
 
481
	OpenDialog_Init dd aOpenDialog_Init
-
 
482
	OpenDialog_Start dd aOpenDialog_Start
-
 
483
dd 0,0
-
 
484
	aOpenDialog_Init db 'OpenDialog_init',0
-
 
485
	aOpenDialog_Start db 'OpenDialog_start',0
-
 
486
 
-
 
487
;library structures
-
 
488
l_libs_start:
-
 
489
  lib0 l_libs lib0_name, cur_dir_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i
-
 
490
  lib1 l_libs lib1_name, cur_dir_path, library_path, system_dir1, err_message_found_lib1, head_f_l, import_proc_lib,err_message_import1, head_f_i
392
  ;aVersion_ch      db 'version_ch',0
491
load_lib_end:
393
 
492
 
394
edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11
493
edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11
395
edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
494
edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
396
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
495
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
Line -... Line 496...
-
 
496
editboxes_end:
-
 
497
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr)
-
 
498
 
-
 
499
;---------------------------------------------------------------------
-
 
500
align 4
-
 
501
OpenDialog_data:
-
 
502
.type			dd 0
-
 
503
.procinfo		dd pinfo	;+4
-
 
504
.com_area_name		dd communication_area_name	;+8
-
 
505
.com_area		dd 0	;+12
-
 
506
.opendir_path		dd path ;+16
-
 
507
.dir_default_path	dd default_dir ;+20
-
 
508
.start_path		dd library_path ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
-
 
509
.draw_window		dd draw_window	;+28
-
 
510
.status 		dd 0	;+32
-
 
511
.openfile_path		dd path ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
-
 
512
.filename_area		dd filename_area	;+40
-
 
513
.filter_area		dd Filter
-
 
514
.x:
-
 
515
.x_size 		dw 420 ;+48 ; Window X size
-
 
516
.x_start		dw 10 ;+50 ; Window X position
-
 
517
.y:
-
 
518
.y_size 		dw 320 ;+52 ; Window y size
-
 
519
.y_start		dw 10 ;+54 ; Window Y position
-
 
520
 
-
 
521
default_dir db '/rd/1',0 ;¤¨à¥ªâ®à¨ï ¯® 㬮«ç ­¨î
-
 
522
 
-
 
523
communication_area_name:
-
 
524
	db 'FFFFFFFF_open_dialog',0
-
 
525
open_dialog_name:
-
 
526
	db 'opendial',0
-
 
527
communication_area_default_path:
-
 
528
	db '/rd/1/File managers/',0
-
 
529
 
-
 
530
Filter:
-
 
531
dd Filter.end - Filter
-
 
532
.1:
-
 
533
db 'ASM',0
397
editboxes_end:
534
.end:
Line 398... Line 535...
398
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr)
535
db 0
399
 
536
 
400
mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox
537
mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox
401
 
538
 
402
infile	  db 'example.asm'
-
 
-
 
539
infile	  db 'example.asm'
403
  times MAX_PATH-$+infile  db 0
540
  times MAX_PATH-$+infile  db 0
404
outfile db 'example'
541
outfile db 'example'
405
  times MAX_PATH-$+outfile db 0
542
  times MAX_PATH-$+outfile db 0
Line 541... Line 678...
541
program_end:
678
program_end:
542
;  params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
679
;  params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
543
params	rb 4096
680
params	rb 4096
544
cur_dir_path rb 4096
681
cur_dir_path rb 4096
545
library_path rb 4096
682
library_path rb 4096
-
 
683
filename_area rb 256
Line 546... Line 684...
546
 
684
 
Line 547... Line 685...
547
align 4
685
align 4