Subversion Repositories Kolibri OS

Rev

Rev 2093 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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