Subversion Repositories Kolibri OS

Rev

Rev 1443 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31 halyavin 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                 ;;
3
;;  flat assembler source                          ;;
109 heavyiron 4
;;  Copyright (c) 1999-2006, Tomasz Grysztar       ;;
31 halyavin 5
;;  All rights reserved.                           ;;
6
;;                                                 ;;
7
;;  Menuet port by VT                              ;;
8
;;                                                 ;;
9
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10
 
11
NORMAL_MODE    = 8
12
CONSOLE_MODE   = 32
13
 
1361 IgorA 14
MAGIC1	       = 6*(text.line_size-1)+14
174 heavyiron 15
MAX_PATH       = 100
31 halyavin 16
 
174 heavyiron 17
APP_MEMORY     = 0x00800000
31 halyavin 18
 
19
;; Menuet header
20
 
205 heavyiron 21
appname equ "flat assembler "
174 heavyiron 22
 
31 halyavin 23
use32
24
 
25
  org 0x0
26
  db 'MENUET01'  ; 8 byte id
1361 IgorA 27
  dd 0x01	 ; header version
28
  dd START	 ; program start
31 halyavin 29
  dd program_end ; program image size
1361 IgorA 30
  dd stacktop	 ; required amount of memory
31
  dd stacktop	 ; stack
32
  dd params,cur_dir_path  ; parameters,icon
31 halyavin 33
 
34
include 'lang.inc'
1443 diamond 35
include '../../../macros.inc'
1361 IgorA 36
purge add,sub	 ; macros.inc does incorrect substitution
31 halyavin 37
include 'fasm.inc'
38
 
1443 diamond 39
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
40
include '../../../develop/libraries/box_lib/load_lib.mac'
1361 IgorA 41
  @use_library
42
 
43
 
44
 
31 halyavin 45
center fix true
46
 
109 heavyiron 47
START:	    ; Start of execution
1361 IgorA 48
	mov	edi, fileinfos
49
	mov	ecx, (fileinfos_end-fileinfos)/4
50
	or	eax, -1
51
	rep	stosd
52
	push	68
53
	pop	eax
54
	push	11
55
	pop	ebx
56
	mcall
57
 
58
   cmp	  [params],0
1395 mario79 59
   jz	    start_1
31 halyavin 60
 
1361 IgorA 61
   mov	  ecx,10
62
   mov	  eax,'    '
63
   mov	  edi,infile
174 heavyiron 64
   push   ecx
31 halyavin 65
   cld
1361 IgorA 66
   rep	  stosd
67
   mov	  ecx,[esp]
68
   mov	  edi,outfile
69
   rep	  stosd
70
   pop	  ecx
71
   mov	  edi,path
72
   rep	  stosd
31 halyavin 73
 
1361 IgorA 74
   mov	   esi,params
31 halyavin 75
;  DEBUGF  "params: %s\n",esi
1361 IgorA 76
   mov	   edi,infile
31 halyavin 77
   call    mov_param_str
78
;  mov     edi,infile
79
;  DEBUGF  " input: %s\n",edi
1361 IgorA 80
   mov	   edi,outfile
31 halyavin 81
   call    mov_param_str
82
;  mov     edi,outfile
83
;  DEBUGF  "output: %s\n",edi
1361 IgorA 84
   mov	   edi,path
31 halyavin 85
   call    mov_param_str
86
;  mov     edi,path
87
;  DEBUGF  "  path: %s\n",edi
1617 IgorA 88
   dec	   esi
1361 IgorA 89
   cmp	   [esi], dword ',run'
90
   jne	   @f
91
   mov	   [_run_outfile],1
31 halyavin 92
  @@:
93
 
1361 IgorA 94
   mov	   [_mode],CONSOLE_MODE
95
   jmp	   start
31 halyavin 96
 
1395 mario79 97
start_1:
1617 IgorA 98
;sys_
99
load_libraries l_libs_start,load_lib_end
31 halyavin 100
 
1395 mario79 101
  cmp eax,-1
102
  jne @f
103
    mcall -1 ;exit if not open box_lib.obj
104
  @@:
105
  mcall 40,0x27 ;маска системных событий
106
 
107
  get_sys_colors 1,0
108
  edit_boxes_set_sys_color edit1,editboxes_end,sc
109
  check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc
110
 
1617 IgorA 111
  ; OpenDialog initialisation
112
  push dword OpenDialog_data
113
  call dword [OpenDialog_Init]
114
 
174 heavyiron 115
red:	; Redraw
31 halyavin 116
    call draw_window
117
 
1361 IgorA 118
still:
119
    push 10	     ; Wait here for event
174 heavyiron 120
    pop eax
1361 IgorA 121
    mcall
122
    cmp al,6
1617 IgorA 123
    je	call_mouse
174 heavyiron 124
    dec eax
1361 IgorA 125
    je	red	     ; Redraw request
174 heavyiron 126
    dec eax
1361 IgorA 127
    jne button	     ; Button in buffer
31 halyavin 128
 
1361 IgorA 129
key:		     ; Key
130
    mov  al,2	     ; Read it and ignore
485 heavyiron 131
    mcall
1361 IgorA 132
 
133
    push dword edit1
134
    call [edit_box_key]
135
    push dword edit2
136
    call [edit_box_key]
137
    push dword edit3
138
    call [edit_box_key]
139
 
31 halyavin 140
    jmp  still
141
 
1443 diamond 142
call_mouse:
143
    call mouse
144
    jmp  still
145
 
174 heavyiron 146
button:    ; Button in Window
31 halyavin 147
 
174 heavyiron 148
    mov  al,17
485 heavyiron 149
    mcall
31 halyavin 150
 
174 heavyiron 151
    cmp     ah,1
152
    jne     noclose
1361 IgorA 153
    or	    eax,-1
485 heavyiron 154
    mcall
31 halyavin 155
 
174 heavyiron 156
noclose:
1617 IgorA 157
	cmp ah,5 ;press button for OpenDialog
158
	jne @f
159
		call fun_opn_dlg
160
	@@:
1361 IgorA 161
    cmp  ah,2	      ; Start compiling
162
    je	 start
163
    cmp  ah,3	      ; Start compiled file
31 halyavin 164
    jnz  norunout
165
 
166
    mov  edx,outfile
167
    call make_fullpaths
174 heavyiron 168
    mcall  70,file_info_start
31 halyavin 169
;   xor   ecx,ecx
170
    jmp  still
171
   norunout:
542 diamond 172
    cmp  ah,4
173
    jnz  norundebug
31 halyavin 174
 
542 diamond 175
    mov  edx,outfile
176
    call make_fullpaths
177
    mcall 70,file_info_debug
178
    jmp  still
179
 
180
   norundebug:
31 halyavin 181
 
174 heavyiron 182
    jmp  still
31 halyavin 183
 
184
 
1361 IgorA 185
mouse:
186
  push dword edit1
187
  call [edit_box_mouse]
188
  push dword edit2
189
  call [edit_box_mouse]
190
  push dword edit3
191
  call [edit_box_mouse]
1371 IgorA 192
  push dword ch1_dbg
193
  call [check_box_mouse]
1361 IgorA 194
  ret
195
 
31 halyavin 196
draw_window:
197
    pusha
198
 
199
    mcall  12,1 ; Start of draw
200
 
1372 IgorA 201
    ;get_sys_colors 1,0
31 halyavin 202
 
1361 IgorA 203
    xor  eax,eax
949 leency 204
    mov  ebx,100*65536+280
205
    mov  ecx,90*65536+260
174 heavyiron 206
    mov  edx,[sc.work]
1361 IgorA 207
    or	 edx,0x33000000
208
    mov  edi,title	       ; Draw Window Label Text
485 heavyiron 209
    mcall
31 halyavin 210
 
174 heavyiron 211
    mcall 9,PROCESSINFO,-1
31 halyavin 212
 
1371 IgorA 213
    cmp dword[pinfo.box.width],230 ; яЁютхЁ хь °шЁшэє юъэр
214
    jge @f
215
      mov dword[pinfo.box.width],230 ; хёыш юъэю юўхэ№ єчъюх, єтхышўштрхь °шЁшэє фы  шчсхцрэш  уы■ъют
216
    @@:
217
 
174 heavyiron 218
    mpack ecx,1,1
502 heavyiron 219
    mov   ebx,[pinfo.box.width]
174 heavyiron 220
    sub   ebx,10
31 halyavin 221
 
1371 IgorA 222
    mov eax,8
223
    mov edx,0x4000000B
502 heavyiron 224
    mpack ebx,[pinfo.box.width],MAGIC1
174 heavyiron 225
    msub  ebx,MAGIC1+10+1,0
542 diamond 226
    mpack ecx,0, (14*3+16)/3-1
370 heavyiron 227
    madd  ecx,1,0
31 halyavin 228
    mcall  ,,,0x00000002,[sc.work_button]
542 diamond 229
    madd  ecx, (14*3+16)/3+1,0
31 halyavin 230
    mcall  ,,,0x00000003
542 diamond 231
    madd  ecx, (14*3+16)/3+1,0
232
    mcall ,,,4
31 halyavin 233
 
1617 IgorA 234
	;button for OpenDialog [..]
235
	mov ebx, 5*65536+47
236
	mov ecx, 33*65536+14
237
	mcall ,,,5
238
 
174 heavyiron 239
    mpack ebx,6,0    ; Draw Window Text
370 heavyiron 240
    add  ebx,1+ 14/2-3
31 halyavin 241
    mov  ecx,[sc.work_text]
242
    mov  edx,text
243
    mov  esi,text.line_size
244
    mov  eax,4
1617 IgorA 245
 
246
    mcall ;InFile
1361 IgorA 247
    add  ebx, 16 ;14
31 halyavin 248
    add  edx,text.line_size
1617 IgorA 249
    mcall ;OutFile
250
	mov ecx,[sc.work_button_text]
251
    add  ebx, 16 ;14
252
    add  edx,text.line_size
253
	mcall ;Path
31 halyavin 254
 
502 heavyiron 255
    mov   ebx,[pinfo.box.width]
174 heavyiron 256
    sub   ebx,MAGIC1+10+1-9
31 halyavin 257
    shl   ebx,16
542 diamond 258
    add   ebx,1+( (14*3+16)/3-1)/2-3
31 halyavin 259
    mcall  ,,[sc.work_button_text],s_compile,7
542 diamond 260
    add   ebx,(14*3+16)/3+1
31 halyavin 261
    mcall ,,,s_run
542 diamond 262
    add   ebx,(14*3+16)/3+1
263
    mcall ,,,s_debug
31 halyavin 264
 
174 heavyiron 265
    mpack ebx,MAGIC1+6,0
370 heavyiron 266
    add   ebx,1+ 14/2-3+ 14*0
502 heavyiron 267
    mov   esi,[pinfo.box.width]
31 halyavin 268
    sub   esi,MAGIC1*2+5*2+6+3
269
    mov   eax,esi
270
    mov   cl,6
271
    div   cl
272
    cmp   al,MAX_PATH
273
    jbe   @f
274
    mov   al,MAX_PATH
275
@@: movzx esi,al
276
 
1361 IgorA 277
    call draw_messages
542 diamond 278
 
1363 IgorA 279
    mov eax,dword[pinfo.box.width]
280
    sub eax,127
1371 IgorA 281
    mov dword[edit1.width],eax ; єёЄрэртыштрхь °шЁшэє ЄхъёЄют√ї яюыхщ
1363 IgorA 282
    mov dword[edit2.width],eax
283
    mov dword[edit3.width],eax
284
 
1361 IgorA 285
    push dword edit1
286
    call [edit_box_draw]
287
    push dword edit2
288
    call [edit_box_draw]
289
    push dword edit3
290
    call [edit_box_draw]
1371 IgorA 291
    push dword ch1_dbg
292
    call [check_box_draw]
31 halyavin 293
 
294
    mcall  12,2 ; End of Draw
295
 
296
    popa
297
    ret
298
 
299
bottom_right dd ?
300
 
1617 IgorA 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
359
	ret
360
 
31 halyavin 361
draw_messages:
362
    mov    eax,13      ; clear work area
502 heavyiron 363
    mpack  ebx,7-2,[pinfo.box.width]
370 heavyiron 364
    sub    ebx,5*2+7*2-1-2*2
502 heavyiron 365
    mpack  ecx,0,[pinfo.box.height]
542 diamond 366
    madd   ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
31 halyavin 367
    mov    word[bottom_right+2],bx
368
    mov    word[bottom_right],cx
369
    msub   [bottom_right],7,11
370 heavyiron 370
    add    [bottom_right],7 shl 16 + 53
31 halyavin 371
    mov    edx,[sc.work]
485 heavyiron 372
    mcall
31 halyavin 373
_cy = 0
374
_sy = 2
375
_cx = 4
376
_sx = 6
377
    push   ebx ecx
370 heavyiron 378
    mpack  ebx,4,5
31 halyavin 379
    add    bx,[esp+_cx]
380
    mov    ecx,[esp+_sy-2]
381
    mov    cx,[esp+_sy]
382
    msub   ecx,1,1
383
    mcall  38,,,[sc.work_graph]
384
    mov    si,[esp+_cy]
385
    add    cx,si
386
    shl    esi,16
387
    add    ecx,esi
388
    madd   ecx,1,1
389
    mcall
370 heavyiron 390
    mpack  ebx,4,4
31 halyavin 391
    mov    esi,[esp+_sy-2]
392
    mov    si,cx
393
    mov    ecx,esi
394
    mcall
395
    mov    si,[esp+_cx]
396
    add    bx,si
397
    shl    esi,16
398
    add    ebx,esi
399
    madd   ebx,1,1
400
    mcall
401
    pop    ecx ebx
402
    ret
403
 
404
 
1361 IgorA 405
; DATA
31 halyavin 406
 
1361 IgorA 407
if lang eq ru
408
text:
409
  db ' ВхФайл:'
410
.line_size = $-text
411
  db 'ВыхФайл:'
412
  db '   Путь:'
1617 IgorA 413
  ;db 'x'
31 halyavin 414
 
1361 IgorA 415
  s_compile db 'Компил.'
416
  s_run     db ' Пуск  '
417
  s_debug   db 'Отладка'
1371 IgorA 418
  s_dbgdescr db 'Создавать отладочную информацию',0
419
  s_dbgdescr_end:
31 halyavin 420
 
1617 IgorA 421
  err_message_found_lib0 db 'Не найдена библиотека box_lib.obj',0  ;строка, которая будет в сформированном окне, если библиотека не будет найдена
422
  err_message_import0 db 'Ошибка при импорте библиотеки box_lib.obj',0
423
  err_message_found_lib1 db 'Не найдена библиотека proc_lib.obj',0
424
  err_message_import1 db 'Ошибка при импорте библиотеки proc_lib.obj',0
425
  head_f_i:
1361 IgorA 426
  head_f_l db 'Системная ошибка',0 ;заголовок окна, при возникновении ошибки
427
else
428
text:
1617 IgorA 429
  db ' InFile:'
1361 IgorA 430
.line_size = $-text
1617 IgorA 431
  db 'OutFile:'
432
  db '   Path:'
433
  ;db 'x'
31 halyavin 434
 
1361 IgorA 435
  s_compile db 'COMPILE'
436
  s_run     db '  RUN  '
437
  s_debug   db ' DEBUG '
1371 IgorA 438
  s_dbgdescr db 'Generate debug information',0
439
  s_dbgdescr_end:
31 halyavin 440
 
1617 IgorA 441
  err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
442
  err_message_import0 db 'Error on load import library box_lib.obj',0
443
  err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
444
  err_message_import1 db 'Error on load import library proc_lib.obj',0
445
 
446
  head_f_i:
1361 IgorA 447
  head_f_l db 'System error',0 ;заголовок окна, при возникновении ошибки
448
end if
31 halyavin 449
 
1617 IgorA 450
  system_dir0 db '/sys/lib/'
451
  lib0_name db 'box_lib.obj',0
452
 
453
  system_dir1 db '/sys/lib/'
454
  lib1_name db 'proc_lib.obj',0
455
 
456
 
457
align 4
458
import_box_lib:
1361 IgorA 459
  edit_box_draw  dd aEdit_box_draw
460
  edit_box_key	 dd aEdit_box_key
461
  edit_box_mouse dd aEdit_box_mouse
462
  ;version_ed     dd aVersion_ed
31 halyavin 463
 
1371 IgorA 464
  check_box_draw  dd aCheck_box_draw
465
  check_box_mouse dd aCheck_box_mouse
1361 IgorA 466
  ;version_ch      dd aVersion_ch
31 halyavin 467
 
1361 IgorA 468
  dd 0,0
31 halyavin 469
 
1361 IgorA 470
  aEdit_box_draw  db 'edit_box',0
471
  aEdit_box_key   db 'edit_box_key',0
472
  aEdit_box_mouse db 'edit_box_mouse',0
473
  ;aVersion_ed     db 'version_ed',0
31 halyavin 474
 
1371 IgorA 475
  aCheck_box_draw  db 'check_box_draw',0
476
  aCheck_box_mouse db 'check_box_mouse',0
1361 IgorA 477
  ;aVersion_ch      db 'version_ch',0
31 halyavin 478
 
1617 IgorA 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
491
load_lib_end:
492
 
1371 IgorA 493
edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11
494
edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
495
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
1372 IgorA 496
editboxes_end:
497
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr)
31 halyavin 498
 
1617 IgorA 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
534
.end:
535
db 0
536
 
1361 IgorA 537
mouse_dd dd 0 ;эєцэю фы  Shift-р т editbox
31 halyavin 538
 
205 heavyiron 539
infile	  db 'example.asm'
1371 IgorA 540
  times MAX_PATH-$+infile  db 0
205 heavyiron 541
outfile db 'example'
1371 IgorA 542
  times MAX_PATH-$+outfile db 0
1617 IgorA 543
path	db '/rd/1//' ;OpenDialog при запуске убирает последний слеш, но диалог может использоваться не всегда, потому слеша 2
1371 IgorA 544
  times MAX_PATH-$+path    db 0
1367 Lrz 545
path_end:
31 halyavin 546
lf db 13,10,0
547
 
548
 
549
mov_param_str:
1395 mario79 550
    cld
551
@@:
552
    lodsb
31 halyavin 553
    cmp    al,','
1617 IgorA 554
    je	   @f
31 halyavin 555
    stosb
1395 mario79 556
    test   al,al
557
    jnz    @b
558
@@:
559
    xor    al,al
560
    stosb
561
    ret
31 halyavin 562
 
1395 mario79 563
 
564
 
31 halyavin 565
start:
566
    cmp    [_mode],NORMAL_MODE
567
    jne    @f
568
    call   draw_messages
542 diamond 569
    mov    [textxy],7 shl 16 + 70
31 halyavin 570
@@:
571
    mov    esi,_logo
572
    call   display_string
573
 
574
 ;
575
 ;   Fasm native code
576
 ;
577
 
578
    mov    [input_file],infile
579
    mov    [output_file],outfile
580
 
581
    call   init_memory
582
 
583
    call   make_timestamp
584
    mov    [start_time],eax
585
 
586
    call   preprocessor
587
    call   parser
588
    call   assembler
1371 IgorA 589
    bt	   dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
590
    jae    @f			  ;jz @f
542 diamond 591
    call   symbol_dump
592
@@:
31 halyavin 593
    call   formatter
594
 
595
    call   display_user_messages
596
    movzx  eax,[current_pass]
597
    inc    eax
598
    call   display_number
599
    mov    esi,_passes_suffix
600
    call   display_string
601
    call   make_timestamp
602
    sub    eax,[start_time]
603
    xor    edx,edx
604
    mov    ebx,100
605
    div    ebx
109 heavyiron 606
    or	     eax,eax
607
    jz	     display_bytes_count
31 halyavin 608
    xor    edx,edx
609
    mov    ebx,10
610
    div    ebx
611
    push   edx
612
    call   display_number
613
    mov    dl,'.'
614
    call   display_character
615
    pop    eax
616
    call   display_number
617
    mov    esi,_seconds_suffix
618
    call   display_string
619
  display_bytes_count:
620
    mov    eax,[written_size]
621
    call   display_number
622
    mov    esi,_bytes_suffix
623
    call   display_string
624
    xor    al,al
625
 
626
    cmp    [_run_outfile],0
1361 IgorA 627
    je	   @f
31 halyavin 628
    mov    edx,outfile
629
    call   make_fullpaths
174 heavyiron 630
    mov    eax,70
31 halyavin 631
    mov    ebx,file_info_start
632
    xor    ecx,ecx
485 heavyiron 633
    mcall
31 halyavin 634
@@:
635
    jmp    exit_program
636
 
637
 
638
include 'system.inc'
639
include 'version.inc'
640
include 'errors.inc'
641
include 'expressi.inc'
642
include 'preproce.inc'
643
include 'parser.inc'
644
include 'assemble.inc'
645
include 'formats.inc'
646
include 'x86_64.inc'
109 heavyiron 647
include 'tables.inc'
542 diamond 648
include 'symbdump.inc'
692 heavyiron 649
include 'messages.inc'
31 halyavin 650
 
485 heavyiron 651
title db appname,VERSION_STRING,0
196 heavyiron 652
 
31 halyavin 653
_logo db 'flat assembler  version ',VERSION_STRING,13,10,0
654
 
655
_passes_suffix db ' passes, ',0
656
_seconds_suffix db ' seconds, ',0
657
_bytes_suffix db ' bytes.',13,10,0
658
 
659
_include db 'INCLUDE',0
660
 
661
_counter db 4,'0000'
662
 
109 heavyiron 663
_mode	       dd NORMAL_MODE
31 halyavin 664
_run_outfile  dd 0
1371 IgorA 665
;bGenerateDebugInfo db 0
31 halyavin 666
 
667
sub_table:
668
times $41 db $00
669
times $1A db $20
670
times $25 db $00
671
times $10 db $20
672
times $30 db $00
673
times $10 db $50
674
times $04 db $00,$01
675
times $08 db $00
676
 
677
;include_debug_strings
678
program_end:
1395 mario79 679
;  params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
680
params	rb 4096
681
cur_dir_path rb 4096
682
library_path rb 4096
1617 IgorA 683
filename_area rb 256
1361 IgorA 684
 
31 halyavin 685
align 4
686
 
687
include 'variable.inc'
688
 
689
program_base dd ?
690
buffer_address dd ?
691
memory_setting dd ?
692
start_time dd ?
755 diamond 693
memblock	dd	?
31 halyavin 694
 
692 heavyiron 695
predefinitions rb 1000h
696
 
1361 IgorA 697
dbgfilename	rb	MAX_PATH+4
542 diamond 698
 
31 halyavin 699
sc    system_colors
332 diamond 700
max_handles = 8
701
fileinfos rb (4+20+MAX_PATH)*max_handles
702
fileinfos_end:
31 halyavin 703
pinfo process_information
635 diamond 704
 
705
align 1000h
706
rb 1000h
707
stacktop: