Subversion Repositories Kolibri OS

Rev

Rev 1617 | 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
 
1619 IgorA 337
		push dword [OpenDialog_data.filename_area]
338
		push dword edit1
339
		call dword [edit_box_set_text]
1617 IgorA 340
 
341
		push dword edit1
342
		call dword [edit_box_draw]
343
		push dword edit3
344
		call dword [edit_box_draw]
345
	@@:
346
	popad
347
	ret
348
 
31 halyavin 349
draw_messages:
350
    mov    eax,13      ; clear work area
502 heavyiron 351
    mpack  ebx,7-2,[pinfo.box.width]
370 heavyiron 352
    sub    ebx,5*2+7*2-1-2*2
502 heavyiron 353
    mpack  ecx,0,[pinfo.box.height]
542 diamond 354
    madd   ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
31 halyavin 355
    mov    word[bottom_right+2],bx
356
    mov    word[bottom_right],cx
357
    msub   [bottom_right],7,11
370 heavyiron 358
    add    [bottom_right],7 shl 16 + 53
31 halyavin 359
    mov    edx,[sc.work]
485 heavyiron 360
    mcall
31 halyavin 361
_cy = 0
362
_sy = 2
363
_cx = 4
364
_sx = 6
365
    push   ebx ecx
370 heavyiron 366
    mpack  ebx,4,5
31 halyavin 367
    add    bx,[esp+_cx]
368
    mov    ecx,[esp+_sy-2]
369
    mov    cx,[esp+_sy]
370
    msub   ecx,1,1
371
    mcall  38,,,[sc.work_graph]
372
    mov    si,[esp+_cy]
373
    add    cx,si
374
    shl    esi,16
375
    add    ecx,esi
376
    madd   ecx,1,1
377
    mcall
370 heavyiron 378
    mpack  ebx,4,4
31 halyavin 379
    mov    esi,[esp+_sy-2]
380
    mov    si,cx
381
    mov    ecx,esi
382
    mcall
383
    mov    si,[esp+_cx]
384
    add    bx,si
385
    shl    esi,16
386
    add    ebx,esi
387
    madd   ebx,1,1
388
    mcall
389
    pop    ecx ebx
390
    ret
391
 
392
 
1361 IgorA 393
; DATA
31 halyavin 394
 
1361 IgorA 395
if lang eq ru
396
text:
397
  db ' ВхФайл:'
398
.line_size = $-text
399
  db 'ВыхФайл:'
400
  db '   Путь:'
1617 IgorA 401
  ;db 'x'
31 halyavin 402
 
1361 IgorA 403
  s_compile db 'Компил.'
404
  s_run     db ' Пуск  '
405
  s_debug   db 'Отладка'
1371 IgorA 406
  s_dbgdescr db 'Создавать отладочную информацию',0
407
  s_dbgdescr_end:
31 halyavin 408
 
1617 IgorA 409
  err_message_found_lib0 db 'Не найдена библиотека box_lib.obj',0  ;строка, которая будет в сформированном окне, если библиотека не будет найдена
410
  err_message_import0 db 'Ошибка при импорте библиотеки box_lib.obj',0
411
  err_message_found_lib1 db 'Не найдена библиотека proc_lib.obj',0
412
  err_message_import1 db 'Ошибка при импорте библиотеки proc_lib.obj',0
413
  head_f_i:
1361 IgorA 414
  head_f_l db 'Системная ошибка',0 ;заголовок окна, при возникновении ошибки
415
else
416
text:
1617 IgorA 417
  db ' InFile:'
1361 IgorA 418
.line_size = $-text
1617 IgorA 419
  db 'OutFile:'
420
  db '   Path:'
421
  ;db 'x'
31 halyavin 422
 
1361 IgorA 423
  s_compile db 'COMPILE'
424
  s_run     db '  RUN  '
425
  s_debug   db ' DEBUG '
1371 IgorA 426
  s_dbgdescr db 'Generate debug information',0
427
  s_dbgdescr_end:
31 halyavin 428
 
1617 IgorA 429
  err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
430
  err_message_import0 db 'Error on load import library box_lib.obj',0
431
  err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
432
  err_message_import1 db 'Error on load import library proc_lib.obj',0
433
 
434
  head_f_i:
1361 IgorA 435
  head_f_l db 'System error',0 ;заголовок окна, при возникновении ошибки
436
end if
31 halyavin 437
 
1617 IgorA 438
  system_dir0 db '/sys/lib/'
439
  lib0_name db 'box_lib.obj',0
440
 
441
  system_dir1 db '/sys/lib/'
442
  lib1_name db 'proc_lib.obj',0
443
 
444
 
445
align 4
446
import_box_lib:
1619 IgorA 447
	edit_box_draw  dd aEdit_box_draw
448
	edit_box_key	 dd aEdit_box_key
449
	edit_box_mouse dd aEdit_box_mouse
450
	edit_box_set_text dd aEdit_box_set_text
451
	;version_ed     dd aVersion_ed
31 halyavin 452
 
1371 IgorA 453
  check_box_draw  dd aCheck_box_draw
454
  check_box_mouse dd aCheck_box_mouse
1361 IgorA 455
  ;version_ch      dd aVersion_ch
31 halyavin 456
 
1361 IgorA 457
  dd 0,0
31 halyavin 458
 
1361 IgorA 459
  aEdit_box_draw  db 'edit_box',0
460
  aEdit_box_key   db 'edit_box_key',0
461
  aEdit_box_mouse db 'edit_box_mouse',0
1619 IgorA 462
  aEdit_box_set_text db 'edit_box_set_text',0
1361 IgorA 463
  ;aVersion_ed     db 'version_ed',0
31 halyavin 464
 
1371 IgorA 465
  aCheck_box_draw  db 'check_box_draw',0
466
  aCheck_box_mouse db 'check_box_mouse',0
1361 IgorA 467
  ;aVersion_ch      db 'version_ch',0
31 halyavin 468
 
1617 IgorA 469
align 4
470
import_proc_lib:
471
	OpenDialog_Init dd aOpenDialog_Init
472
	OpenDialog_Start dd aOpenDialog_Start
473
dd 0,0
474
	aOpenDialog_Init db 'OpenDialog_init',0
475
	aOpenDialog_Start db 'OpenDialog_start',0
476
 
477
;library structures
478
l_libs_start:
479
  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
480
  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
481
load_lib_end:
482
 
1371 IgorA 483
edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11
484
edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
485
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
1372 IgorA 486
editboxes_end:
487
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr)
31 halyavin 488
 
1617 IgorA 489
;---------------------------------------------------------------------
490
align 4
491
OpenDialog_data:
492
.type			dd 0
493
.procinfo		dd pinfo	;+4
494
.com_area_name		dd communication_area_name	;+8
495
.com_area		dd 0	;+12
496
.opendir_path		dd path ;+16
497
.dir_default_path	dd default_dir ;+20
498
.start_path		dd library_path ;+24 путь к диалогу открытия файлов
499
.draw_window		dd draw_window	;+28
500
.status 		dd 0	;+32
501
.openfile_path		dd path ;+36 путь к открываемому файлу
502
.filename_area		dd filename_area	;+40
503
.filter_area		dd Filter
504
.x:
505
.x_size 		dw 420 ;+48 ; Window X size
506
.x_start		dw 10 ;+50 ; Window X position
507
.y:
508
.y_size 		dw 320 ;+52 ; Window y size
509
.y_start		dw 10 ;+54 ; Window Y position
510
 
511
default_dir db '/rd/1',0 ;директория по умолчанию
512
 
513
communication_area_name:
514
	db 'FFFFFFFF_open_dialog',0
515
open_dialog_name:
516
	db 'opendial',0
517
communication_area_default_path:
518
	db '/rd/1/File managers/',0
519
 
520
Filter:
521
dd Filter.end - Filter
522
.1:
523
db 'ASM',0
524
.end:
525
db 0
526
 
1361 IgorA 527
mouse_dd dd 0 ;эєцэю фы  Shift-р т editbox
31 halyavin 528
 
205 heavyiron 529
infile	  db 'example.asm'
1371 IgorA 530
  times MAX_PATH-$+infile  db 0
205 heavyiron 531
outfile db 'example'
1371 IgorA 532
  times MAX_PATH-$+outfile db 0
1617 IgorA 533
path	db '/rd/1//' ;OpenDialog при запуске убирает последний слеш, но диалог может использоваться не всегда, потому слеша 2
1371 IgorA 534
  times MAX_PATH-$+path    db 0
1367 Lrz 535
path_end:
31 halyavin 536
lf db 13,10,0
537
 
538
 
539
mov_param_str:
1395 mario79 540
    cld
541
@@:
542
    lodsb
31 halyavin 543
    cmp    al,','
1617 IgorA 544
    je	   @f
31 halyavin 545
    stosb
1395 mario79 546
    test   al,al
547
    jnz    @b
548
@@:
549
    xor    al,al
550
    stosb
551
    ret
31 halyavin 552
 
1395 mario79 553
 
554
 
31 halyavin 555
start:
556
    cmp    [_mode],NORMAL_MODE
557
    jne    @f
558
    call   draw_messages
542 diamond 559
    mov    [textxy],7 shl 16 + 70
31 halyavin 560
@@:
561
    mov    esi,_logo
562
    call   display_string
563
 
564
 ;
565
 ;   Fasm native code
566
 ;
567
 
568
    mov    [input_file],infile
569
    mov    [output_file],outfile
570
 
571
    call   init_memory
572
 
573
    call   make_timestamp
574
    mov    [start_time],eax
575
 
576
    call   preprocessor
577
    call   parser
578
    call   assembler
1371 IgorA 579
    bt	   dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
580
    jae    @f			  ;jz @f
542 diamond 581
    call   symbol_dump
582
@@:
31 halyavin 583
    call   formatter
584
 
585
    call   display_user_messages
586
    movzx  eax,[current_pass]
587
    inc    eax
588
    call   display_number
589
    mov    esi,_passes_suffix
590
    call   display_string
591
    call   make_timestamp
592
    sub    eax,[start_time]
593
    xor    edx,edx
594
    mov    ebx,100
595
    div    ebx
109 heavyiron 596
    or	     eax,eax
597
    jz	     display_bytes_count
31 halyavin 598
    xor    edx,edx
599
    mov    ebx,10
600
    div    ebx
601
    push   edx
602
    call   display_number
603
    mov    dl,'.'
604
    call   display_character
605
    pop    eax
606
    call   display_number
607
    mov    esi,_seconds_suffix
608
    call   display_string
609
  display_bytes_count:
610
    mov    eax,[written_size]
611
    call   display_number
612
    mov    esi,_bytes_suffix
613
    call   display_string
614
    xor    al,al
615
 
616
    cmp    [_run_outfile],0
1361 IgorA 617
    je	   @f
31 halyavin 618
    mov    edx,outfile
619
    call   make_fullpaths
174 heavyiron 620
    mov    eax,70
31 halyavin 621
    mov    ebx,file_info_start
622
    xor    ecx,ecx
485 heavyiron 623
    mcall
31 halyavin 624
@@:
625
    jmp    exit_program
626
 
627
 
628
include 'system.inc'
629
include 'version.inc'
630
include 'errors.inc'
631
include 'expressi.inc'
632
include 'preproce.inc'
633
include 'parser.inc'
634
include 'assemble.inc'
635
include 'formats.inc'
636
include 'x86_64.inc'
109 heavyiron 637
include 'tables.inc'
542 diamond 638
include 'symbdump.inc'
692 heavyiron 639
include 'messages.inc'
31 halyavin 640
 
485 heavyiron 641
title db appname,VERSION_STRING,0
196 heavyiron 642
 
31 halyavin 643
_logo db 'flat assembler  version ',VERSION_STRING,13,10,0
644
 
645
_passes_suffix db ' passes, ',0
646
_seconds_suffix db ' seconds, ',0
647
_bytes_suffix db ' bytes.',13,10,0
648
 
649
_include db 'INCLUDE',0
650
 
651
_counter db 4,'0000'
652
 
109 heavyiron 653
_mode	       dd NORMAL_MODE
31 halyavin 654
_run_outfile  dd 0
1371 IgorA 655
;bGenerateDebugInfo db 0
31 halyavin 656
 
657
sub_table:
658
times $41 db $00
659
times $1A db $20
660
times $25 db $00
661
times $10 db $20
662
times $30 db $00
663
times $10 db $50
664
times $04 db $00,$01
665
times $08 db $00
666
 
667
;include_debug_strings
668
program_end:
1395 mario79 669
;  params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
670
params	rb 4096
671
cur_dir_path rb 4096
672
library_path rb 4096
1617 IgorA 673
filename_area rb 256
1361 IgorA 674
 
31 halyavin 675
align 4
676
 
677
include 'variable.inc'
678
 
679
program_base dd ?
680
buffer_address dd ?
681
memory_setting dd ?
682
start_time dd ?
755 diamond 683
memblock	dd	?
31 halyavin 684
 
692 heavyiron 685
predefinitions rb 1000h
686
 
1361 IgorA 687
dbgfilename	rb	MAX_PATH+4
542 diamond 688
 
31 halyavin 689
sc    system_colors
332 diamond 690
max_handles = 8
691
fileinfos rb (4+20+MAX_PATH)*max_handles
692
fileinfos_end:
31 halyavin 693
pinfo process_information
635 diamond 694
 
695
align 1000h
696
rb 1000h
697
stacktop: