Subversion Repositories Kolibri OS

Rev

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

  1. ; Copyright (c) 2009, <Lrz>
  2. ; All rights reserved.
  3. ;
  4. ; Redistribution and use in source and binary forms, with or without
  5. ; modification, are permitted provided that the following conditions are met:
  6. ;       * Redistributions of source code must retain the above copyright
  7. ;       notice, this list of conditions and the following disclaimer.
  8. ;       * Redistributions in binary form must reproduce the above copyright
  9. ;       notice, this list of conditions and the following disclaimer in the
  10. ;       documentation and/or other materials provided with the distribution.
  11. ;       * Neither the name of the <organization> nor the
  12. ;       names of its contributors may be used to endorse or promote products
  13. ;       derived from this software without specific prior written permission.
  14. ;
  15. ; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
  16. ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. ; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
  19. ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22. ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. ;*****************************************************************************
  26.  
  27. ;òóò ðàñïîëîãàåòñÿ ìîäóëü ñ ïîìîùüþ êîòîðîãî áóäóò ïàðñèòüñÿ âñå îñòàëüíûå ñåêöèè
  28. color_sym_black equ     0
  29. color_sym_blue  equ     1
  30. color_sym_green equ     2
  31. color_sym_turquoise equ 3
  32. color_sym_red   equ     4
  33.  
  34. color_sym_lightgray equ 7
  35.  
  36. color_sym_lightblue equ 9
  37. color_sym_lettuce   equ 10
  38. color_sym_pink  equ     12
  39. color_sym_yellow equ    14
  40.  
  41. macro use_any_sec
  42. {
  43. ;óçíàåì ðàáîòó ïðåäûäóùåãî øàãà ò.å. ÷åìó = timeout, åñëè îí 0, òî âèçóàëüíàÿ ÷àñòü íå áóäåò îòîáðàæåíà íà äèñïëåå ñ âûáîðîì çàãðóçî÷íûõ ñåêöèé.
  44. ;èíà÷å ìû åå äîëæíû îòîáðàçèòü è æäàòü çàÿâëåíîå âðåìÿ äëÿ âûáîðà è êîíèãóðèðîâàíèÿ ïóêíêòîâ ñåêöèè îò ïîëüçîâàòåëÿ.
  45.  
  46. if DEBUG        
  47.         pusha
  48.         mov     ax,word [value_timeout] ;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè
  49. ;        mov     ax,cx
  50.         mov     cx,0x0a
  51.         mov     di,show_db1
  52.         mov     dword[ds:di],'    '
  53.         mov     word [ds:di+4],'  '
  54.         call    decode
  55. ;Show size
  56.         mov     si,show_db1
  57.         call    printplain
  58. ;
  59.         popa
  60. end if  
  61.  
  62.         test    ax,ax
  63.         jz      .parse_run_only
  64.  
  65. ;îòîáðàçèì ïîëíûé ñïèñîê âñåõ íàéäåíûõ ñåêöèé.
  66. if DEBUG
  67.         pusha
  68.         mov     si,show_all_sect
  69.         call    printplain
  70.         popa
  71. end if
  72. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  73.         mov     al, 0xf6        ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå
  74.         out     0x60, al
  75.         xor     cx, cx
  76. .wait_loop:       ; variant 2
  77. ; reading state of port of 8042 controller
  78.         in      al, 64h
  79.         and     al, 00000010b  ; ready flag
  80. ; wait until 8042 controller is ready
  81.         loopnz  .wait_loop
  82.  
  83.  
  84. ; set keyboard typematic rate & delay
  85.         mov     al, 0xf3
  86.         out     0x60, al
  87.         xor     cx, cx
  88. @@:
  89.         in      al, 64h
  90.         test    al, 2
  91.         loopnz  @b
  92.         mov     al, 0
  93.         out     0x60, al
  94.         xor     cx, cx
  95. @@:
  96.         in      al, 64h
  97.         test    al, 2
  98.         loopnz  @b
  99. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  100. ; get start time
  101.         call    gettime
  102.         mov     dword [start_timer],eax
  103.         mov     word [timer_],newtimer
  104.         mov     word [timer_+2],cs
  105. ;óñòàíîâèòü ñâîå ïðåðûâàíèå íà òàéìåð ò.å. êîä áóäåò ïåððûâàòüñÿ ~18 ðàç â ñåê è ïåðåõîäèòü íà îáðàáîò÷èê
  106.         cli
  107.         push    0
  108.         pop     es
  109.         push    dword [es:8*4]
  110.         pop     dword [old_timer]
  111.         push    dword [timer_]
  112.         pop     dword [es:8*4]    
  113.         sti
  114.  
  115. ;ïðîöåäóðà ôîðìèðîâàíèÿ áóôåðà äëÿ ñêðîëèíãà ñåêöèé
  116. ;if DEBUG        
  117. ;        pusha
  118. ;       mov     ax,point_default
  119. ;        mov     ax,cx
  120. ;        mov     cx,0x0a
  121. ;        mov     di,show_db1
  122. ;        mov     dword[ds:di],'    '
  123. ;       mov     word [ds:di+4],'  '
  124. ;        call    decode                                                                    
  125. ;Show size
  126. ;        mov     si,show_db1
  127. ;        call    printplain
  128. ;
  129. ;       xor     ax,ax
  130. ;       int     0x16
  131. ;        popa
  132. ;end if  
  133. ;;;;;;;;;;;;;ðàçìåð ïðåäûäóùåé ñåöèè óñòàíîâèì =0
  134.         mov     save_descript_size,18
  135. ;îòîáðàçèòü black screen
  136. show_bl_sc      ;es=0xb800
  137. .show_all_scr:
  138. get_frame_buffer  ;es=0x2000
  139. ;îòîáðàæåíèå ñåêöèé
  140.         call    show_bl_sc_sect   ;es=0xb800
  141. ;îòîáðàçèòü àêòèâíûé êóðñîð
  142. .show_active_cursor:
  143. show_act_cursor
  144. show_descript   ;ìàêðîñ ïî îòîáðàæåíèþ îïèñàíèÿ ñåêöèè
  145.  
  146. ;îòîáðàçèòü Press any key ....
  147.         mov     eax,dword [old_timer]
  148.         cmp     eax,dword [timer_]
  149.         jz      .interrupt_16
  150.  
  151. show_timer_message
  152.         mov word [start_stack],sp
  153. .interrupt_16:
  154.         xor     ax,ax   ;ïîëó÷èì èíôîðìàöèþ î òîì ÷òî íàæàòî
  155.         int     0x16
  156. ;check on change
  157.         mov     ebx,dword [old_timer]
  158.         cmp     ebx,dword [timer_]
  159.         jz      @f
  160. ;restore timer interrupt
  161.         cli
  162.         push    0
  163.         pop     es
  164. ;        mov     eax,dword [old_timer]  ; âîññòàíîâèì ïðåæäíåå ïðåðûâàíèå
  165.         mov     [es:8*4],ebx
  166.         mov     dword [timer_],ebx
  167.         sti
  168.        
  169.         push    ax      
  170. clear_timer_msg
  171.         pop     ax
  172. @@:
  173.         call    clean_active_cursor   ;clean old cursor   ;es=0xb800
  174.  
  175.         cmp     ah,0x48  ;ðåàêöèÿ ñèñòåìû íà ñîáûòèÿ
  176.         jz      .up
  177.         cmp     ah,0x50
  178.         jz      .down
  179.         cmp     ah,0x49
  180.         jz      .pgup
  181.         cmp     ah,0x51
  182.         jz      .pgdown
  183.         cmp     ah,0x47
  184.         jz      .home
  185.         cmp     ah,0x4f
  186.         jz      .end
  187.  
  188.         cmp     al,0xD
  189.         jnz     .show_active_cursor
  190.  
  191.         jmp     .end_show_all           ;ïàðñèíã ñåêöèè êîòîðàÿ óêàçàíà â point_default
  192. .up:
  193.         mov     si,point_to_point_def   ;çíà÷åíèå óêàçàòåëÿ
  194.         add     si,2
  195.         lea     ax,point_to_hframe
  196.  
  197.         cmp     si,ax
  198.         ja      @f
  199.  
  200.         mov     point_to_point_def,si
  201.         mov     ax,[si]
  202.         mov     point_default,ax
  203.         jmp     .show_active_cursor
  204. @@:    
  205.         call    find_before_sect
  206.         jmp     .show_all_scr
  207.  
  208.  
  209.  
  210. .down:
  211.         mov     si,point_to_point_def   ;çíà÷åíèå óêàçàòåëÿ
  212.         mov     ax,point_to_eframe      ;óêàçàòåëü íà ïîñëåäíèé ýëåìåíò
  213.         sub     si,2
  214.         cmp     si,ax
  215.         jb      @f
  216.  
  217.         mov     point_to_point_def,si
  218.         mov     ax,[si]
  219.         mov     point_default,ax
  220.         jmp     .show_active_cursor
  221.  
  222. @@:     call    find_next_sect
  223.         jmp     .show_all_scr
  224.  
  225. .pgup:
  226.         mov     cx,size_show_section
  227. @@:
  228.         push    cx
  229.         call    find_before_sect
  230.         pop     cx
  231.         loop    @b
  232.         jmp     .show_all_scr
  233.  
  234.  
  235. .pgdown:
  236.         mov     cx,size_show_section
  237. @@:
  238.         push    cx
  239.         call    find_next_sect
  240.         pop     cx
  241.         loop    @b
  242.         jmp     .show_all_scr
  243.  
  244. .home:
  245.         xor     di,di
  246.         call    find_next_sect.h        
  247.         jmp     .show_all_scr
  248.  
  249. .end:
  250.         mov     di,save_cx
  251.         call    find_before_sect.e
  252.         jmp     .show_all_scr
  253.  
  254.  
  255.  
  256.  
  257. ; òóò ìû áóäåì ïàðñèòü òîëüêî äåôîëòíóþ ñåêöèþ è âûïîëíÿòü åå íè÷åãî íå ïðåäëàãàÿ ïîëüçîâàòåëþ èç äèàëîãîâ.
  258. .parse_run_only:
  259. if DEBUG
  260.         pusha
  261.         mov     si,no_show_only_w
  262.         call    printplain
  263.         popa
  264. end if
  265.  
  266.  
  267. .end_show_all:
  268. }
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284. ;show black screen SL
  285. macro show_bl_sc
  286. {
  287. ;;;;;;;;;;;;;;;
  288. ;î÷èñòèì ýêðàí è âûâåäåì ìåíþ
  289. ; draw frames
  290.         xor     ax,ax
  291. if DEBUG
  292.         mov     ax,0x0720
  293. end if
  294.         push    0xb800
  295.         pop     es
  296.         xor     di, di
  297. ; draw top
  298.         mov     cx, 25 * 80
  299.         rep     stosw
  300. ;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx'
  301.         mov     di,164
  302.         mov     si,version
  303.         mov     cx,version_end-version
  304.         mov     ah,color_sym_yellow
  305. @@:
  306.         lodsb
  307.         stosw
  308.         loop @b
  309. ;;;;;;;;;;;;;;;;;;;;;;; show firm ))
  310.         mov     di,(2*160-(2*(soft_mes_end-soft_mes+4)))        ;286
  311.         mov     ah,color_sym_pink;color_sym_red
  312.         mov     al,'K'
  313.         stosw
  314.         mov     al,' '
  315.         stosw
  316.         mov     ah,color_sym_lightgray;color_sym_lightblue;color_sym_pink
  317.         mov     si,soft_mes
  318.         mov     cx,soft_mes_end- soft_mes
  319. @@:
  320.         lodsb
  321.         stosw
  322.         loop @b
  323. ;;;;;;;;;;;;;;;;;;;;;;; show '__________________________'
  324.         mov     di,480
  325.         mov     ah,color_sym_yellow
  326.         mov     al,'Ä'
  327.         mov     cx,61
  328.         rep     stosw
  329. ;;;;;;;;;;;;;;;;;;;;;;; show 'Select section'
  330.         mov     di,804
  331.         mov     si,select_section
  332.         mov     cx,select_section_end - select_section
  333.         mov     ah,color_sym_lightgray
  334. @@:
  335.         lodsb
  336.         stosw
  337.         loop @b
  338. ;;;;;;;;;;;;;;;;;;;;;;; show 'Section description'
  339.         mov     di,880
  340.         mov     si,section_description
  341.         mov     cx,section_description_end - section_description
  342. ;       mov     ah,color_sym_lightgray
  343. @@:
  344.         lodsb
  345.         stosw
  346.         loop @b
  347.  
  348. }
  349.  
  350. macro show_timer_message
  351. {
  352. ;;;;;;;;;;;;;;;;;;;;; show Press any key
  353. ;;;;;;;;;;;;;;;;;;;;; show ramk
  354.  
  355.         xor     ax,ax
  356.         mov     di,3360
  357.         mov     cx,80*4
  358.         rep     stosw
  359.  
  360.         mov     di,3362    
  361.         mov     ah,color_sym_pink
  362.         mov     al,0xDA
  363.         stosw
  364.         mov     al,0xc4
  365.         mov     cx,76
  366.         rep     stosw
  367.         mov     al,0xBF
  368.         stosw
  369.         add     di,4
  370.         mov     al,0xb3
  371.         stosw
  372.         add     di,152
  373.         stosw
  374.         add     di,4
  375.         stosw
  376.         add     di,152
  377.         stosw
  378.         add     di,4
  379.         mov     al,0xc0
  380.         stosw
  381.         mov     al,0xc4
  382.         mov     cx,76
  383.         rep     stosw
  384.         mov     al,0xd9
  385.         stosw
  386. ;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show
  387. ;show first message
  388.         mov     si,start_msg
  389.         mov     cx,start_msg_e-start_msg
  390.         mov     di,3526
  391. @@:
  392.         lodsb
  393.         stosw
  394.         loop @b
  395. ;;;;;;;;;;;;;;;;;;;; show press Enter to....
  396.         add     di,44
  397.         mov     si,time_msg
  398.         mov     cx,time_msg_e-time_msg
  399. @@:
  400.         lodsb
  401.         stosw
  402.         loop @b
  403. }
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412. macro get_frame_buffer
  413. {
  414.         mov     cx,save_cx      ;it's placed size of ini file
  415.         les     di,dword [file_data]
  416.  
  417.         mov     si,di   ;point frame
  418.         mov     bx,cx
  419.         mov     dx,size_show_section
  420. ;       mov     point_to_hframe,di      ; âíåñåì çíà÷åíèå, òàê ïîäñòðàõîâêà íå áîëåå
  421.  
  422.         mov     al,byte [es:di]
  423.         push    word .first_ret_bl_sc
  424.         cmp     al,' '
  425.         jz      .first_bl_sc
  426.         jmp     get_firs_sym.not_space
  427. .first_bl_sc:
  428.         jmp     get_firs_sym.first_sp
  429.  
  430. .start_hbl:              
  431.         call    get_firs_sym    ;get first symbol on new line
  432.         test    cx,cx
  433.         jz      error.correct_exit_bl   ;critical error not found default point it's not possible because it's param chacking before
  434.         cmp     al,'['
  435.         jnz     .start_hbl
  436.  
  437.         mov     si,di    ;point frame
  438.         mov     bx,cx
  439.         mov     dx,size_show_section
  440.         jmp     .analisist_al
  441.  
  442.  
  443. .start_bl:
  444.         call    get_firs_sym    ;get first symbol on new line
  445. .first_ret_bl_sc:                     ;ïåðâûé âîçâðàò
  446.         test    cx,cx
  447.         jz      error.correct_exit_bl   ;critical error not found default point it's not possible because it's param chacking before
  448. .analisist_al:
  449.         cmp     al,'['
  450.         jnz     .start_bl
  451. ;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default
  452. ;ïîèñê ôðåéìà â êîòîðîì ñîäåðæèòüñÿ çíà÷åíèå default
  453. .found_sect_bl:
  454.         cmp     di,point_loader
  455.         jz      .start_bl
  456.         cmp     di,point_default
  457.         jz      .save_point_def
  458.  
  459.         dec     dx
  460.         jnz     .start_bl
  461.  
  462.         jmp     .start_hbl
  463.  
  464.  
  465. .save_point_def:
  466. ;èòàê äàëåå ìû äîëæíû çàïîëíèòü frame áóôåð àäðåñîâ ñåêöèé, ÷òî áû ïîòîì ïî íåìó áûñòðî ïåðåìåùàòüñÿ íå âû÷èñëÿÿ ñíîâà àäðåñà
  467.         mov     di,si   ;óêàçàòåëü íà íà÷àëî
  468.         mov     cx,bx
  469.         lea     si,point_to_hframe
  470.         mov     dx,size_show_section+1   ;ò.ê. ó íàñ ñòðóêòóðà ñîäåðæèò ðàçìåð ìåæäó ïåðâûì è âòîðûì óêàçàòåëåì, òî íàì íóæíî íà 1 àäðåñ áîëüøå îáñ÷èòàòü ñåêöèé.
  471. ;ïåðåõîäèì íà îáðàáîòêó çíà÷åíèÿ óêàçàòåëÿ
  472.         mov     al,byte [es:di]
  473.         push    word .first_ret_mfb
  474.         cmp     al,' '
  475.         jz      .first_bl_mbf
  476.         jmp     get_firs_sym.not_space
  477. .first_bl_mbf:
  478.         jmp     get_firs_sym.first_sp
  479.  
  480. .start_mfb:
  481.         call    get_firs_sym    ;get first symbol on new line
  482. .first_ret_mfb:                     ;ïåðâûé âîçâðàò
  483.         jcxz    .val_buff_comp  ;.end_loader     ;found or not found parametrs in section  exit in section
  484.         cmp     al,'['
  485.         jnz     .start_mfb
  486.  
  487. .found_sect_mfb:
  488.         cmp     di,point_loader     ;if we have section loader
  489.         jz      .start_mfb
  490.  
  491.         mov     [si],di
  492.  
  493.         sub     si,2
  494.         dec     dx
  495.         jnz     .start_mfb
  496. ;bufer is full
  497.         jmp     @f
  498. .val_buff_comp:
  499.         push    save_cx
  500.         pop     word [si]
  501.         sub     si,2
  502. @@:
  503.  
  504.         add     si,4
  505.         mov     point_to_eframe,si
  506.  
  507. }
  508.  
  509. macro show_act_cursor
  510. {
  511. ;îòîáðàæåíèå êóðñîðà ïî óìîë÷àíèþ
  512.         lea     si,point_to_hframe
  513.         mov     di,962-160
  514.         mov     ax,point_default
  515.         mov     cx,size_show_section
  516. .home_show_cur:
  517.         mov     bx,[si]
  518.         add     di,160
  519.         cmp     bx,ax
  520.         jz      .show_cursor_activ
  521.         sub     si,2
  522.         loop    .home_show_cur
  523.  
  524. .show_cursor_activ:
  525. ;        push   0xb800
  526. ;       pop     es
  527.         mov     point_to_point_def,si
  528.         mov     ax,(color_sym_red*0x100+0x10)
  529.         stosw
  530.         add     di,68
  531.         inc     ax
  532.         stosw
  533. }
  534.  
  535. macro clear_timer_msg
  536. {
  537.         push    0xb800
  538.         pop     es
  539.         xor     ax,ax
  540. if DEBUG
  541.         mov     ax,0x0720
  542. end if
  543. ;;;;;;;;;;;;;;;;;;;;; show Press any key
  544.         mov     di,3360
  545.         mov     cx,80*4
  546.         rep     stosw
  547.  
  548. ;show sect
  549.         push    ini_data_
  550.         pop     es
  551.         call    show_bl_sc_sect ;es=0xb800
  552.  
  553. }
  554.  
  555. macro show_descript
  556. ;Ýòîò ìàêðîñ ïîêàçûâàåò êðàòêîå îïèñàíèå, åñëè îíî åñòü ó ñåêöèè â ïóíêòå
  557. ;Section description
  558. {
  559. local .start_p_sh_d
  560. local .exit
  561. local .rest_value_loop_sh_d
  562. local .end_sh_desc_sec
  563. local .loop_message
  564. local .show_mess_prev_eq
  565.         mov     di,point_default
  566.         push    ini_data_
  567.         mov     si,point_to_point_def
  568.         pop     es
  569.         sub     si,2
  570.         mov     cx,[si]         ;çàãðóçèì óêàçàòåëü íàñëåäóþùèþ ñåêöèþ
  571.         sub     cx,di           ;âîò òåïåðü èìååì èñòèíûé ðàçìåð
  572. ;di - óêàçàòåëü íà äåôîëòíóþ ñåêöèþ ò.å. âûáðàííóþ cx - ðàçìåð îáëàñòè. äëÿ ïðîñìîòðà
  573.  
  574. .start_p_sh_d:
  575.         call    get_firs_sym    ;get first symbol on new line
  576.         test    cx,cx
  577.         jz      .exit   ;íåòó? íó ëàäíî - ñëåäóþùåå çíà÷åíèå òîãäà )
  578.         cmp     al,'d'
  579.         jnz     .start_p_sh_d
  580. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  581.  
  582.         mov     bx,cx
  583.         mov     ax,di
  584.  
  585.         mov     si,parse_descript
  586.         mov     cx,parse_descript_e - parse_descript
  587.         repe    cmpsb
  588.         jnz     .rest_value_loop_sh_d      ;is not compare
  589.  
  590.         sub     bx,parse_descript_e - parse_descript ;correct cx
  591.         add     bx,cx
  592.         mov     cx,bx
  593. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ðàçáîð àëÿ ' = '
  594.         mov     ax,0x3d20          ;cut al=' ' ah='='
  595.         repe    scasb
  596.         jcxz    .rest_value_loop_sh_d          ;not found param timeout
  597.        
  598.         cmp     ah,byte [es:di-1]    ;find '='
  599.         jnz     .rest_value_loop_sh_d
  600.        
  601.         repe    scasb              ;cut ' '
  602.         inc     cx
  603.         dec     di
  604. ;;;;;;;;;;;;;;;;;;;;di óêàçûâàåò íà ñòðî÷êó, êîòîðóþ íàì íóæíî âûâîäèòü.
  605. ;ñòðî÷êà áóäåò âûâîäèòüñÿ áëîêàìè ïî 37 ñèìâîëîâ.
  606. ;íàñòðîèì êóäà áóäåì âûâîäèòü ò.å. íà÷àëî
  607. ;es:di - óêàçûâàþò íà ñòðî÷êó èç êîòîðîé ìû áåðåì ñèìâîë, ds:si êóäà áóäåì âûâîäèòü
  608.         push    di
  609.         pop     si
  610.  
  611.         push    es
  612.         pop     ds
  613.  
  614.         push    0xb800
  615.         pop     es
  616.        
  617.         mov     di,1040
  618.         mov     bx,18
  619.         mov     find_sec_di,di
  620.         mov     save_cx_d,bx
  621. ;;;;;;;;;;;;;;;;;;;;;;;;;;      
  622. ;clean string
  623.  
  624.         push    di
  625.         xor     ax,ax
  626.  
  627. @@:     mov     cx,38
  628.         push    di
  629.         rep     stosw
  630.         pop     di
  631.  
  632.         cmp     save_descript_size,bx
  633.         jz      @f
  634.  
  635.  
  636.         add     di,160
  637.         dec     bx
  638.         jnz     @b
  639.  
  640. @@:     pop     di
  641. ;enter in mess
  642. .show_mess_prev_eq:
  643.         lodsb
  644.         mov     ah,color_sym_lettuce;color_sym_turquoise
  645. ;       sub     di,2
  646.         cmp     al,'"'
  647.         jz      .loop_message
  648.         cmp     al,"'"
  649.         jnz     .end_sh_desc_sec
  650.  
  651. .loop_message:        
  652.         mov     cx,38
  653. @@:
  654.         lodsb
  655.         cmp     al,'"'
  656.         jz      .end_sh_desc_sec
  657.         cmp     al,"'"
  658.         jz      .end_sh_desc_sec
  659.         stosw
  660.         loop    @b
  661.        
  662.         add     find_sec_di,160
  663.         mov     di,find_sec_di
  664.         dec     save_cx_d
  665.         cmp     save_cx_d,0
  666.         jnz     .loop_message
  667.  
  668. .end_sh_desc_sec:
  669.         push    save_cx_d
  670.         pop     save_descript_size
  671.  
  672.         push    cs
  673.         pop     ds
  674.         jmp     .exit
  675.  
  676.  
  677. .rest_value_loop_sh_d:
  678.         mov     di,ax
  679.         mov     cx,bx
  680.         jmp     .start_p_sh_d
  681.  
  682. .exit:
  683. }