Subversion Repositories Kolibri OS

Rev

Rev 7859 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. ; flat assembler source
  3. ; Copyright (c) 1999-2020, Tomasz Grysztar.
  4. ; All rights reserved.
  5.  
  6. ; KolibriOS port by KolibriOS Team
  7.  
  8. format binary as ''
  9. appname equ 'flat assembler '
  10. ;-------------------------------------------------
  11. ; HEADER
  12. ;-------------------------------------------------
  13.         db 'MENUET01'  ; 8 byte id
  14.         dd 0x01  ; header version
  15.         dd START         ; program start
  16.         dd program_end ; program image size
  17.         dd stacktop      ; required amount of memory
  18.         dd stacktop      ; stack
  19.         dd params        ; parameters
  20.         dd cur_dir_path  ; icon
  21.         if defined import.data
  22.                 dd import.data
  23.         else
  24.                 dd 0
  25.         end if
  26. ;-------------------------------------------------
  27. ; INCLUDES
  28. ;-------------------------------------------------
  29. lang equ ru
  30. include 'kolibria.inc'
  31. include 'fasm.inc'
  32.  
  33. MAX_PATH       = 100
  34. struc path name:?& {
  35.         .:
  36.         db name
  37.         rb MAX_PATH-$+. }
  38. ;-------------------------------------------------
  39. ; CODE
  40. ;-------------------------------------------------
  41. use32
  42. include 'kolibri/osloader/osloader.inc'
  43. ;-------------------------------------------------
  44. parse_params:
  45.        
  46.         cmp [params],'/'
  47.         jnz @f
  48.         ret
  49. @@:
  50.         cmp     [params],0
  51.         jnz     .chunk.console
  52.         ret
  53.       .chunk.console:
  54.         mov     [_mode],CONSOLE_MODE
  55.         mov     dword [esp], CUI_START ; force retaddr to CUI_START
  56.  
  57.         mov     eax, '    '
  58.         mov     esi, 10
  59.         cld
  60.         mov     ecx, esi
  61.         mov     edi, infile
  62.         rep stosd
  63.         mov     ecx, esi
  64.         mov     edi, outfile
  65.         rep stosd
  66.         mov     ecx, esi
  67.         mov     edi, path
  68.         rep stosd
  69.  
  70.         or      ecx, -1
  71.         mov     edi, params
  72.         mov     al, ' '
  73.         repe scasb
  74.         mov     esi, edi
  75.         dec     esi
  76.  
  77.         mov     edi, dbgWord
  78.     @@: lodsb
  79.         scasb
  80.         jne     .NoOutDebugInfo
  81.         cmp     byte[edi], 0
  82.         jnz     @b
  83.  
  84.         cmp     byte[esi],' '
  85.         jne     .NoOutDebugInfo
  86.  
  87.         mov     edi,esi
  88.         mov     al,' '
  89.         repe    scasb
  90.         mov     esi,edi
  91.         dec     esi
  92.  
  93.         mov     edi,params
  94.     @@: lodsb
  95.         stosb
  96.         test    al,al
  97.         jnz     @b
  98.  
  99.         or      dword[ch1_dbg.flags],CB_FLAG_EN
  100.  
  101.  
  102.       .NoOutDebugInfo:
  103.         mov     [_mode],CONSOLE_MODE
  104.         regcall mov_param_str,,,,,params,infile
  105.         regcall mov_param_str,,,,,esi,outfile
  106.         regcall mov_param_str,,,,,esi,path
  107.         mov     eax, [esi-1]
  108.         cmp     al,','
  109.         jne     .locret
  110.         cmp     eax, ',run'
  111.         jne     .check_again
  112.         mov     [_run_outfile],1
  113.         jmp     .locret
  114.       .check_again:
  115.         cmp     eax, ',dbg'
  116.         jne     .locret
  117.         mov     [_run_outfile],2
  118.       .locret:
  119.         ret
  120. ;-------------------------------------------------
  121. START:      ; Start of execution
  122.         mov     edi, fileinfos
  123.         mov     ecx, (fileinfos_end-fileinfos)/4
  124.         or      eax, -1
  125.         rep     stosd
  126.         mcall   SF_SYS_MISC,SSF_HEAP_INIT
  127.  
  128.         call    parse_params
  129.         mcall   SF_SYS_MISC,SSF_MEM_ALLOC,$1000
  130.         mov     [file_io_notify.flags],eax
  131.  
  132.         call    LoadLibraries
  133.  
  134.         mcall   SF_SET_EVENTS_MASK,EVM_MOUSE_FILTER or EVM_MOUSE or EVM_BUTTON or EVM_KEY or EVM_REDRAW;0x80000027 ; filter events: 80000000h - don`t receive mouse events if wnd nonactive , 7 - allowed events: redraw,keypresses, button presses
  135.         invoke  init_checkbox,ch1_dbg
  136.         invoke  OpenDialog_Init,OpenDialog_data
  137.  
  138.         call    prepare_esp_and_redraw
  139. still:
  140.         sub     esp,4
  141.         mcall   SF_WAIT_EVENT      ; Wait here for event
  142.         movzx   ecx,al
  143.         jmp     [event_handlers+4*ecx]
  144. event_handlers  dd 0,do_redraw,key,button,0,0,mouse
  145. ;-------------------------------------------------
  146. key:                 ; Key
  147.         mcall   SF_GET_KEY       ; Read it and ignore
  148.         invoke  edit_box_key, edit1
  149.         invoke  edit_box_key, edit2
  150.         invoke  edit_box_key, edit3
  151.         ret
  152. ;-------------------------------------------------
  153. button:    ; Button in Window
  154.         mcall   SF_GET_BUTTON
  155.         movzx   ecx,ah
  156.         jmp     [button_handlers+4*ecx]
  157. button_handlers dd 0,btn_close,CUI_START,btn_runout,btn_rundbg,fun_opn_dlg
  158. ;-------------------------------------------------
  159. btn_close:
  160.         mcall   SF_TERMINATE_PROCESS
  161. ;-------------------------------------------------
  162. btn_runout:
  163.         mov     edx,outfile
  164.         call    make_fullpaths
  165.         mcall   SF_FILE,file_io_start
  166.         ret
  167. ;-------------------------------------------------
  168. btn_rundbg:
  169.         mov     edx,outfile
  170.         call    make_fullpaths
  171.         mcall   SF_FILE,file_io_debug
  172.         ret
  173. ;-------------------------------------------------
  174. mouse:
  175.         invoke  edit_box_mouse, edit1
  176.         invoke  edit_box_mouse, edit2
  177.         invoke  edit_box_mouse, edit3
  178.         invoke  check_box_mouse,ch1_dbg
  179.         ret
  180. ;-------------------------------------------------
  181. Edit_Update_Colors:
  182.         mov     [edi+EDIT_BOX.focus_border_color], ebx
  183.         mov     [edi+EDIT_BOX.blur_border_color], eax
  184.         ret
  185. ;-------------------------------------------------
  186. CheckBox_Update_Colors:
  187.         or eax, 0x10000000
  188.         mov     [edi+CHECK_BOX2.text_color], eax
  189.         mov     [edi+CHECK_BOX2.border_color], ebx
  190.         ret
  191. ;-------------------------------------------------
  192. accept_systemcolors:
  193.         mcall   SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  194.         or      [sc.work], $3000000
  195.         mov     esi, sc
  196.         mov     edi, sc_prev
  197.         mov     ecx, sizeof.system_colors/4
  198.         repe cmpsd
  199.         jne     .chunk.update_colors
  200.         ret
  201.       .chunk.update_colors:
  202.         inc     ecx    ; move back
  203.         sub     edi, 4 ; on first element
  204.         sub     esi, 4 ; that not match
  205.         rep movsd      ; copy only difference part
  206.         mov     eax, [sc.work]
  207.         mov     ebx, [sc.work_graph]
  208.         shr     eax, 1
  209.         shr     ebx, 1
  210.         and     eax, $7F7F7F
  211.         and     ebx, $7F7F7F
  212.         add     eax, ebx
  213.         regcall Edit_Update_Colors,eax, ebx,,,,edit1
  214.         regcall Edit_Update_Colors,eax, ebx,,,,edit2
  215.         regcall Edit_Update_Colors,eax, ebx,,,,edit3
  216.         mov     eax, [sc.work_text]
  217.         or      eax, $80000000
  218.         mov     ebx, [sc.work_graph]
  219.         regcall CheckBox_Update_Colors,eax, ebx,,,,ch1_dbg
  220.         ret
  221. ;-------------------------------------------------
  222. draw_window:
  223.         cmp     dword[PROCESS_INFO.client_box.width],WIN_MIN_W
  224.         jge     @f
  225.         mcall   67,-1,-1,WIN_MIN_W+20,-1
  226.         ret
  227. @@:
  228.         cmp     dword[PROCESS_INFO.client_box.height],WIN_MIN_H
  229.         jge     @f
  230.         mcall   67,-1,-1,-1,WIN_MIN_H+50
  231.         ret
  232. @@:
  233.         mpack   ebx,[PROCESS_INFO.client_box.width],RIGHT_BTN_W
  234.         msub    ebx,RIGHT_BTN_W+1,0
  235.         mcall   SF_DEFINE_BUTTON,ebx,<LINE_H*0+3,LINE_H-4>,ID_COMPILE_BTN,[sc.work_button]
  236.         mcallb  SF_DEFINE_BUTTON,ebx,<LINE_H*1+3,LINE_H-4>,ID_EXECUTE_BTN
  237.         mcallb  SF_DEFINE_BUTTON,ebx,<LINE_H*2+3,LINE_H-4>,ID_EXECDBG_BTN
  238.  
  239.         mcallb  SF_DEFINE_BUTTON,<5,62>,<LINE_H*2+3,LINE_H-5>,ID_OPENDLG_BTN ;button for OpenDialog [..]
  240.  
  241.         mov     ecx, [sc.work_text]
  242.         or      ecx, $10000000
  243.         mcall   SF_DRAW_TEXT,<6,LINE_H*0+6>,,text+text.line_size*0,text.line_size       ;InFile
  244.         mcallb  SF_DRAW_TEXT,<6,LINE_H*1+6>,,text+text.line_size*1,esi       ;OutFile
  245.         mov     ecx, [sc.work_button_text]
  246.         or      ecx, $10000000
  247.         mcallb  SF_DRAW_TEXT,<0,LINE_H*2+6>,,text+text.line_size*2,esi   ;Path
  248.  
  249.         mov     ebx,[PROCESS_INFO.client_box.width]
  250.         sub     ebx,RIGHT_BTN_W-11
  251.         shl     ebx,16
  252.         add     ebx,LINE_H/2-6
  253.         mov     ecx, [sc.work_button_text]
  254.         or      ecx, $10000000
  255.         mcallb  SF_DRAW_TEXT,ebx,ecx,s_compile,7
  256.         add     ebx,LINE_H
  257.         mcallb  SF_DRAW_TEXT,ebx,ecx,s_run
  258.         add     ebx,LINE_H
  259.         mcallb  SF_DRAW_TEXT,ebx,ecx,s_debug
  260.        
  261.         ;MAGIC1 = 6*(text.line_size-1)+14 ;MAGIC???? MAGIC??????????? GO FYSLF.
  262.         ;mpack  ebx,MAGIC1+6,1+ 14/2-3+ 14*0
  263.         ;mov    esi,[PROCESS_INFO.client_box.width]
  264.         ;sub    esi,MAGIC1*2+6+3
  265.         ;mov    eax,esi
  266.         ;mov    cl,6
  267.         ;div    cl
  268.         ;cmp    al,MAX_PATH
  269.         ;jbe    @f
  270.         ;mov    al,MAX_PATH
  271. ;@@:
  272.         movzx   esi,al
  273.  
  274.         call    draw_messages
  275.        
  276.         mov     eax,dword [PROCESS_INFO.client_box.width]
  277.         sub     eax,[edit1.left]
  278.         sub     eax,RIGHT_BTN_W+6
  279.         mov     dword[edit1.width],eax
  280.         mov     dword[edit2.width],eax
  281.         mov     dword[edit3.width],eax
  282.         invoke  edit_box_draw, edit1
  283.         invoke  edit_box_draw, edit2
  284.         invoke  edit_box_draw, edit3
  285.         invoke  check_box_draw, ch1_dbg
  286.         ret
  287. ;-------------------------------------------------
  288. prepare_esp_and_redraw:
  289.         mov     [processing_esp],esp
  290. do_redraw:
  291.         pusha
  292.         mcall   SF_REDRAW,SSF_BEGIN_DRAW ; Start of draw
  293.        
  294.         call    accept_systemcolors
  295.         mov     edx,[sc.work]
  296.         or      edx,CW_CAPTION or CW_CLIENTRECTCOORDS or CW_SKINED;0x33000000
  297.         mcall   SF_CREATE_WINDOW,<150,DEFAULT_WIN_W>,<150,DEFAULT_WIN_H>,edx,,title
  298.         mcall   SF_THREAD_INFO,PROCESS_INFO,-1
  299.  
  300.         mov     eax,dword[PROCESS_INFO.wnd_state] ;status of window
  301.         test    eax,100b
  302.         jnz     .skip_draw_window
  303.         call    draw_window
  304. .skip_draw_window:
  305.         mcall   SF_REDRAW,SSF_END_DRAW ; End of Draw
  306.         popa
  307.         ret
  308. ;---------------------------------------------------------------------
  309. bottom_right dd ?
  310.  
  311. align 4
  312. fun_opn_dlg:
  313.         pushad
  314.         mov     edx, open_dialog_name
  315.         mov     edi, communication_area_default_path
  316.         mov     esi, library_path
  317.         call    @copy_path_wo_pdname
  318.         mov     [OpenDialog_data.type], 0
  319.  
  320.         xor     al, al
  321.         mov     edi, dword [edit3.text]
  322.         mov     ecx, dword [edit3.max]
  323.         cld
  324.         repne   scasb
  325.         cmp     byte[edi-2], '/'
  326.         jne     @f
  327.         mov     byte[edi-2], 0 ;if last symbol is slash cut it off
  328. @@:
  329.         invoke  OpenDialog_Start, OpenDialog_data
  330.         cmp     [OpenDialog_data.status], 2
  331.         je      @f
  332.  
  333.         xor     al, al
  334.         mov     edi, dword [edit3.text]
  335.         mov     ebx, edi ;copy text pointer
  336.         mov     ecx, dword [edit3.max]
  337.         cld
  338.         repne   scasb
  339.         cmp     byte[edi-2], '/'
  340.         jne     .no_slash
  341.        
  342.         dec     edi ;if last symbol is slash cut it off
  343. .no_slash:
  344.         mov     byte[edi-1], '/' ;add slash as last symbol
  345.         mov     byte[edi], 0 ;cut off file name
  346.         sub     edi, ebx ;edi = strlen(edit3.text)
  347.         mov     [edit3.size], edi
  348.         mov     [edit3.pos], edi
  349.         invoke  edit_box_set_text, edit1, [OpenDialog_data.filename_area]
  350.         invoke  edit_box_set_text, edit2, [OpenDialog_data.filename_area]
  351.  
  352.         mov     esi, [edit2.text]
  353.         xor     eax, eax
  354.         cld
  355. .cycle:
  356.         lodsb
  357.         test    eax, eax
  358.         jnz     .cycle
  359.  
  360.         sub     esi, 5
  361.         cmp     esi, [edit2.text]
  362.         jle     .short_fn
  363.        
  364.         mov     byte[esi], 0
  365.         sub     dword [edit2.size], 4
  366.         sub     dword [edit2.pos], 4
  367.  
  368. .short_fn:
  369.         invoke  edit_box_draw, edit1
  370.         invoke  edit_box_draw, edit2
  371.         invoke  edit_box_draw, edit3
  372. @@:
  373.         popad
  374.         ret
  375. ;---------------------------------------------------------------------
  376. draw_messages:
  377.         mpack   ebx, 5,[PROCESS_INFO.client_box.width]
  378.         sub     ebx, 9
  379.         mpack   ecx, 0,[PROCESS_INFO.client_box.height]
  380.         madd    ecx, LINE_H*4,-( LINE_H*4+5)
  381.         mov     word[bottom_right+2], bx
  382.         mov     word[bottom_right], cx
  383.         msub    [bottom_right], 7,11
  384.         add     [bottom_right], 7 shl 16 + 53
  385.         mcall   SF_DRAW_RECT,,,0xFeFefe  ; clear work area
  386.  
  387.         ; draw top shadow
  388.         push ecx
  389.         mov cx,1
  390.         mov edx,0xDADEDA
  391.         mcall
  392.        
  393.         ; draw left shadow
  394.         pop  ecx
  395.         push ebx
  396.         mov bx,1
  397.         mcall
  398.         pop  ebx       
  399.  
  400. _cy = 0
  401. _sy = 2
  402. _cx = 4
  403. _sx = 6
  404.         push    ebx ecx
  405.         mpack   ebx, 4,5
  406.         add     bx, [esp+_cx]
  407.         mov     ecx, [esp+_sy-2]
  408.         mov     cx, [esp+_sy]
  409.         msub    ecx, 1,1
  410.         mcall   SF_DRAW_LINE,,,[sc.work_graph]
  411.         mov     si, [esp+_cy]
  412.         add     cx, si
  413.         shl     esi, 16
  414.         add     ecx, esi
  415.         madd    ecx, 1,1
  416.         mcallb  SF_DRAW_LINE
  417.         mpack   ebx, 4,4
  418.         mov     esi, [esp+_sy-2]
  419.         mov     si, cx
  420.         mov     ecx, esi
  421.         mcallb  SF_DRAW_LINE
  422.         mov     si,[esp+_cx]
  423.         add     bx,si
  424.         shl     esi,16
  425.         add     ebx,esi
  426.         madd    ebx,1,1
  427.         mcallb  SF_DRAW_LINE
  428.         pop     ecx ebx
  429.         ret
  430. ;---------------------------------------------------------------------
  431. mov_param_str:
  432.         cld
  433. @@:
  434.         lodsb
  435.         cmp     al,','
  436.         je      @f
  437.         stosb
  438.         test    al,al
  439.         jnz     @b
  440. @@:
  441.         xor     al,al
  442.         stosb
  443.         ret
  444. ;---------------------------------------------------------------------
  445. CUI_START:
  446.         cmp     [_mode],NORMAL_MODE
  447.         jne     @f
  448.         call    draw_messages
  449.         mov     [textxy],8 shl 16 + LINE_H*4+4
  450. @@:
  451.         mov     esi,_logo
  452.         call    display_string
  453.  
  454. ;---------------------------------------------------------------------
  455. ;   Fasm native code
  456. ;---------------------------------------------------------------------
  457.         mov     [input_file],infile
  458.         mov     [output_file],outfile
  459.        
  460.         call    init_memory
  461.        
  462.         call    make_timestamp
  463.         mov     [start_time],eax
  464.        
  465.         call    preprocessor
  466.         call    parser
  467.         call    assembler
  468.         bt      dword[ch1_dbg.flags],1 ;cmp [bGenerateDebugInfo], 0
  469.         jae     @f                        ;jz @f
  470.         call    symbol_dump
  471. @@:
  472.         call    formatter
  473.        
  474.         call    display_user_messages
  475.         movzx   eax,[current_pass]
  476.         inc     eax
  477.         call    display_number
  478.         mov     esi,_passes_suffix
  479.         call    display_string
  480.         call    make_timestamp
  481.         sub     eax,[start_time]
  482.         xor     edx,edx
  483.         mov     ebx,100
  484.         div     ebx
  485.         or      eax,eax
  486.         jz      display_bytes_count
  487.         xor     edx,edx
  488.         mov     ebx,10
  489.         div     ebx
  490.         push    edx
  491.         call    display_number
  492.         mov     dl,'.'
  493.         call    display_character
  494.         pop     eax
  495.         call    display_number
  496.         mov     esi,_seconds_suffix
  497.         call    display_string
  498. display_bytes_count:
  499.         mov     eax,[written_size]
  500.         call    display_number
  501.         mov     esi,_bytes_suffix
  502.         call    display_string
  503.         xor     al,al
  504.        
  505.         cmp     [_run_outfile],0
  506.         je      @f
  507.         mov     edx,outfile
  508.         call    make_fullpaths
  509.         xor     ecx,ecx
  510.  
  511.         cmp     [_run_outfile],2 ; param is ',dbg'
  512.         jne     run
  513.         mcall   SF_FILE,file_io_debug
  514.         jmp     @f
  515. run:
  516.         mcall   SF_FILE,file_io_start
  517. @@:
  518.         jmp     exit_program
  519.        
  520. ;---------------------------------------------------------------------
  521. include 'system.inc'
  522. include 'core/version.inc'
  523. include 'core/errors.inc'
  524. include 'core/symbdump.inc'
  525. include 'core/preproce.inc'
  526. include 'core/parser.inc'
  527. include 'core/exprpars.inc'
  528. include 'core/assemble.inc'
  529. include 'core/exprcalc.inc'
  530. include 'core/formats.inc'
  531. include 'core/x86_64.inc'
  532. include 'core/avx.inc'
  533. include 'core/tables.inc'
  534. include 'core/messages.inc'
  535. ;---------------------------------------------------------------------
  536. ; IMPORT
  537. ;---------------------------------------------------------------------
  538.   library box_lib,'box_lib.obj',\
  539.           proc_lib,'proc_lib.obj'
  540.  
  541.   import box_lib,edit_box_draw,'edit_box',\
  542.                  edit_box_key,'edit_box_key',\
  543.                  edit_box_mouse,'edit_box_mouse',\
  544.                  edit_box_set_text,'edit_box_set_text',\
  545.                  version_ed,'version_ed',\
  546.                  init_checkbox,'init_checkbox2',\
  547.                  check_box_draw,'check_box_draw2',\
  548.                  check_box_mouse,'check_box_mouse2',\
  549.                  version_ch,'version_ch'
  550.  
  551.   import proc_lib,OpenDialog_Init,'OpenDialog_init',\
  552.                   OpenDialog_Start,'OpenDialog_start'
  553. ;---------------------------------------------------------------------
  554. ; INITIALIZED DATA
  555. ;---------------------------------------------------------------------
  556. ;match =en,lang {include 'lang/en.inc'}
  557. ;match =ru,lang {include 'lang/ru.inc'}
  558.  
  559. include 'traslations.inc'
  560.  
  561. edit1 EDIT_BOX 153, 72, 3,          0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11
  562. edit2 EDIT_BOX 153, 72, LINE_H+3,   0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path-outfile-1), outfile, mouse_dd, 0, 7,7
  563. edit3 EDIT_BOX 153, 72, LINE_H*2+3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(path_end-path-1), path, mouse_dd, 0, 6,6
  564. editboxes_end:
  565. ch1_dbg CHECK_BOX2 (5 shl 16)+15, ((LINE_H*3+3) shl 16)+15, 6, 0xffffff, 0x80ff, 0x10000000, s_dbgdescr,CB_FLAG_TOP
  566. ;---------------------------------------------------------------------
  567. align 4
  568. OpenDialog_data OPEN_DLG 0,PROCESS_INFO,communication_area_name,0,path,default_dir,library_path,do_redraw,0,path,filename_area,Filter,420,10,320,10
  569.  
  570. default_dir     db '/rd/1',0
  571.  
  572. communication_area_name db 'FFFFFFFF_open_dialog',0
  573. open_dialog_name        db 'opendial',0
  574. communication_area_default_path db '/rd/1/File managers/',0
  575.  
  576. Filter:
  577.         dd Filter.end - Filter
  578.       .1:
  579.         db 'ASM',0
  580.       .end:
  581.         db 0
  582.  
  583.  
  584. ;---------------------------------------------------------------------
  585. mouse_dd dd 0 ;needed for Shift in editbox
  586. ;---------------------------------------------------------------------
  587. infile  path 'example.asm',0
  588. outfile path 'example',0
  589. path    path '/rd/1//',0
  590. path_end:
  591. crlf    db $D,$A,0
  592. title   db appname,VERSION_STRING,0
  593.  
  594. _logo   db 'flat assembler  version ',VERSION_STRING,$D,$A,0
  595.  
  596. _passes_suffix  db ' passes, ',0
  597. _seconds_suffix db ' seconds, ',0
  598. _bytes_suffix   db ' bytes.',$D,$A,0
  599.  
  600. _include        db 'INCLUDE',0
  601.  
  602. _counter        db 4,'0000'
  603.  
  604. _mode           dd NORMAL_MODE
  605. _run_outfile    dd 0
  606.  
  607. dbgWord         db '-d',0
  608.  
  609. character   db ?,0
  610.  
  611. textxy   dd 5:$A0
  612. dc       db 0
  613. filesize dd 0
  614.  
  615.  
  616. error_prefix            db 'error: ',0
  617. error_suffix            db '.',0
  618. line_data_start         db ':'
  619. line_number_start       db ' [',0
  620.  
  621. import_loader.state dd 0
  622. file_io_notify          FILEIO SSF_START_APP
  623. file_io_notify.path     db 0
  624. file_io_notify.lppath   dd notify_path
  625. notify_path             db '/rd/1/@notify',0
  626.  
  627. file_io_start           FILEIO SSF_START_APP
  628. file_io_start.path      path
  629.  
  630. file_io_debug           FILEIO SSF_START_APP,0,file_io_start.path
  631. file_io_debug.path      db '/SYS/DEVELOP/MTDBG',0
  632. _ramdisk                db '/rd/1/'
  633. filepos                 dd 0
  634.  
  635. sub_table:
  636. times $41 db $00
  637. times $1A db $20
  638. times $25 db $00
  639. times $10 db $20
  640. times $30 db $00
  641. times $10 db $50
  642. times $04 db $00,$01
  643. times $08 db $00
  644. program_end:
  645. ;---------------------------------------------------------------------
  646. ; UNINITIALIZED DATA
  647. ;---------------------------------------------------------------------
  648. params          rb $1000
  649. cur_dir_path    rb $1000
  650. library_path    rb $1000
  651. filename_area   rb $100
  652.  
  653. align 4
  654.  
  655. include 'core/variable.inc'
  656.  
  657. align 4
  658.  
  659. program_base    dd ?
  660. buffer_address  dd ?
  661. memory_setting  dd ?
  662. start_time      dd ?
  663. memblock        dd ?
  664.  
  665. fileinfo        FILEINFO
  666.  
  667. predefinitions  rb $1000
  668.  
  669. fullpath_open   path
  670. fullpath_write  path
  671. dbgfilename     rb MAX_PATH+4
  672.  
  673. sc              system_colors
  674. sc_prev         system_colors
  675. max_handles = 8
  676. fileinfos       rb (4+20+MAX_PATH)*max_handles
  677. fileinfos_end:
  678. PROCESS_INFO    process_information
  679.  
  680. bytes_count dd ?
  681. displayed_count dd ?
  682. last_displayed  rb 2
  683. processing_esp dd ?
  684.  
  685. align 1000h
  686. ;---------------------------------------------------------------------
  687. ; STACK
  688. ;---------------------------------------------------------------------
  689.                 rb $1000
  690. stacktop:
  691.