Subversion Repositories Kolibri OS

Rev

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

  1. ;constants
  2. ;for keys
  3. KEY_ESC      equ 27
  4. KEY_PGDN     equ 183
  5. KEY_PGUP     equ 184
  6. KEY_LNDN     equ 177
  7. KEY_LNUP     equ 178
  8. KEY_RIGHT    equ 179
  9. KEY_LEFT     equ 176
  10. KEY_HOME     equ 180
  11. KEY_END      equ 181
  12. KEY_HOMETOP  equ 251  ;Ctrl + '['
  13. KEY_ENDBOTTOM equ 253 ;Ctrl + ']'
  14.  
  15.  use32
  16.  org 0x0
  17.  db 'MENUET01'  ; 8 byte id
  18.  dd 0x01        ; header version
  19.  dd START       ; start of code
  20.  dd I_END       ; size of image
  21.  dd 0x80000     ; memory for app
  22.  dd 0x80000     ; esp
  23.  dd 0x0 , 0x0   ; I_Param , I_Icon
  24.  
  25.  include 'lang.inc'
  26.  include '..\..\..\macros.inc'
  27.  
  28.  
  29. START: ; start of execution
  30.  
  31.   mov  eax,40
  32.   mov  ebx,100111b ;event mouse
  33.   mcall
  34.   mov  dword [process_info+42],540
  35.   mov  dword [process_info+46],414
  36.  
  37. red:
  38.   call draw_window
  39.  
  40. still:
  41.   mov  eax,10  ; wait here for event
  42.   mcall
  43.   dec  al      ; redraw request ?
  44.   je   red
  45.   dec  al      ; key in buffer ?
  46.   je   key
  47.   dec  al      ; button in buffer ?
  48.   je   button
  49.                ; mouse event received
  50.  mouse:
  51.   mov  eax,37
  52.   mov  ebx,2
  53.   mcall
  54.   or   eax,eax
  55.   jz   still
  56.   cmp  [menu_opened],1
  57.   jne  still
  58.   mov  [menu_opened],0
  59.  
  60.  
  61.  key:          ; key
  62.   mov  eax,2
  63.   mcall
  64. ; test al,al
  65. ; jnz  still
  66.   cmp  ah,KEY_ESC
  67.   jz   close
  68.   mov  al,[o_s_flag]
  69.   and  al,8  ;set bit 3?
  70.   jz   edit_keys ;not - no output to filename area
  71.   cmp  ah,8  ;BACKSPACE
  72.   jnz  no_backspace
  73.   dec  [name_l]
  74.   cmp  [name_l],0
  75.   mov  edx,filename
  76.   je   A1
  77.   jg   @f
  78.   mov  [name_l],0
  79.   jmp  A1
  80.  @@:
  81.   add  dl,[name_l]
  82.  A1:
  83.   sub  [x_cursor],0x60000
  84.   mov  [edx],byte 0
  85.   cmp  [x_cursor],0xb0005
  86.   jge  @f
  87.   mov  [x_cursor],0xb0005
  88. @@:
  89.   call redraw_window
  90.   jmp  still  ;END BACKSPACE
  91.  
  92.  no_backspace:
  93.   cmp  ah,0x30 ;'0'
  94.   jl   A2
  95.   cmp  ah,0x39 ;'9'
  96.   jle  bigsym
  97.   cmp  ah,65 ;'A'
  98.   jbe  bigsym
  99.   cmp  ah,90 ;'Z'
  100.   jle  bigsym
  101.   cmp  ah,97 ;'a'
  102.   jbe  smsym
  103.   cmp  ah,122;'z'
  104.   jle  smsym
  105.   jmp  still
  106.  A2:
  107.   cmp  ah,46 ;'.'
  108.   jz   bigsym
  109.   cmp  ah,0x20
  110.   jz   bigsym
  111.   jmp  still
  112.  smsym:
  113.   sub  ah,32
  114.  bigsym:
  115.   cmp  [name_l],13 ;yes. filename length <13
  116.   jl   @f
  117.   sub  [o_s_flag],8 ;not - disable output to filename area
  118.   mov  [x_cursor],0x680005; - set x-base & x-size
  119.   jmp  _end_keys
  120.  @@:
  121.   mov  edx,filename  ;
  122.   add  dl,[name_l]
  123.   mov  [edx],ah
  124.   inc  [name_l]
  125.   add  [x_cursor],0x60000
  126.  _end_keys:
  127.   call redraw_window
  128.   jmp  still
  129.  edit_keys:
  130.   cmp  ah,KEY_PGDN
  131.   jnz  @f
  132.   call PgDn
  133.   jmp  still
  134.  @@:
  135.   cmp  ah,KEY_PGUP
  136.   jnz  @f
  137.   call PgUp
  138.   jmp  still
  139.  @@:
  140.   cmp  ah,KEY_HOME ;Home
  141.   jnz  @f
  142.   call Home
  143.   jmp  still
  144.  @@:
  145.   cmp  ah,KEY_END ;Home
  146.   jnz  @f
  147.   call _End
  148.   jmp  still
  149.  @@:
  150.   cmp  ah,KEY_HOMETOP
  151.   jnz  @f
  152.   call CtrlHome
  153.   jmp  still
  154.  @@:
  155.   cmp  ah,KEY_ENDBOTTOM
  156.   jnz  @f
  157.   call CtrlEnd
  158.   jmp  still
  159.  @@:
  160.   cmp  ah,KEY_LNDN
  161.   jnz  @f
  162.   call LnDn
  163.   jmp  still
  164.  @@:
  165.   cmp  ah,KEY_LNUP
  166.   jnz  @f
  167.   call LnUp
  168.   jmp  still
  169.  @@:
  170.   cmp  ah,KEY_RIGHT ;Right
  171.   jnz  @f
  172.   call Right
  173.   jmp  still
  174.  @@:
  175.   cmp  ah,KEY_LEFT ;Left
  176.   jnz  @f
  177.   call Left
  178.  @@:
  179.   ;। ªâ¨à®¢ ­¨¥ áâப¨ ¢ hex-¯à¥¤áâ ¢«¥­¨¨
  180.   mov  esi,[current]
  181.   mov  bl,[posx]
  182.   add  esi,0x10000 ;0x80000
  183.   cmp  ah,0x30
  184.   jl   still   ;ah<'0'
  185.   cmp  ah,0x39
  186.   jle  A23   ;ah='0'...'9' - ¯¥à¥¢®¤ ¨§ ᨬ¢®«®¢ ¢ hex
  187. ;¯à®¢¥àª  ­  ª®¤ë áâ àè¨å hex-æ¨äà
  188.   cmp  ah,0x61 ;ah<'a'
  189.   jl   A27   ;¬®¦¥â ¡ëâì ¢¢®¤ïâáï ¡®«ì訥 ¡ãª¢ë?
  190.   cmp  ah,0x66 ;ah>'f'
  191.   jg   still
  192.   sub  ah,0x20 ;ª®­¢¥àâ¨à㥬 ¢ ¡®«ì訥 ¡ãª¢ë
  193.   jmp  A24
  194.  A27:
  195.   cmp  ah,0x41
  196.   jl   still   ;ah<'A'
  197.   cmp  ah,0x46
  198.   jg   still   ;ah>'F'
  199.  A24:
  200.   add  ah,9
  201.  A23:
  202.   mov  dl,[esi];®à¨£¨­ «ì­ë© ¡ ©â
  203.   and  bl,1    ;¥á«¨ ­¥ç¥â - । ªâ¨àã¥âáï ¬« ¤è¨© ¯®«ã¡ ©â, ç¥â - áâ à訩
  204.   jz   hi_half_byte
  205.   ;¬« ¤è¨© ¯®«ã¡ ©â
  206.   and  ah,0x0f ;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â ¢¢¥¤¥­­®© æ¨äàë
  207.  ;¥á«¨ ah = 0x30...0x39, â® ¢á¥ ­®à¬ «ì­®
  208.  ;¥á«¨ ah = 0x41...0x46, â® ­  ¬¥âª¥ €24 ¯®«ã稬
  209.  ;ah = 0x4A...0x4F ¨ ⮦¥ ¢á¥ ­®à¬ «ì­®
  210.   and  dl,0xf0 ;®¡­ã«ï¥¬ ¬« ¤è¨© ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
  211.   jmp  patch_byte
  212.  hi_half_byte:
  213.   ;áâ à訩 ¯®«ã¡ ©â
  214.   shl  ah,4    ;®¤­®¢à¥¬¥­­® ᤢ¨£ ¥¬ ­ã¦­®¥ §­ ç¥­¨¥ ¢ áâ à訩 ¯®«ã¡ ©â
  215.  ;¨ ®¡­ã«ï¥¬ ¬« ¤è¨©
  216.   and  dl,0x0f ;®¡­ã«ï¥¬ áâ à訩 ¯®«ã¡ ©â 㠮ਣ¨­ «ì­®£® ¡ ©â 
  217.  patch_byte:
  218.   or   ah,dl   ;®¡ê¥¤¨­ï¥¬ ¯®«ã¡ ©âë
  219.   mov  [esi],ah;¯ â稬 ¢ ¯ ¬ïâ¨
  220.   mov  ebx,0x20100
  221.   movzx ecx,ah ;¤«ï ä㭪樨 ¢ë¢®¤  ç¨á« 
  222.   ;⥯¥àì ­ ¤® à áç¨â âì ª®®à¤¨­ âë ¢ë¢®¤  ¤«ï ç¨á« 
  223.   ;edx = x shl 16 + y
  224.   mov  edx,[x_cursor]
  225.   mov  edi,[y_cursor]
  226.   and  edx,0xffff0000
  227.   shr  edi,0x10
  228.   xor  esi,esi
  229.   or   edx,edi
  230.   mov  eax,47
  231.   add  edx,8
  232.   mcall
  233.   call redraw_window
  234.   jmp  still
  235.  
  236.  button:   ; button
  237.   mov  eax,17 ; get id
  238.   mcall
  239.   dec  ah  ;close programm button
  240.   jne  @f
  241.  close:
  242.   mov  eax,-1 ; close this program
  243.   mcall
  244.  @@:
  245.   dec  ah
  246.   jne  @f
  247.   call redraw_window
  248.   call menufile
  249.   jmp  still
  250.  @@:
  251.   dec  ah  ;menu 'coding' button
  252.   jne  @f
  253.   call redraw_window
  254.   call menucoding
  255.   jmp  still
  256.  @@:
  257.   dec  ah  ;menu 'Help' button
  258.   jne  @f
  259.   call redraw_window
  260.   call menuhelp
  261.   jmp  still
  262.  @@:
  263.   ;now processed low_level menu buttons
  264.   ;id m_open = 5
  265.   ;id m_save = 6
  266.   ;id m_exit = 7
  267.   ;id m_win2dos 8
  268.   ;id m_win2koi 9
  269.   ;id m_win2iso 10
  270.   ;id m_dos2win 11
  271.   ;id m_dos2koi 12
  272.   ;id m_dos2iso 13
  273.   ;id m_help 14
  274.   ;id m_about 15
  275.   dec  ah ;open?
  276.   jne  @f
  277.   cmp  [o_s_flag],0  ;disable 'Open' if flag !=0
  278.   jnz  no_open
  279. ;  call redraw_window
  280.   mov  [color],0x0072b9fc
  281.   call f2 ;set x_cursor & y_cursor for input filename
  282.   mov  [o_s_flag],8   ;for output to filename area
  283.  no_open:
  284.   call redraw_window
  285.   jmp  still
  286.  @@:
  287.   dec  ah ;save?
  288.   jne  @f
  289.   cmp  [o_s_flag],1  ;enable save if flag = 1
  290.   jnz  no_save
  291.   movzx ecx,[name_l] ;begin clear filename string
  292.   mov  edi,filename
  293.   xor  al,al
  294.   jecxz no_clear
  295.  clear:
  296.   mov  [edi+ecx],al
  297.   loop clear
  298.   mov  [name_l],al ;set filename length = 0
  299.  no_clear:  ;ebd clear
  300.   call f2 ;set x_cursor & y_cursor for input filename
  301.   mov  [o_s_flag],9 ;for output to filename area
  302.  no_save:
  303.   call redraw_window
  304.   jmp  still
  305.  @@:
  306.   dec  ah ;exit?
  307.   jne  @f
  308.   jmp  close
  309.  @@:
  310.   dec  ah ;m_win2dos?
  311.   jne  @f
  312.   push dword WIN_TABLE
  313.   push dword DOS_TABLE
  314.   call coding
  315.   call redraw_window
  316.   jmp  still
  317.  @@:
  318.   dec  ah ;m_win2koi?
  319.   jne  @f
  320.   push WIN_TABLE
  321.   push KOI_TABLE
  322.   call coding
  323.   call redraw_window
  324.   jmp  still
  325.  @@:
  326.   dec  ah ;m_win2iso?
  327.   jne  @f
  328.   push WIN_TABLE
  329.   push ISO_TABLE
  330.   call coding
  331.   call redraw_window
  332.   jmp  still
  333.  @@:
  334.   dec  ah ;m_dos2win?
  335.   jne  @f
  336.   push DOS_TABLE
  337.   push WIN_TABLE
  338.   call coding
  339.   call redraw_window
  340.   jmp  still
  341.  @@:
  342.   dec  ah ;m_dos2koi?
  343.   jne  @f
  344.   push DOS_TABLE
  345.   push KOI_TABLE
  346.   call coding
  347.   call redraw_window
  348.   jmp  still
  349.  @@:
  350.   dec  ah ;dos2iso?
  351.   jne  @f
  352.   push DOS_TABLE
  353.   push ISO_TABLE
  354.   call coding
  355.   call redraw_window
  356.   jmp  still
  357.  @@:
  358.   dec  ah ;m_help?
  359.   jne  @f
  360.   ;create new thread for output help info
  361.   ;parameter: address for entry_point thread
  362.   push help_thread
  363.   call create_process
  364.   call redraw_window
  365.   jmp  still
  366.  @@:
  367.   dec  ah ;m_about?
  368.   jne  @f
  369.   ;create new thread for output about info
  370.   ;parameter: address for entry_point thread
  371.   push about_thread
  372.   call create_process
  373.   call redraw_window
  374.   jmp  still
  375.  @@:
  376.   ;button 'Go'
  377.   and  [o_s_flag],1
  378.   jnz  _savefile
  379.   ;open file
  380.   mov  eax,6
  381.   mov  ebx,filename
  382.   xor  ecx,ecx
  383.   or   edx,-1
  384.   mov  esi,0x10000
  385.   mcall
  386.   inc  [o_s_flag]
  387.   mov  [sizefile],eax
  388.   jmp  end_Go
  389.  _savefile:
  390.   ;save file
  391.   mcall 70,writeinfo
  392.  end_Go:
  393.   call CtrlHome
  394.   jmp  still
  395.  
  396. Right:
  397.   pushad
  398.   mov  al,[posx]
  399.   inc  al
  400.   cmp  al,0x20
  401.   jl   @f
  402.   mov  [posx],0
  403.   mov  [x_cursor],0x680005
  404.   mov  [text_cursor],0x01200000
  405.   sub  [current],0xf ;because [current] add 0x10 in LnDn
  406.   call LnDn
  407.   popad
  408.   ret
  409.  @@:
  410.   mov  [posx],al
  411.   and  al,1
  412.   jnz  @f ;not increment [current]
  413.   ;increment
  414.   add  [x_cursor],0xa0000
  415.   sub  [text_cursor],0x40000
  416.   inc  [current]
  417.   jmp  end_r
  418.  @@:
  419.   add  [x_cursor],0x60000
  420.   sub  [text_cursor],0x60000
  421.  end_r:
  422.   call redraw_window
  423.   popad
  424.   ret
  425.  
  426. Left:
  427.   pushad
  428.   mov  al,[posx]
  429.   dec  al
  430.   jge  @f
  431.   mov  [posx],0x1f
  432.   mov  [x_cursor],0x015e0005
  433.   mov  [text_cursor],0x00840000
  434.   add  [current],0x0f
  435.   call LnUp
  436.   popad
  437.   ret
  438.  @@:
  439.   mov  [posx],al
  440.   and  al,1
  441.   jnz @f ;decrement [current]
  442.   ;not decrement
  443.   sub  [x_cursor],0x60000
  444.   add  [text_cursor],0x60000
  445.   jmp  end_l
  446.  @@:
  447.   cmp  [current],0
  448.   jle  end_l
  449.   sub  [x_cursor],0xa0000
  450.   add  [text_cursor],0x40000
  451.   dec  [current]
  452.  end_l:
  453.   call redraw_window
  454.   popad
  455.   ret
  456.  
  457. LnDn:
  458.   pushad
  459.   add  [current],0x10
  460.   movzx ecx,[lines]
  461.   cmp  cl,[posy]
  462.   jl   @f ;when counter strings >= number strings in window
  463.   add  [y_cursor],0xa0000
  464.   inc  [posy]
  465.   call redraw_window
  466.   popad
  467.   ret
  468.  @@:
  469.   mov  eax,0x10
  470.   xor  edx,edx
  471.   imul ecx
  472.   sub  eax,0x10
  473.   sub  [end_str],eax
  474. ;  mov  eax,[sizefile]
  475. ;  add  eax,0x80000
  476. ;  cmp  eax,[end_str]
  477. ;  jge  @f
  478. ;  mov  [end_str],eax
  479. ; @@:
  480.   call draw_window
  481.   popad
  482.   ret
  483.  
  484. LnUp:
  485.   pushad
  486.   sub  [current],0x10
  487.   cmp  [current],0
  488.   jge  @f
  489.   mov  [current],0
  490.  @@:
  491.   cmp  [posy],3
  492.   jle @f ;when counter strings < number top string
  493.   sub  [y_cursor],0xa0000
  494.   dec  [posy]
  495.   call redraw_window
  496.   popad
  497.   ret
  498.  @@:
  499. ;  movzx ecx,[lines]
  500. ;  mov  eax,0x10
  501. ;  xor  edx,edx
  502. ;  imul ecx
  503. ;  add  eax,0x10
  504.   sub  [end_str],0x10
  505.   cmp  [end_str],0x10000
  506.   jge  @f
  507.   mov  [end_str],0x10000
  508.  @@:
  509.   call redraw_window
  510.   popad
  511.   ret
  512.  
  513. CtrlEnd:
  514.   pushad
  515.   popad
  516.   ret
  517.  
  518. CtrlHome:
  519.   pushad
  520.   mov  [x_cursor],0x00680005   ;ãáâ ­ ¢«¨¢ îâáï §­ ç¥­¨ï, ª ª ¯à¨ ®âªàë⨨
  521.   mov  [y_cursor],0x00280008
  522.   mov  [text_cursor],0x01200000
  523.   mov  [posx],0
  524.   mov  [posy],3
  525.   call b_in_screen
  526.   mov  [end_str],0x10000
  527.   mov  [current],0
  528.   call redraw_window
  529.   popad
  530.   ret
  531.  
  532. _End:
  533.   pushad
  534.   mov  [x_cursor],0x015e0005
  535.   mov  [posx],0x1f
  536.   mov  [text_cursor],0x00840000
  537.   or   [current],0xf
  538.   call b_in_screen
  539.   call redraw_window
  540.   popad
  541.   ret
  542.  
  543. Home:
  544.   pushad
  545.   mov  [x_cursor],0x00680005 ;ãáâ ­ ¢«¨¢ îâáï §­ ç¥­¨ï ¤«ï ­ ç «  áâப¨
  546.   mov  [posx],0
  547.   mov  [text_cursor],0x01200000
  548.   and  [current],0xfffffff0
  549.   call b_in_screen
  550.   call redraw_window
  551.   popad
  552.   ret
  553.  
  554. PgDn:
  555.   pushad
  556.   xor  edx,edx
  557.   movzx ecx,[lines]
  558.   mov  eax,0x10
  559.   imul ecx
  560.   add  [current],eax
  561.   add  [end_str],eax
  562.   call redraw_window
  563.   popad
  564.   ret
  565.  
  566. PgUp:
  567.   pushad
  568.   xor  edx,edx
  569.   movzx ecx,[lines]
  570.   mov  eax,0x10
  571.   imul ecx
  572.   sub  [current],eax
  573.   cmp  [current],0
  574.   jge  @f
  575.   mov  [current],0
  576.  @@:
  577.   sub  [end_str],eax
  578.   cmp  [end_str],0x10000
  579.   jge  @f
  580. ;  call CtrlHome
  581.   mov  [end_str],0x10000
  582.  @@:
  583.   call redraw_window
  584.   popad
  585.   ret
  586.  
  587. b_in_screen:
  588.   pushad
  589.   call get_process_info
  590.   mov  eax,[process_info+0x2e]
  591.   mov  ebx,0x0a
  592.   sub  eax,0x3c
  593.   cmp  eax,0x10   ;now
  594.   jg   @f   ;now
  595.   mov  [lines],0  ;now
  596.   jmp  C1   ;now
  597.  @@:
  598.   xor  edx,edx
  599.   div  ebx
  600.   mov  [lines],al
  601.  C1:
  602.   popad
  603.   ret
  604.  
  605.  
  606.  
  607. output_screen:
  608.   pushad
  609.   movzx ecx,[lines]
  610.   jecxz no_out ;now
  611.   cmp  [rflag],1
  612.   jz   _redraw
  613.   mov  eax,[end_str]
  614.   sub  eax,0x80001
  615.   cmp  eax,[sizefile]
  616.   jl   @f
  617.  _redraw:
  618.   xor  edx,edx
  619.   mov  eax,0x10
  620.   imul ecx
  621.   sub  [end_str],eax
  622.   cmp  [end_str],0x10000
  623.   jge  A3
  624.   mov  [end_str],0x10000
  625.  A3:
  626.   mov  [rflag],0
  627.  @@:
  628.   mov  eax,0x28
  629.  @@:
  630.   push ecx
  631.   push eax
  632.   call form_str
  633.   mov  ebx,0x01880000
  634.   add  ebx,eax
  635.   mov  ecx,0x00ffffff
  636.   add  eax,10
  637.   mov  edx,[end_str]
  638.   push eax
  639.   sub  edx,0x10
  640.   mov  esi,0x10
  641.   mov  eax,4
  642.   mcall
  643.   pop  eax
  644.   pop  ecx
  645.   loop @b
  646.  no_out:
  647.   popad
  648.   ret
  649.  
  650.  
  651.  
  652. form_str:
  653.   pushad
  654.   mov  ebp,[end_str]  ;¯®á«¥¤­¨© ¢ë¢¥¤¥­­ë© ¡ ©â
  655.   xor  edi,edi ;áç¥â稪 ¡ ©â <= 16
  656.   ;¢ë¢¥á⨠ ¤à¥á
  657.   mov  ecx,ebp
  658.   mov  ebx,0x80100  ;8 æ¨äà, 16-à¨ç­ë¥, ç¨á«® ¢ ecx
  659.   sub  ecx,0x10000  ;­®à¬ «¨§ æ¨ï  ¤à¥á 
  660.   mov  edx,0x80000  ;­ ç «® ¯® •
  661.   add  edx,[esp+0x24]  ;­ ç «® ¯® “
  662.   mov  esi,0x00ffffff ;梥â
  663.   mov  eax,47 ;¢ë¢¥á⨠ç¨á«®
  664.   mcall
  665.   add  edx,0x600000   ;0x40 - 8chars + 0x20 - space
  666.   mov  ebx,0x20100    ;2 æ¨äàë, 16-à¨ç­ë¥, ç¨á«® ¢ ecx
  667.  @@:
  668.   mov  ecx,[ebp+edi]   ;ç¨á«® ¢ ecx
  669.   inc  edi
  670.   and  ecx,0xff
  671.   cmp  edi,0x11
  672.   jz   endstr
  673.   mcall
  674.   add  edx,0x100000
  675.   jmp  @b
  676.  endstr:
  677.   dec  edi
  678.   add  ebp,edi
  679.   mov  [end_str],ebp
  680.   popad
  681.   ret  4
  682.  
  683.  
  684.  
  685. draw_cursor:
  686.   pushad
  687.   mov  ebx,[x_cursor]
  688.   mov  ecx,[esp+0x24]
  689.   mov  edx,[color]
  690.   mov  eax,13
  691.   mcall
  692.   movzx edi,[o_s_flag]
  693.   and  edi,8
  694.   jnz  @f
  695.   add  ebx,[text_cursor]
  696.   mcall
  697.  @@:
  698.   popad
  699.   ret  4
  700.  
  701. f2:
  702.   mov  eax,[process_info+46]
  703.   mov  [x_cursor],0xb0005
  704.   sub  eax,0x11
  705. ;  mov  [text_cursor],-1
  706.   shl  eax,0x10
  707.  
  708.   mov  [y_filename_area],eax
  709.   ret
  710.  
  711. menufile:
  712.   mov  [menu_opened],1
  713.   mov  ebx,[xf_menu];x-base+x_size for hi-level menu button
  714.   mov  edx,5;first id button for this group
  715.   mov  edi,3;counter buttons
  716.   call f1
  717.   ;output text for menu
  718.   shr  ecx,0x10  ;y-base button
  719.   and  ebx,0xffff0000
  720.   add  ecx,0x6000f ;for y-base text
  721.   mov  esi,4 ;length text
  722.   add  ebx,ecx ;full base text
  723.   mov  edx,m_open
  724.   mov  ecx,[sc.work_button_text]
  725.   or   ecx,0x10000000
  726.   sub  eax,4
  727.   mcall
  728.   add  ebx,0x0c ;next full base text
  729.   add  edx,4 ;next string
  730.   mcall
  731.   add  ebx,0x0c
  732.   add  edx,4
  733.   mcall
  734.   ret
  735.  
  736. menucoding:
  737.   mov  [menu_opened],1
  738.   mov  ebx,[xe_menu]
  739.   mov  edx,8 ;first id
  740.   mov  edi,6 ;counter
  741.   add  ebx,0x10 ;add width buttons
  742.   push edi
  743.   call f1
  744.   pop  edi
  745.   shr  ecx,0x10
  746.   and  ebx,0xffff0000
  747.   add  ecx,0x8000f
  748.   mov  esi,8 ;length text
  749.   add  ebx,ecx
  750.   mov  edx,m_win2dos
  751.   mov  ecx,[sc.work_button_text]
  752.   or   ecx,0x10000000
  753.   sub  eax,4
  754.  @@:
  755.   mcall
  756.   add  ebx,0x0c
  757.   add  edx,8 ;next string
  758.   dec  edi
  759.   jnz  @b
  760.   ret
  761.  
  762. menuhelp:
  763.   mov  [menu_opened],1
  764.   mov  ebx,[xh_menu]
  765.   mov  edx,14 ;first id
  766.   add  ebx,6 ;add width buttons
  767.   mov  edi,2 ;counter
  768.   call f1
  769.   shr  ecx,0x10
  770.   and  ebx,0xffff0000
  771.   add  ecx,0x8000f
  772.   mov  esi,4 ;length text
  773.   add  ebx,ecx
  774.   mov  edx,m_help
  775.   mov  ecx,[sc.work_button_text]
  776.   or   ecx,0x10000000
  777.   sub  eax,4
  778.   mcall
  779.   add  ebx,0x0c
  780.   inc  esi ;add lebgth output text
  781.   add  edx,4
  782.   mcall
  783.   ret
  784.  
  785. f1:;uses for drawing low-level menu buttons
  786.   ;counter buttons get into
  787.   ;menufile,menucoding,menuhelp funcs.
  788.   mov  ecx,[y_menu]         ;y-base+y_size for hi-level menu button
  789.   mov  esi,[sc.work_button] ;color buttons
  790.   mov  eax,8
  791.   push ecx                  ;for output text
  792.  @@:
  793.   add  ecx,0xc0000
  794.   mcall
  795.   inc  edx ;id
  796.   dec  edi ;counter
  797.   jnz  @b
  798.   pop  ecx ;for output text
  799.   ret
  800.  
  801. redraw_window:
  802.   call get_process_info
  803.   mov  [rflag],1
  804.   call draw_window
  805.   ret
  806.  
  807. ;this is debug func
  808. debug:
  809.   pushad
  810.   mov  ecx,[esp+0x24]
  811.   mov  ebx,0x80100
  812.   mov  edx,0x10000a0
  813.   mov  eax,47
  814.   mov  esi,0x00ffffff
  815.   mcall
  816.   popad
  817.   ret  4
  818.  
  819. ;   *********************************************
  820. ;   *******  WINDOW DEFINITIONS AND DRAW ********
  821. ;   *********************************************
  822.  
  823. draw_window:
  824.   pushad
  825.   mov  eax,48
  826.   mov  ebx,3
  827.   mov  ecx,sc
  828.   mov  edx,sizeof.system_colors
  829.   mcall
  830.  
  831.   mov  eax,12                 ; function 12:tell os about windowdraw
  832.   mov  ebx,1                  ; 1, start of draw
  833.   mcall
  834.      ; DRAW WINDOW
  835.   mov  eax,0                  ; function 0 : define and draw window
  836.                               ; [x start] *65536 + [x size]
  837.   mov  ebx,[process_info+42]
  838.                               ; [y start] *65536 + [y size]
  839.   mov  ecx,[process_info+46]
  840.   mov  edx,0x03000000         ; color of work area RRGGBB,8->color gl
  841.   mcall
  842.      ; WINDOW LABEL
  843.   mov  eax,4                  ; function 4 : write text to window
  844.   mov  ebx,8*65536+8          ; [x start] *65536 + [y start]
  845.   mov  ecx,[sc.grab_text]
  846.   or   ecx,0x10000000         ; font 1 & color ( 0xF0RRGGBB )
  847.   mov  edx,labelt             ; pointer to text beginning
  848.   mov  esi,labellen-labelt    ; text length
  849.   mcall
  850.     ;check for only header window output
  851.   cmp  dword [process_info+46],25
  852.   jle  minimaze_view
  853.  
  854.      ;MENU AREA
  855.   mov  eax,[process_info+42] ;x-size window
  856.   mov  ecx,[process_info+46] ;y-size window
  857.   push ecx ;for using done
  858.   mov  ebx,0x40000
  859.   sub  eax,8
  860.   mov  edi,ecx
  861.   add  ebx,eax ;x-base + x-size
  862.   sub  edi,22 ;temporary value for menu area
  863.   push ebx ;for drawing buttons area
  864.   sub  ecx,edi ;y-base menu area
  865.   mov  edx,[sc.work_graph]
  866.   shl  ecx,0x10
  867.   mov  eax,13
  868.   add  ecx,0x10
  869.   mcall
  870.      ;MENU BUTTONS
  871.   ;now in hi-half ecx register begin Y-coord. menu area
  872.   ;in hi-half ebx begin X-coord.
  873.   ;menu 'File'
  874.   mov  esi,edx ;color
  875.   and  ecx,0xffff0000
  876.   and  ebx,0xffff0000
  877.   add  ecx,0x1000c
  878.   add  ebx,0x20028   ;40x12
  879.   mov  edx,2 ;menu 'File' id = 2
  880.   mov  [y_menu],ecx ;for low-level menus func.
  881.   mov  [xf_menu],ebx;for low-level menus func.
  882.   mov  eax,8
  883.   push ebx ;for output buttons texts
  884.   mcall
  885.   ;registers is't change
  886.   ;menu 'Coding'
  887.   add  ebx,0x290018 ;80x12
  888.   inc  edx ;menu 'coding' id = 3
  889.   mov  [xe_menu],ebx;for low-level menus func.
  890.   mcall
  891.   ;menu 'Help'
  892.   add  ebx,0x40ffe8 ;+0x280000 - 0x28, 40x12
  893.   inc  edx ;menu 'Help' id = 4
  894.   mov  [xh_menu],ebx;for low-level menus func.
  895.   mcall
  896.      ;MENU BUTTONS TEXTS
  897.   ;'File'
  898.   pop  ebx
  899.   shr  ecx,0x10
  900.   and  ebx,0xffff0000
  901.   add  ecx,3
  902.   mov  eax,4                     ; function 4 : write text to window
  903.   add  ebx,0x80000
  904.   mov  edx,f_menu
  905.   add  ebx,ecx                   ; [x start] *65536 + [y start]
  906.   mov  esi,4
  907.   mov  ecx,[sc.work_button_text]
  908.   or   ecx,0x10000000            ; font 1 & color ( 0xF0RRGGBB )
  909.   push esi                       ;for 'Help' menu text
  910.   mcall
  911.   ;'coding'
  912.   ;registers is't change
  913.   add  ebx,0x2d0000
  914.   ;mov  esi,6
  915.   add  esi,2
  916. ;  mov  edx,e_menu
  917.   add  edx,4
  918.   mcall
  919.   ;'Help'
  920.   add  ebx,0x3b0000
  921. ;   mov  esi,4
  922.   pop  esi
  923. ;  mov  edx,h_menu
  924.   add  edx,6
  925.   mcall
  926.  ;LOW_LEVEL MENU
  927.   ;for every hi-level menu exists one procedure
  928.   ;in begin programm they are not calls,
  929.   ;but when user click on one item hi-level menu
  930.   ;or press hot keys, call one func. and after
  931.   ;end work this func. she is redraw window -
  932.   ;low-level menu is hide. Functions:
  933.   ;menufile,menucoding,menuhelp.
  934.   ;Thay uses global virables, top-left corner every
  935.   ;hi-level menu buttons: [xf_menu],[xe_menu],[xh_menu],[y_menu]
  936.  
  937.      ;DRAW BUTTONS AREA
  938.   pop  ebx ;for push ebx into processed menu area: x-bzse + x-size
  939. ;  mov  ecx,[process_info+46]
  940.   pop  ecx
  941.   push ecx
  942.   sub  ecx,24
  943.   mov  edx,[sc.work_graph]
  944.   shl  ecx,16              ;y start
  945.   mov  eax,13
  946.   add  ecx,20
  947.   mcall
  948.  
  949. ;filename input area
  950. ;  mov  ecx,[process_info+46]
  951.   pop  ecx
  952.   push ecx ;for info strings
  953.   mov  ebx,0x0008005a
  954.   sub  ecx,21
  955.   xor  edx,edx
  956.   shl  ecx,16
  957.   mov  [y_filename_area],ecx
  958.   dec  edx
  959.   add  ecx,16
  960.   mov  eax,13
  961.   push ecx ;for button 'Go'
  962.   mcall
  963.  
  964. ;button 'Go', press in case open/save if filename input complete
  965.   ;button size = 24x16
  966.   mov  eax,8
  967.   pop  ecx ;y-base+y-size
  968.   mov  ebx,0x00680018;x-base+x-size
  969.   dec  ecx
  970.   mov  edx,0xff ;id
  971.   mov  esi,[sc.work_button]
  972.   mcall
  973.   shr  ecx,0x10
  974.   and  ebx,0xffff0000
  975.   add  ecx,0x50004
  976.   mov  edx,b_go
  977.   add  ebx,ecx
  978.   mov  esi,2
  979.   mov  ecx,[sc.work_button_text]
  980.   or   ecx,0x10000000
  981.   sub  eax,4
  982.   mcall
  983.  
  984. ;where output cursor?
  985.   mov  al,[o_s_flag]
  986.   and  al,8
  987.   je   @f
  988.   mov  ecx,[y_filename_area]
  989.   add  ecx,0x40008
  990.   jmp  cursor
  991.  @@:  ;o_s_flag<0 - not output cursor into filename area
  992.   mov  ecx,[y_cursor]
  993.  cursor:
  994.   push ecx
  995.   call draw_cursor
  996.  
  997.   mov  eax,[y_filename_area]
  998.   mov  ebx,0xa0000
  999.   mov  edx,filename
  1000.   shr  eax,0x10
  1001.   and  ebx,0xffff0000
  1002.   add  eax,4
  1003.   xor  ecx,ecx
  1004.   add  ebx,eax
  1005.   movzx esi,[name_l]
  1006.   mov  eax,4
  1007.   mcall
  1008.  
  1009. ;info strings
  1010.      ; sizefile text
  1011. ;    mov  eax,[process_info+46]
  1012.   pop  eax
  1013.   mov  ebx,0x00840000
  1014.   sub  eax,18
  1015.   xor  ecx,ecx
  1016.   add  ebx,eax
  1017.   mov  edx,sizestr   ; pointer to text beginning
  1018.   mov  eax,4
  1019.   mov  esi,5
  1020.   mcall
  1021.   add  ebx,0x00530000
  1022.   inc  esi
  1023. ;    mov  edx,offst
  1024.   add  edx,5
  1025.   inc  esi
  1026.   mcall
  1027.     ;sizefile
  1028.   mov  ecx,[sizefile]
  1029.   mov  edx,ebx
  1030.   xor  esi,esi
  1031.   sub  edx,0x00350000
  1032.   mov  eax,47
  1033.   mov  ebx,0x80100
  1034.   mcall
  1035.   mov  ecx,[current]
  1036.   add  edx,0x005f0000
  1037.   mcall
  1038.  
  1039.   push [text_cursor] ;íâ® ¯®§¨æ¨ï ªãàá®à  ¢ ⥪á⮢®© áâப¥
  1040.   call draw_cursor
  1041.   mov  ecx,[sizefile]
  1042.   jecxz minimaze_view
  1043.   call output_screen
  1044.  
  1045.  minimaze_view:
  1046.   mov  eax,12  ; function 12:tell os about windowdraw
  1047.   mov  ebx,2 ; 2, end of draw
  1048.   mcall
  1049.   popad
  1050.   ret
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056. get_process_info:
  1057.   pushad
  1058.   mov  eax,9
  1059.   mov  ebx,process_info
  1060.   xor  ecx,ecx
  1061.   dec  ecx
  1062.   mcall
  1063.   popad
  1064.   ret
  1065.  
  1066. coding:
  1067.   pushad
  1068.   mov  ebp,0x10000 ;0x80000
  1069.   mov  edi,[esp+0x28] ;source table
  1070.   mov  esi,[esp+0x24] ;destination table
  1071.   xor  ecx,ecx ;index in file
  1072.  new_char:
  1073.   xor  ebx,ebx ;index in tables
  1074.  not_c:
  1075.   mov  ah,[ebp+ecx] ;load char
  1076.   cmp  ah,[edi+ebx] ;
  1077.   jz   @f
  1078.   inc  ebx
  1079.   cmp  ebx,0x40
  1080.   jge  end_table
  1081.   jmp  not_c
  1082.  @@:
  1083.   mov  al,[esi+ebx]
  1084.   inc  ebx
  1085.   mov  [ebp+ecx],al
  1086.  end_table:
  1087.   inc  ecx
  1088.   cmp  ecx,[sizefile]
  1089.   jle  new_char
  1090.   popad
  1091.   ret  8
  1092.  
  1093. create_process:
  1094.   pushad
  1095.   mov  eax,51
  1096.   xor  ebx,ebx
  1097.   mov  ecx,[esp+0x24]
  1098.   inc  ebx
  1099.   mov  edx,0x7E000 ;0x1000
  1100.   mcall
  1101.   popad
  1102.   ret  4
  1103.  
  1104. help_thread:
  1105.   call help_window
  1106.  help_still:
  1107.   mov  eax,10
  1108.   mcall
  1109.   dec  eax
  1110.   jz   help_red
  1111.   dec  eax
  1112.   jz   help_key
  1113.   dec  eax
  1114.   jz   help_button
  1115.   jmp  help_still
  1116.  help_red:
  1117.   call help_window
  1118.   jmp  help_still
  1119.  help_key:
  1120.   inc  eax
  1121.   inc  eax
  1122.   mcall
  1123.   jmp  help_still
  1124.  help_button:
  1125.   mov  eax,17
  1126.   mcall
  1127.   dec  ah
  1128.   jne  help_still
  1129.   shr  eax,8
  1130.   dec  eax
  1131.   mcall
  1132.  
  1133. help_window:
  1134.   pushad
  1135.   mov  eax,12  ; function 12:tell os about windowdraw
  1136.   mov  ebx,1 ; 1, start of draw
  1137.   mcall
  1138.      ; DRAW WINDOW
  1139.   mov  eax,0 ; function 0 : define and draw window
  1140.   mov  ebx,0x500140 ; [x start] *65536 + [x size]
  1141.   mov  ecx,0x700110 ; [y start] *65536 + [y size]
  1142.   mov  edx,0x03000000 ; color of work area RRGGBB,8->color gl
  1143.   mcall
  1144.      ; WINDOW LABEL
  1145.   mov  eax,4 ; function 4 : write text to window
  1146.   mov  ebx,8*65536+8 ; [x start] *65536 + [y start]
  1147.   mov  ecx,0x10ffffff ; font 1 & color ( 0xF0RRGGBB )
  1148.   mov  edx,help_label ; pointer to text beginning
  1149.   mov  esi,14 ; text length
  1150.   mcall
  1151.      ; HELP TEXT
  1152.   add  edx,14 ;help_text addr.
  1153.   add  esi,37 ; = 51 - length 1 line
  1154.   mov  ecx,0x00ffffff
  1155.   mov  edi,(help_end-help_text)/51
  1156.  @@:
  1157.   add  ebx,0x10
  1158.   mcall
  1159.   add  edx,51
  1160.   dec  edi
  1161.   jnz  @b
  1162.  
  1163.  
  1164.   mov  eax,12  ; function 12:tell os about windowdraw
  1165.   mov  ebx,2 ; 2, end of draw
  1166.   mcall
  1167.   popad
  1168.   ret
  1169.  
  1170. about_thread:
  1171.   call about_window
  1172.  about_still:
  1173.   mov  eax,10
  1174.   mcall
  1175.   dec  eax
  1176.   jz   about_red
  1177.   dec  eax
  1178.   jz   about_key
  1179.   dec  eax
  1180.   jz   about_button
  1181.   jmp  about_still
  1182.  about_red:
  1183.   call about_window
  1184.   jmp  about_still
  1185.  about_key:
  1186.   inc  eax
  1187.   inc  eax
  1188.   mcall
  1189.   jmp  about_still
  1190.  about_button:
  1191.   mov  eax,17
  1192.   mcall
  1193.   dec  ah
  1194.   jne  about_still
  1195.   shr  eax,8
  1196.   dec  eax
  1197.   mcall
  1198.  
  1199. about_window:
  1200.   pushad
  1201.   mov  eax,12  ; function 12:tell os about windowdraw
  1202.   mov  ebx,1 ; 1, start of draw
  1203.   mcall
  1204.      ; DRAW WINDOW
  1205.   mov  eax,0           ; function 0 : define and draw window
  1206.   mov  ebx,0x500140    ; [x start] *65536 + [x size]
  1207.   mov  ecx,0x700110    ; [y start] *65536 + [y size]
  1208.   mov  edx,0x03000000  ; color of work area RRGGBB,8->color gl
  1209.   mcall
  1210.      ; WINDOW LABEL
  1211.   mov  eax,4           ; function 4 : write text to window
  1212.   mov  ebx,8*65536+8   ; [x start] *65536 + [y start]
  1213.   mov  ecx,[sc.work_button_text]
  1214.   or   ecx,0x10000000  ; font 1 & color ( 0xF0RRGGBB )
  1215.   mov  edx,about_label ; pointer to text beginning
  1216.   mov  esi,17          ; text length
  1217.   mcall
  1218.      ; ABOUT TEXT
  1219.   add  edx,17 ;about_text addr.
  1220.   add  esi,34 ; = 51 - length 1 line
  1221.   mov  ecx,0x00ddeeff
  1222.   mov  edi,15
  1223.  @@:
  1224.   add  ebx,0x10
  1225.   mcall
  1226.   add  edx,51
  1227.   dec  edi
  1228.   jnz  @b
  1229.  
  1230.   mov  eax,12  ; function 12:tell os about windowdraw
  1231.   mov  ebx,2 ; 2, end of draw
  1232.   mcall
  1233.   popad
  1234.   ret
  1235.  
  1236. ; DATA AREA
  1237. writeinfo:
  1238.         dd      2
  1239.         dd      0
  1240.         dd      0
  1241. sizefile dd     0
  1242.         dd      0x10000
  1243.         db      0
  1244.         dd      filename
  1245.  
  1246. current  dd 0 ;current offset relative begin file. Uses as offset for patch.
  1247. ;Coordinates left hi-level menu buttons
  1248. ;Uses into low-level menu output.
  1249. xf_menu  dd 0
  1250. xe_menu  dd 0
  1251. xh_menu  dd 0
  1252. y_menu dd 0 ;top coord. menu
  1253. y_filename_area dd 0 ;top coord. filename input area
  1254. color dd 0
  1255. y_cursor dd 0x280008 ;y coord. shl 16 + y size for cursor
  1256. x_cursor dd 0x680005 ;x coord. shl 16 + x size for cursor
  1257. name_l db 0 ;counter chars into filename
  1258. o_s_flag db 0 ;
  1259. rflag dd 0;
  1260. posx db 0
  1261. posy db 3
  1262. lines db 0
  1263. end_str dd 0x10000 ;addr. first byte for output
  1264. text_cursor dd 0x01200000
  1265.  
  1266. filename: rb 13
  1267.  
  1268. b_go: db 'Go'
  1269.  
  1270. sizestr: db 'SIZE:'
  1271.  
  1272. offst: db 'OFFSET:'
  1273.  
  1274. labelt: db   'HeEd'
  1275. labellen:
  1276.  
  1277. ;text for hi-level menu buttons
  1278. f_menu: db 'File'
  1279. e_menu: db 'Coding'
  1280. h_menu: db 'Help'
  1281. ;text for low-level menu buttons
  1282. ;menu File
  1283. m_open: db 'Open'
  1284. m_save: db 'Save'
  1285. m_exit: db 'Exit'
  1286. ;menu coding
  1287. m_win2dos: db 'Win->Dos'
  1288. m_win2koi: db 'Win->Koi'
  1289. m_win2iso: db 'Win->Iso'
  1290. m_dos2win: db 'Dos->Win'
  1291. m_dos2koi: db 'Dos->Koi'
  1292. m_dos2iso: db 'Dos->Iso'
  1293. ;menu Help
  1294. m_help: db 'Help'
  1295. m_about: db 'About'
  1296. ;tables for coding
  1297. WIN_TABLE:
  1298. db 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9
  1299. db 0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3
  1300. db 0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD
  1301. db 0xDE,0xDF,0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7
  1302. db 0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1
  1303. db 0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB
  1304. db 0xFC,0xFD,0xFE,0xFF
  1305. DOS_TABLE:
  1306. db 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89
  1307. db 0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93
  1308. db 0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D
  1309. db 0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7
  1310. db 0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xE0,0xE1
  1311. db 0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB
  1312. db 0xEC,0xED,0xEE,0xEF
  1313. KOI_TABLE:
  1314. db 0xE1,0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA
  1315. db 0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF2,0xF3,0xF4,0xF5
  1316. db 0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC
  1317. db 0xE0,0xF1,0xC1,0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA
  1318. db 0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD2,0xD3
  1319. db 0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9
  1320. db 0xD8,0xDC,0xC0,0xD1
  1321. ISO_TABLE:
  1322. db 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9
  1323. db 0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0,0xC1,0xC2,0xC3
  1324. db 0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD
  1325. db 0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7
  1326. db 0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1
  1327. db 0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB
  1328. db 0xEC,0xED,0xEE,0xEF
  1329.  
  1330. ;text for help_window
  1331. help_label: db 'Help for HeEd.'
  1332. help_text:
  1333. if lang eq ru
  1334.  db '1.HeEd ¢ á®áâ®ï­¨¨ ®âªàëâì ä ©« ⮫쪮 ®¤¨­ à § ¨  '
  1335.  db '  ­ã¦­®¥ ç¨á«® à § á®åà ­¨âì ¥£®.                  '
  1336.  db '2.à¨ ®âªàë⨨ ä ©«  ¡¥§ à áè¨à¥­¨ï ­ ¤® íâ® à áè¨-'
  1337.  db '  è¨à¥­¨¥ ¢á¥ à ¢­® 㪠§ë¢ âì ª ª âਠ¯à®¡¥«  ¯®á«¥'
  1338.  db '  â®çª¨.                                           '
  1339.  db '3.‘ ¬® ®âªàë⨥ ä ©«  ¯à®¨á室¨â ¯à¨ ­ ¦ â¨¨ ª­®¯ª¨'
  1340.  db '  "Go".                                            '
  1341.  db '4.‘®§¤ ­¨¥ ­®¢ëå ä ©«®¢ ¢ ¬¥­î ­¥ ¯à¥¤ãᬮâ७®, ­®'
  1342.  db '  ¬®¦­® ¦¥ । ªâ¨à®¢ âì...                        '
  1343.  db '5.‚ ä ©« § ¯¨á뢠¥âáï ⮫쪮 ª®«¨ç¥á⢮ ¡ ©â, ª®â®-'
  1344.  db '  à®¥ ¡ë«® à §¬¥à®¬ ä ©«  ¤® ®âªàëâ¨ï.             '
  1345.  db '6.à¨ ­ ¦ â¨¨ "Go" á ¯ãáâë¬ ¯®«¥¬ ¨¬¥­¨ ä ©«  ¢ë¢®-'
  1346.  db '  ¤¨âáï ¯ ¬ïâì á  ¤à¥á  0å80000, ­® à §¬¥à ä ©«    '
  1347.  db '  à ¢¥­ 0xFFFFFFFF.                                '
  1348.  db '               (á¬. ¨­ä® "About")                  '
  1349. else
  1350.  db '1.HeEd can once open file and many times save it.  '
  1351.  db '2.To open file without extension it is required to '
  1352.  db '  specify anyway as three spaces after a dot.      '
  1353.  db '3.File is opened when the button "Go" is pressed.  '
  1354.  db '4.Creation of new files in the menu is not provided'
  1355.  db '  but you can edit...                              '
  1356.  db '5.Only number of bytes which was file size when    '
  1357.  db '  opening is written to file.                      '
  1358.  db '6.If you press "Go" with empty filename field,     '
  1359.  db '  memory starting from address 0x80000 is output,  '
  1360.  db '  but file size equals to 0xFFFFFFFF.              '
  1361.  db '               (see info "About")                  '
  1362. end if
  1363. help_end:
  1364. ;text for about_window
  1365. about_label: db 'About this funny.'
  1366. about_text:
  1367. if lang eq ru
  1368.  db '¥ª®â®à ï ¨­ä®à¬ æ¨ï ¤«ï â¥å, ªâ® § å®ç¥â ¤®¯¨á âì '
  1369.  db 'á çâ®-⮠᢮¥: ª®¤ ¯à ªâ¨ç¥áª¨ ­¥ ®¯â¨¬¨§¨à®¢ ­,'
  1370.  db 'â ª çâ® à §®¡à âìáï ¡ã¤¥â ­¥ â ª 㦠᫮¦­®. ‘âப¨ '
  1371.  db '¤«ï ª­®¯®ª ¬¥­î ¤®«¦­ë ¨¤â¨ ¯àאַ ¤à㣠§  ¤à㣮¬,  '
  1372.  db 'â. ª. ï ¯à¨ ¢ë¢®¤¥ ¨á¯®«ì§ãî ­¥ mov esi,à §¬¥à ¨   '
  1373.  db 'mov  edx, ¤à¥á   ¯à®áâ® ¯à¨¡ ¢«ïî ᬥ饭¨ï. —â® ª -'
  1374.  db 'á ¥âáï ª®¤¨à®¢®ª ¨ à §¬¥à®¢ ä ©«  ¤«ï á®åà ­¥­¨ï,  '
  1375.  db 'â® ®áâ ¥âáï ⮫쪮 ¤®¡ ¢¨âì ª­®¯ª¨ ¬¥­î á ⥪á⮬  '
  1376.  db '(¯à¨ ¤®¡ ¢«¥­¨¨ ­ ¤® ãç¨â뢠âì, çâ® ID ª­®¯ª¨ ®¯®§-'
  1377.  db '­ îâáï dec ah,   ­¥ ª ª cmp ah,ID). …᫨ ¢á¥ ¦¥ ¡ã-'
  1378.  db '¤¥â ­¥¯à¨ïâ­® à §¡¨à âìáï, â® ¬®¦¥â¥ ­ ¯¨á âì ¨    '
  1379.  db 'á¯à®á¨âì. â  ¯à®£à ¬¬  ¡ë«  ­ ¯¨á ­  ¢ 室¥ à §¡®-'
  1380.  db 'ப á GUI MeOS ¨ ¯®í⮬㠭¥ ¯à¥â¥­¤ã¥â ­  çâ®-â®   '
  1381.  db '¡®«ì襥, 祬 ¯à¨¬¥à. à®áâ® ­ ¤®¥«  íâ  â¥¬ ,   ¢ë-'
  1382.  db 'ª¨­ãâì ¦ «ª®.            mailto:babalbes@yandex.ru '
  1383. else
  1384.  db 'Some information for those who want add to this    '
  1385.  db 'something their own: the code is practically not   '
  1386.  db 'optimized, so investigation is not complicated.    '
  1387.  db 'Strings for menu buttons must rank after each other'
  1388.  db 'as I use not mov esi,size and mov edx,address when '
  1389.  db 'output but simply add offsets. For encodins and    '
  1390.  db 'file sizes for save, it remains only add buttons   '
  1391.  db 'with text in menu (at addition one should take into'
  1392.  db 'account that buttons ID are recognized as dec ah   '
  1393.  db 'rather than cmp ah,ID). Nevertheless if study is   '
  1394.  db 'unpleasant, you can write and ask. This program has'
  1395.  db 'been written in course of study GUI MeOS and does  '
  1396.  db 'not therefore pretend on some more than example.   '
  1397.  db 'Just this theme bothers, but I regret to delete.   '
  1398.  db '                         mailto:babalbes@yandex.ru '
  1399. end if
  1400. about_end:
  1401.  
  1402. I_END:
  1403.  
  1404. sc system_colors
  1405.  
  1406. process_info:
  1407.   rb 1024
  1408. menu_opened db ?
  1409. m_text:
  1410.