Subversion Repositories Kolibri OS

Rev

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