Subversion Repositories Kolibri OS

Rev

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