Subversion Repositories Kolibri OS

Rev

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