Subversion Repositories Kolibri OS

Rev

Rev 2664 | Blame | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                 ;;
  3. ;;  flat assembler source                          ;;
  4. ;;  Copyright (c) 1999-2012, Tomasz Grysztar       ;;
  5. ;;  All rights reserved.                           ;;
  6. ;;                                                 ;;
  7. ;;  KolibriOS port by KolibriOS Team               ;;
  8. ;;  Menuet port by VT                              ;;
  9. ;;                                                 ;;
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11.  
  12. NORMAL_MODE    = 8
  13. CONSOLE_MODE   = 32
  14.  
  15. MAGIC1         = 6*(text.line_size-1)+14
  16. MAX_PATH       = 100
  17.  
  18. APP_MEMORY     = 0x00800000
  19.  
  20. ;; Menuet header
  21.  
  22. appname equ "flat assembler "
  23. ;---------------------------------------------------------------------
  24.         use32
  25.         org 0x0
  26.         db 'MENUET01'  ; 8 byte id
  27.         dd 0x01  ; header version
  28.         dd START         ; program start
  29.         dd program_end ; program image size
  30.         dd stacktop      ; required amount of memory
  31.         dd stacktop      ; stack
  32.         dd params,cur_dir_path  ; parameters,icon
  33. ;---------------------------------------------------------------------
  34. include 'lang.inc'
  35. include '../../../macros.inc'
  36. purge add,sub    ; macros.inc does incorrect substitution
  37. include 'fasm.inc'
  38.  
  39. include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
  40. include '../../../develop/libraries/box_lib/load_lib.mac'
  41.   @use_library
  42.  
  43. center fix true
  44. ;---------------------------------------------------------------------
  45. START:      ; Start of execution
  46.         mov     edi, fileinfos
  47.         mov     ecx, (fileinfos_end-fileinfos)/4
  48.         or      eax, -1
  49.         rep     stosd
  50.         push    68
  51.         pop     eax
  52.         push    11
  53.         pop     ebx
  54.         mcall
  55.  
  56.         cmp     [params],0
  57.         jz      start_1
  58.        
  59.         mov     ecx,10
  60.         mov     eax,'    '
  61.         mov     edi,infile
  62.         push    ecx
  63.         cld
  64.         rep     stosd
  65.         mov     ecx,[esp]
  66.         mov     edi,outfile
  67.         rep     stosd
  68.         pop     ecx
  69.         mov     edi,path
  70.         rep     stosd
  71.        
  72.         mov      esi,params
  73. ;       DEBUGF  "params: %s\n",esi
  74.         mov     edi,infile
  75.         call    mov_param_str
  76. ;       mov     edi,infile
  77. ;       DEBUGF  " input: %s\n",edi
  78.         mov     edi,outfile
  79.         call    mov_param_str
  80. ;       mov     edi,outfile
  81. ;       DEBUGF  "output: %s\n",edi
  82.         mov     edi,path
  83.         call    mov_param_str
  84. ;       mov     edi,path
  85. ;       DEBUGF  "  path: %s\n",edi
  86.         dec     esi
  87.         cmp     [esi], dword ',run'
  88.         jne     @f
  89.         mov     [_run_outfile],1
  90. @@:
  91.         mov     [_mode],CONSOLE_MODE
  92.         jmp     start
  93. ;---------------------------------------------------------------------
  94. start_1:
  95. ;sys_
  96. load_libraries l_libs_start,load_lib_end
  97.  
  98.         cmp     eax,-1
  99.         jne     @f
  100.         mcall   -1 ;exit if not open box_lib.obj
  101. @@:
  102.         mcall   40,0x27 ;¬ áª  á¨á⥬­ëå ᮡë⨩
  103. ;---------------------------------------------------------------------
  104. init_checkboxes2 ch1_dbg,ch1_dbg+ch_struc_size
  105. ;---------------------------------------------------------------------
  106. ; OpenDialog initialisation
  107.         push dword OpenDialog_data
  108.         call dword [OpenDialog_Init]
  109. ;---------------------------------------------------------------------
  110. red:    ; Redraw
  111.         call    draw_window
  112.  
  113. still: 
  114.         mcall   10      ; Wait here for event
  115.         cmp     al,6
  116.         je      call_mouse
  117.         dec     eax
  118.         je      red          ; Redraw request
  119.         dec     eax
  120.         jne     button       ; Button in buffer
  121. key:                 ; Key
  122.         mcall   2       ; Read it and ignore
  123.        
  124.         push    dword edit1
  125.         call    [edit_box_key]
  126.         push    dword edit2
  127.         call    [edit_box_key]
  128.         push    dword edit3
  129.         call    [edit_box_key]
  130.         jmp     still
  131. ;---------------------------------------------------------------------
  132. call_mouse:
  133.         call    mouse
  134.         jmp     still
  135. ;---------------------------------------------------------------------
  136. button:    ; Button in Window
  137.         mcall   17
  138.         cmp     ah,1
  139.         jne     noclose
  140.         or      eax,-1
  141.         mcall
  142. ;---------------------------------------------------------------------
  143. noclose:    
  144.         cmp     ah,5 ;press button for OpenDialog
  145.         jne     @f
  146.         call    fun_opn_dlg
  147. @@:
  148.         cmp     ah,2          ; Start compiling
  149.         je      start
  150.         cmp     ah,3          ; Start compiled file
  151.         jnz     norunout
  152.        
  153.         mov     edx,outfile
  154.         call    make_fullpaths
  155.         mcall   70,file_info_start
  156. ;       xor     ecx,ecx
  157.         jmp     still
  158. ;---------------------------------------------------------------------
  159. norunout:
  160.         cmp     ah,4
  161.         jnz     norundebug
  162.        
  163.         mov     edx,outfile
  164.         call    make_fullpaths
  165.         mcall   70,file_info_debug
  166.         jmp     still
  167. ;---------------------------------------------------------------------
  168. norundebug:
  169.         jmp     still
  170. ;---------------------------------------------------------------------
  171. mouse:
  172.         push    dword edit1
  173.         call    [edit_box_mouse]
  174.         push    dword edit2
  175.         call    [edit_box_mouse]
  176.         push    dword edit3
  177.         call    [edit_box_mouse]
  178.         push    dword ch1_dbg
  179.         call    [check_box_mouse]
  180.         ret
  181. ;---------------------------------------------------------------------
  182. draw_window:
  183.         pusha
  184.         mcall   12,1 ; Start of draw
  185.        
  186.         get_sys_colors 1,0
  187.         edit_boxes_set_sys_color edit1,editboxes_end,sc
  188.         check_boxes_set_sys_color2 ch1_dbg,ch1_dbg+ch_struc_size,sc
  189.  
  190.         mov     edx,[sc.work]
  191.         or      edx,0x33000000
  192.         xor     eax,eax
  193.         xor     esi,esi
  194.         mcall   ,<100,280>,<90,260>,,,title            ; Draw Window Label Text
  195.  
  196.         mcall   9,PROCESSINFO,-1
  197.  
  198.         mov     eax,[PROCESSINFO+70] ;status of window
  199.         test    eax,100b
  200.         jne     .end
  201.  
  202.         cmp     dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà
  203.         jge     @f
  204.         mov     dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ
  205. @@:
  206.         mpack   ecx,1,1
  207.         mov     ebx,[pinfo.box.width]
  208.         sub     ebx,10
  209.         mov     eax,8
  210.         mov     edx,0x4000000B
  211.         mpack   ebx,[pinfo.box.width],MAGIC1
  212.         msub    ebx,MAGIC1+10+1,0
  213.         mpack   ecx,0, (14*3+16)/3-1
  214.         madd    ecx,1,0
  215.         mcall   ,,,0x00000002,[sc.work_button]
  216.         madd    ecx, (14*3+16)/3+1,0
  217.         mcall   ,,,0x00000003
  218.         madd    ecx, (14*3+16)/3+1,0
  219.         mcall   ,,,4
  220. ;button for OpenDialog [..]
  221.         mov     ebx, 5*65536+47
  222.         mov     ecx, 33*65536+14
  223.         mcall   ,,,5
  224.  
  225.         mpack   ebx,6,0    ; Draw Window Text
  226.         add     ebx,1+ 14/2-3
  227.         mcall   4,,[sc.work_text],text,text.line_size   ;InFile
  228.  
  229.         add     ebx, 16 ;14
  230.         add     edx,text.line_size
  231.         mcall   ;OutFile
  232.  
  233.         mov     ecx,[sc.work_button_text]
  234.         add     ebx, 16 ;14
  235.         add     edx,text.line_size
  236.         mcall   ;Path
  237.  
  238.         mov     ebx,[pinfo.box.width]
  239.         sub     ebx,MAGIC1+10+1-9
  240.         shl     ebx,16
  241.         add     ebx,1+( (14*3+16)/3-1)/2-3
  242.         mcall   ,,[sc.work_button_text],s_compile,7
  243.         add     ebx,(14*3+16)/3+1
  244.         mcall   ,,,s_run
  245.         add     ebx,(14*3+16)/3+1
  246.         mcall   ,,,s_debug
  247.        
  248.         mpack   ebx,MAGIC1+6,0
  249.         add     ebx,1+ 14/2-3+ 14*0
  250.         mov     esi,[pinfo.box.width]
  251.         sub     esi,MAGIC1*2+5*2+6+3
  252.         mov     eax,esi
  253.         mov     cl,6
  254.         div     cl
  255.         cmp     al,MAX_PATH
  256.         jbe     @f
  257.         mov     al,MAX_PATH
  258. @@:
  259.         movzx   esi,al
  260.  
  261.         call    draw_messages
  262.        
  263.         mov     eax,dword [pinfo.box.width]
  264.         sub     eax,127
  265.         mov     dword[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé
  266.         mov     dword[edit2.width],eax
  267.         mov     dword[edit3.width],eax
  268.        
  269.         push    dword edit1
  270.         call    [edit_box_draw]
  271.         push    dword edit2
  272.         call    [edit_box_draw]
  273.         push    dword edit3
  274.         call    [edit_box_draw]
  275.         push    dword ch1_dbg
  276.         call    [check_box_draw]
  277. .end:  
  278.         mcall   12,2 ; End of Draw
  279.         popa
  280.         ret
  281. ;---------------------------------------------------------------------
  282. bottom_right dd ?
  283.  
  284. align 4
  285. fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£ 
  286.         pushad
  287.         copy_path open_dialog_name,communication_area_default_path,library_path,0
  288.         mov     [OpenDialog_data.type],0
  289.  
  290.         xor     al,al
  291.         mov     edi,dword [edit3.text]
  292.         mov     ecx,dword [edit3.max]
  293.         cld
  294.         repne   scasb
  295.         cmp     byte[edi-2],'/'
  296.         jne     @f
  297.         mov     byte[edi-2],0 ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
  298. @@:
  299.         push    dword OpenDialog_data
  300.         call    dword [OpenDialog_Start]
  301.         cmp     [OpenDialog_data.status],2
  302.         je      @f
  303.  
  304.         xor     al,al
  305.         mov     edi,dword [edit3.text]
  306.         mov     ebx,edi ;copy text pointer
  307.         mov     ecx,dword [edit3.max]
  308.         cld
  309.         repne   scasb
  310.         cmp     byte[edi-2],'/'
  311.         jne     .no_slash
  312.        
  313.         dec     edi ;¥á«¨ ¢ ª®­æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à ç¨¢ ¥¬ ­  1 ᨬ¢®«
  314. .no_slash:
  315.         mov     byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®­æ¥ ¯ã⨠᫥è
  316.         mov     byte[edi],0 ;®â१ ¥¬ ¨¬ï ­ ©¤¥­­®£® ä ©« 
  317.         sub     edi,ebx ;edi = strlen(edit3.text)
  318.         mov     [edit3.size],edi
  319.         mov     [edit3.pos],edi
  320.  
  321.         push    dword [OpenDialog_data.filename_area]
  322.         push    dword edit1
  323.         call    dword [edit_box_set_text]
  324.  
  325.         push    dword [OpenDialog_data.filename_area]
  326.         push    dword edit2
  327.         call    dword [edit_box_set_text]
  328.  
  329.         mov     esi,[edit2.text]
  330.         xor     eax,eax
  331.         cld
  332. .cycle:
  333.         lodsb
  334.         test    eax,eax
  335.         jnz     .cycle
  336.  
  337.         sub     esi,5
  338.         cmp     esi,[edit2.text]
  339.         jle     .short_fn
  340.        
  341.         mov     byte[esi],0
  342.         sub     dword [edit2.size],4
  343.         sub     dword [edit2.pos],4
  344.  
  345. .short_fn:
  346.         push    dword edit1
  347.         call    dword [edit_box_draw]
  348.         push    dword edit2
  349.         call    dword [edit_box_draw]
  350.         push    dword edit3
  351.         call    dword [edit_box_draw]
  352. @@:
  353.         popad
  354.         ret
  355. ;---------------------------------------------------------------------
  356. draw_messages:
  357.         mpack   ebx,7-2,[pinfo.box.width]
  358.         sub     ebx,5*2+7*2-1-2*2
  359.         mpack   ecx,0,[pinfo.box.height]
  360.         madd    ecx, 14*3+16+1+7+1,-( 14*3+16+1+7*2+25)
  361.         mov     word[bottom_right+2],bx
  362.         mov     word[bottom_right],cx
  363.         msub    [bottom_right],7,11
  364.         add     [bottom_right],7 shl 16 + 53
  365.         mcall   13,,,[sc.work]  ; clear work area
  366. _cy = 0
  367. _sy = 2
  368. _cx = 4
  369. _sx = 6
  370.         push    ebx ecx
  371.         mpack   ebx,4,5
  372.         add     bx,[esp+_cx]
  373.         mov     ecx,[esp+_sy-2]
  374.         mov     cx,[esp+_sy]
  375.         msub    ecx,1,1
  376.         mcall   38,,,[sc.work_graph]
  377.         mov     si,[esp+_cy]
  378.         add     cx,si
  379.         shl     esi,16
  380.         add     ecx,esi
  381.         madd    ecx,1,1
  382.         mcall
  383.         mpack   ebx,4,4
  384.         mov     esi,[esp+_sy-2]
  385.         mov     si,cx
  386.         mov     ecx,esi
  387.         mcall
  388.         mov     si,[esp+_cx]
  389.         add     bx,si
  390.         shl     esi,16
  391.         add     ebx,esi
  392.         madd    ebx,1,1
  393.         mcall
  394.         pop     ecx ebx
  395.         ret
  396. ;---------------------------------------------------------------------
  397. ; DATA
  398. ;---------------------------------------------------------------------
  399. if lang eq ru
  400. text:
  401.   db ' ‚å” ©«:'
  402. .line_size = $-text
  403.   db '‚ë唠©«:'
  404.   db '   ãâì:'
  405.   ;db 'x'
  406.  
  407.   s_compile db 'Š®¬¯¨«.'
  408.   s_run     db ' ã᪠ '
  409.   s_debug   db 'Žâ« ¤ª '
  410.   s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
  411.  
  412.  
  413.   err_message_found_lib0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  box_lib.obj',0  ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
  414.   err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
  415.   err_message_found_lib1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  proc_lib.obj',0
  416.   err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0
  417.   head_f_i:
  418.   head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
  419. else
  420. text:
  421.   db ' InFile:'
  422. .line_size = $-text
  423.   db 'OutFile:'
  424.   db '   Path:'
  425.   ;db 'x'
  426.  
  427.   s_compile db 'COMPILE'
  428.   s_run     db '  RUN  '
  429.   s_debug   db ' DEBUG '
  430.   s_dbgdescr db 'Generate debug information',0
  431.  
  432.  
  433.   err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
  434.   err_message_import0 db 'Error on load import library box_lib.obj',0
  435.   err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
  436.   err_message_import1 db 'Error on load import library proc_lib.obj',0
  437.  
  438.   head_f_i:
  439.   head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
  440. end if
  441.  
  442.   system_dir0 db '/sys/lib/'
  443.   lib0_name db 'box_lib.obj',0
  444.  
  445.   system_dir1 db '/sys/lib/'
  446.   lib1_name db 'proc_lib.obj',0
  447. ;---------------------------------------------------------------------
  448. align 4
  449. import_box_lib:
  450. edit_box_draw           dd aEdit_box_draw
  451. edit_box_key            dd aEdit_box_key
  452. edit_box_mouse          dd aEdit_box_mouse
  453. edit_box_set_text       dd aEdit_box_set_text
  454. ;version_ed             dd aVersion_ed
  455.  
  456. init_checkbox           dd aInit_checkbox
  457. check_box_draw          dd aCheck_box_draw
  458. check_box_mouse         dd aCheck_box_mouse
  459. ;version_ch             dd aVersion_ch
  460.  
  461.                         dd 0,0
  462.  
  463. aEdit_box_draw          db 'edit_box',0
  464. aEdit_box_key           db 'edit_box_key',0
  465. aEdit_box_mouse         db 'edit_box_mouse',0
  466. aEdit_box_set_text      db 'edit_box_set_text',0
  467. ;aVersion_ed            db 'version_ed',0
  468.  
  469. aInit_checkbox          db 'init_checkbox2',0
  470. aCheck_box_draw         db 'check_box_draw2',0
  471. aCheck_box_mouse        db 'check_box_mouse2',0
  472. ;aVersion_ch            db 'version_ch2',0
  473. ;---------------------------------------------------------------------
  474. align 4
  475. import_proc_lib:
  476. OpenDialog_Init         dd aOpenDialog_Init
  477. OpenDialog_Start        dd aOpenDialog_Start
  478.                         dd 0,0
  479. aOpenDialog_Init        db 'OpenDialog_init',0
  480. aOpenDialog_Start       db 'OpenDialog_start',0
  481. ;---------------------------------------------------------------------
  482. ;library structures
  483. l_libs_start:
  484.   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
  485.   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
  486. load_lib_end:
  487.  
  488. edit1 edit_box 153, 56, 1, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (outfile-infile-1), infile, mouse_dd, 0, 11,11
  489. edit2 edit_box 153, 56, 17, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
  490. edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6
  491. editboxes_end:
  492. ch1_dbg check_box2 (5 shl 16)+12, (49 shl 16)+12, 6, 0xffffff, 0x80ff, 0, s_dbgdescr,ch_flag_bottom
  493. ;---------------------------------------------------------------------
  494. align 4
  495. OpenDialog_data:
  496. .type                   dd 0
  497. .procinfo               dd pinfo        ;+4
  498. .com_area_name          dd communication_area_name      ;+8
  499. .com_area               dd 0    ;+12
  500. .opendir_path           dd path ;+16
  501. .dir_default_path       dd default_dir ;+20
  502. .start_path             dd library_path ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  503. .draw_window            dd draw_window  ;+28
  504. .status                 dd 0    ;+32
  505. .openfile_path          dd path ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  506. .filename_area          dd filename_area        ;+40
  507. .filter_area            dd Filter
  508. .x:
  509. .x_size                 dw 420 ;+48 ; Window X size
  510. .x_start                dw 10 ;+50 ; Window X position
  511. .y:
  512. .y_size                 dw 320 ;+52 ; Window y size
  513. .y_start                dw 10 ;+54 ; Window Y position
  514.  
  515. default_dir db '/rd/1',0 ;¤¨à¥ªâ®à¨ï ¯® 㬮«ç ­¨î
  516.  
  517. communication_area_name:
  518.         db 'FFFFFFFF_open_dialog',0
  519. open_dialog_name:
  520.         db 'opendial',0
  521. communication_area_default_path:
  522.         db '/rd/1/File managers/',0
  523.  
  524. Filter:
  525. dd Filter.end - Filter
  526. .1:
  527. db 'ASM',0
  528. .end:
  529. db 0
  530. ;---------------------------------------------------------------------
  531. mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox
  532. ;---------------------------------------------------------------------
  533. infile    db 'example.asm'
  534.   times MAX_PATH-$+infile  db 0
  535. outfile db 'example'
  536.   times MAX_PATH-$+outfile db 0
  537. path    db '/rd/1//' ;OpenDialog ¯à¨ § ¯ã᪥ 㡨ࠥ⠯®á«¥¤­¨© á«¥è, ­® ¤¨ «®£ ¬®¦¥â ¨á¯®«ì§®¢ âìáï ­¥ ¢á¥£¤ , ¯®â®¬ã á«¥è  2
  538.   times MAX_PATH-$+path    db 0
  539. path_end:
  540. lf db 13,10,0
  541. ;---------------------------------------------------------------------
  542. mov_param_str:
  543.         cld
  544. @@:
  545.         lodsb
  546.         cmp     al,','
  547.         je      @f
  548.         stosb
  549.         test    al,al
  550.         jnz     @b
  551. @@:
  552.         xor     al,al
  553.         stosb
  554.         ret
  555. ;---------------------------------------------------------------------
  556. start:
  557.         cmp     [_mode],NORMAL_MODE
  558.         jne     @f
  559.         call    draw_messages
  560.         mov     [textxy],7 shl 16 + 70
  561. @@:
  562.         mov     esi,_logo
  563.         call    display_string
  564.  
  565. ;---------------------------------------------------------------------
  566. ;   Fasm native code
  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
  579.         bt      dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
  580.         jae     @f                        ;jz @f
  581.         call    symbol_dump
  582. @@:
  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
  596.         or      eax,eax
  597.         jz      display_bytes_count
  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
  617.         je      @f
  618.         mov     edx,outfile
  619.         call    make_fullpaths
  620.         xor     ecx,ecx
  621.         mcall   70,file_info_start
  622. @@:
  623.         jmp     exit_program
  624. ;---------------------------------------------------------------------
  625. include 'system.inc'
  626. include 'version.inc'
  627. include 'errors.inc'
  628. include 'symbdump.inc'
  629. include 'preproce.inc'
  630. include 'parser.inc'
  631. include 'exprpars.inc'
  632. include 'assemble.inc'
  633. include 'exprcalc.inc'
  634. include 'formats.inc'
  635. include 'x86_64.inc'
  636. include 'avx.inc'
  637. include 'tables.inc'
  638. include 'messages.inc'
  639. ;---------------------------------------------------------------------
  640. title db appname,VERSION_STRING,0
  641.  
  642. _logo db 'flat assembler  version ',VERSION_STRING,13,10,0
  643.  
  644. _passes_suffix db ' passes, ',0
  645. _seconds_suffix db ' seconds, ',0
  646. _bytes_suffix db ' bytes.',13,10,0
  647.  
  648. _include db 'INCLUDE',0
  649.  
  650. _counter db 4,'0000'
  651.  
  652. _mode          dd NORMAL_MODE
  653. _run_outfile  dd 0
  654. ;bGenerateDebugInfo db 0
  655.  
  656. sub_table:
  657. times $41 db $00
  658. times $1A db $20
  659. times $25 db $00
  660. times $10 db $20
  661. times $30 db $00
  662. times $10 db $50
  663. times $04 db $00,$01
  664. times $08 db $00
  665.  
  666. ;include_debug_strings
  667. program_end:
  668. ;  params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
  669. params  rb 4096
  670. cur_dir_path rb 4096
  671. library_path rb 4096
  672. filename_area rb 256
  673.  
  674. align 4
  675.  
  676. include 'variable.inc'
  677.  
  678. program_base dd ?
  679. buffer_address dd ?
  680. memory_setting dd ?
  681. start_time dd ?
  682. memblock        dd      ?
  683.  
  684. predefinitions rb 1000h
  685.  
  686. dbgfilename     rb      MAX_PATH+4
  687.  
  688. sc    system_colors
  689. max_handles = 8
  690. fileinfos rb (4+20+MAX_PATH)*max_handles
  691. fileinfos_end:
  692. pinfo process_information
  693.  
  694. align 1000h
  695. rb 1000h
  696. stacktop:
  697.