Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ; CMD - Command line interpreter
  2. ; copyleft Chemist dmitry_gt@tut.by
  3. ;
  4. ; Compile with FASM for Menuet
  5. ;
  6. ;
  7.  
  8. use32
  9.  
  10.  org 0x0
  11.  
  12.  db 'MENUET01'
  13.  dd 0x01
  14.  dd START
  15.  dd I_END
  16.  dd 0x300000
  17.  dd 0x7fff0
  18.  dd 0x0
  19.  dd 0x0
  20.  
  21. include "macros.inc"
  22.  
  23. START:
  24.  
  25.  call cmdexist
  26.  call draw
  27.  call fill
  28.  call clearcmd
  29.  call autoexec
  30.  call ppr
  31.  call cursor
  32.  
  33. still:
  34.  
  35.  mov eax,10
  36.  int 0x40
  37.  
  38.  cmp eax,1
  39.  je re
  40.  cmp eax,2
  41.  je key
  42.  cmp eax,3
  43.  je button
  44.  
  45.  jmp still
  46.  
  47. button:
  48.  mov eax,17
  49.  int 0x40
  50.  
  51.  cmp ah,1
  52.  jne noclose
  53.  
  54.  jmp exit
  55.  
  56. noclose:
  57.  jmp still
  58.  
  59. re:
  60.  call draw
  61.  call red
  62.  jmp still
  63.  
  64. red:
  65.  call cls1
  66.  
  67.  mov dword [xpos],24
  68.  
  69.  mov dword [linev],2000
  70.  
  71.  mov eax,dword [ypos]
  72.  push eax
  73.  
  74.  mov dword [ypos],6
  75.  
  76.  mov ecx,dword [lpress]
  77. loop1:
  78.  push ecx
  79.  mov eax,4
  80.  mov ebx,[ypos]
  81.  shl ebx,16
  82.  add ebx,[xpos]
  83.  mov ecx,0x00ddeeff
  84.  mov edx,tic_table
  85.  add edx,dword [linev]
  86.  mov esi,81
  87.  int 0x40
  88.  add dword [xpos],10
  89.  add dword [linev],81
  90.  pop ecx
  91.  loop loop1
  92.  
  93.  sub dword [xpos],10
  94.  
  95. no_line:
  96.  pop eax
  97.  mov dword [ypos],eax
  98.  
  99. no_red:
  100.  ret
  101.  
  102. key:
  103.  mov eax,2
  104.  int 0x40
  105.  
  106.  cmp ah,27
  107.  jne no_escape
  108.  
  109.  mov dword [ypos],42
  110.  call clearstr
  111.  call ppr
  112.  mov dword [count],0
  113.  call cursor
  114.  jmp still
  115.  
  116. no_escape:
  117.  cmp ah,178
  118.  jne no_aup
  119.  cmp dword [count],0
  120.  jne no_aup
  121.  cmp dword [oldcount],0
  122.  je no_aup
  123.  
  124.  call clearsum
  125.  sub dword [ypos],6
  126.  
  127.  cld
  128.  mov ecx,81
  129.  mov edi,tic_table+600
  130.  mov esi,tic_table+900
  131.  rep movsb
  132.  
  133.  cld
  134.  mov ecx,dword [oldcount]
  135.  mov edi,tic_table
  136.  add edi,dword [linen]
  137.  mov esi,tic_table+600
  138.  rep movsb
  139.  
  140.  call red
  141.  
  142.  mov eax,dword [oldcount]
  143.  mov dword [count],eax
  144.  
  145.  add dword [linen],eax
  146.  add dword [linel],eax
  147.  
  148.  mov ebx,6
  149.  imul ebx,eax
  150.  
  151.  add dword [ypos],ebx
  152.  
  153.  call cursor
  154.  
  155.  jmp still
  156.  
  157. no_aup:
  158.  cmp ah,8
  159.  jne no_backspace
  160.  cmp dword [count],0
  161.  je still
  162.  
  163.  cmp dword [count],0
  164.  je no_backspace
  165.  
  166.  call clearsum
  167.  sub dword [ypos],12
  168.  call clearsum
  169.  sub dword [ypos],6
  170.  call cursor
  171.  dec dword [count]
  172.  jmp still
  173.  
  174. no_backspace:
  175.  cmp ah,13
  176.  jne no_enter
  177.  
  178.  cmp dword [count],0
  179.  jne enter_ok
  180.  call clearsum
  181.  jmp ecmd2
  182.  
  183. enter_ok:
  184.  call checkcmd
  185.  
  186.  cmp byte [tic_table+600],'/'
  187.  jne no_script
  188.  cmp dword [count],1
  189.  je nparam5
  190.  
  191.  jmp command
  192.  
  193. no_script:
  194.  
  195.  call oldcmd
  196.  
  197.  call checkprg
  198.  
  199.  jmp ecmd2
  200.  
  201. no_enter:
  202.  
  203.  cmp ah,176    ; Arrow keys, HOME, END, and DEL are unsupported now
  204.  je still
  205.  cmp ah,179
  206.  je still
  207.  cmp ah,177
  208.  je still
  209.  cmp ah,178
  210.  je still
  211.  cmp ah,182
  212.  je still
  213.  cmp ah,180
  214.  je still
  215.  cmp ah,181
  216.  je still
  217.  
  218.  cmp dword [count],74
  219.  je still
  220.  
  221.  mov byte [smb],ah
  222.  
  223.  mov edi,tic_table+600
  224.  add edi,dword [count]
  225.  mov esi,smb
  226.  movsb
  227.  
  228.  inc dword [count]
  229.  
  230.  call clearsum
  231.  sub dword [ypos],6
  232.  call print
  233.  add dword [ypos],6
  234.  call cursor
  235.  
  236.  jmp still
  237.  
  238. clearstr:
  239.  mov dword [ypos],6
  240.  mov dword [clr],480
  241.  call clear
  242.  
  243.  mov eax,dword [linel]
  244.  sub dword [linen],eax
  245.  mov dword [linel],0
  246.  
  247.  mov ecx,eax
  248.  push eax
  249. loop4:
  250.  push ecx
  251.  mov edi,tic_table
  252.  add edi,dword [linen]
  253.  mov esi,fill1
  254.  movsb
  255.  
  256.  inc dword [linen]
  257.  pop ecx
  258.  loop loop4
  259.  
  260.  pop eax
  261.  sub dword [linen],eax
  262.  
  263.  mov dword [ypos],42
  264.  
  265.  ret
  266.  
  267. clearsum:
  268.  mov dword [clr],6
  269.  call clear
  270.  
  271.  dec dword [linen]
  272.  dec dword [linel]
  273.  
  274.  mov edi,tic_table
  275.  add edi,dword [linen]
  276.  mov esi,fill1
  277.  movsb
  278.  
  279.  ret
  280.  
  281. clear:
  282.  mov eax,13
  283.  mov ebx,[ypos]
  284.  shl ebx,16
  285.  add ebx,[clr]
  286.  mov ecx,[xpos]
  287.  shl ecx,16
  288.  add ecx,9
  289.  mov edx,0
  290.  int 0x40
  291.  add dword [ypos],6
  292.  ret
  293.  
  294. draw:
  295.  
  296.  mov eax,12
  297.  mov ebx,1
  298.  int 0x40
  299.  
  300.  mov eax,0
  301.  mov ebx,100*65536+492
  302.  mov ecx,100*65536+280
  303.  mov edx,0
  304.  mov esi,0x805080d0
  305.  mov edi,0x005080d0
  306.  int 0x40
  307.  
  308.  mov eax,4
  309.  mov ebx,8*65536+8
  310.  mov ecx,0x10ddeeff
  311.  mov edx,title
  312.  mov esi,title_end-title
  313.  int 0x40
  314.  
  315.  mov eax,8
  316.  mov ebx,(492-19)*65536+12
  317.  mov ecx,5*65536+12
  318.  mov edx,1
  319.  mov esi,0x6688dd
  320.  int 0x40
  321.  
  322.  mov eax,12
  323.  mov ebx,2
  324.  int 0x40
  325.  
  326.  ret
  327.  
  328. print:
  329.  mov eax,4
  330.  mov ebx,[ypos]
  331.  shl ebx,16
  332.  add ebx,[xpos]
  333.  mov ecx,0x00ddeeff
  334.  mov edx,smb
  335.  mov esi,1
  336.  int 0x40
  337.  
  338.  mov edi,tic_table
  339.  add edi,dword [linen]
  340.  mov esi,smb
  341.  movsb
  342.  inc dword [linen]
  343.  inc dword [linel]
  344.  
  345.  ret
  346.  
  347. cursor:
  348.  mov eax,4
  349.  mov ebx,[ypos]
  350.  shl ebx,16
  351.  add ebx,[xpos]
  352.  mov ecx,0x00ddeeff
  353.  mov edx,smb_cursor
  354.  mov esi,1
  355.  int 0x40
  356.  
  357.  mov edi,tic_table
  358.  mov esi,smb_cursor
  359.  add edi,dword [linen]
  360.  movsb
  361.  inc dword [linen]
  362.  inc dword [linel]
  363.  
  364.  ret
  365.  
  366. ppr:
  367.  mov eax,4
  368.  mov ebx,6
  369.  shl ebx,16
  370.  add ebx,[xpos]
  371.  mov ecx,0x00ddeeff
  372.  mov edx,prompt
  373.  mov esi,5
  374.  int 0x40
  375.  mov dword [ypos],42
  376.  
  377.  cld
  378.  mov ecx,5
  379.  mov edi,tic_table
  380.  add edi,dword [linen]
  381.  mov esi,prompt
  382.  rep movsb
  383.  
  384.  add dword [linen],6
  385.  add dword [linel],6
  386.  
  387.  ret
  388.  
  389. help:
  390.  cmp byte [callp],1
  391.  je gonext8
  392.  call clearsum
  393. gonext8:
  394.  call newline
  395.  call newline
  396.  mov edx,h1
  397.  call printf
  398.  call newline
  399.  mov edx,h2
  400.  call printf
  401.  call newline
  402.  call newline
  403.  mov edx,h3
  404.  call printf
  405.  call newline
  406.  call newline
  407.  mov edx,h4
  408.  call printf
  409.  call newline
  410.  mov edx,h5
  411.  call printf
  412.  call newline
  413.  mov edx,h6
  414.  call printf
  415.  call newline
  416.  mov edx,h7
  417.  call printf
  418.  call newline
  419.  call newline
  420.  mov edx,h8
  421.  call printf
  422.  call newline
  423.  mov edx,h9
  424.  call printf
  425.  call newline
  426.  mov edx,h10
  427.  call printf
  428.  call newline
  429.  mov edx,h11
  430.  call printf
  431.  call newline
  432.  mov edx,h12
  433.  call printf
  434.  call newline
  435.  mov edx,h13
  436.  call printf
  437.  call newline
  438.  call newline
  439.  mov edx,h14
  440.  call printf
  441.  call newline
  442.  call newline
  443.  mov edx,h15
  444.  call printf
  445.  call newline
  446.  mov edx,h16
  447.  call printf
  448.  call newline
  449.  
  450.  cmp byte [callp],1
  451.  je go
  452.  
  453.  jmp ecmd
  454.  
  455. ver:
  456.  cmp byte [callp],1
  457.  je gonext7
  458.  call clearsum
  459. gonext7:
  460.  call newline
  461.  mov edx,about
  462.  call printf
  463.  
  464.  cmp byte [callp],1
  465.  je go
  466.  
  467.  jmp ecmd
  468.  
  469. pause1:
  470.  cmp byte [callp],1
  471.  je gonext1
  472.  call clearsum
  473. gonext1:
  474.  call pause2
  475.  
  476.  cmp byte [callp],1
  477.  je go
  478.  
  479.  jmp ecmd
  480.  
  481. ls:
  482.  call oldcmd
  483.  call cls2
  484.  
  485. loopls:
  486.  inc dword [blockcnt]
  487.  
  488.  mov eax,34
  489.  mov ebx,0
  490.  mov ecx,0
  491.  mov edx,0
  492.  add edx,dword [blockcnt]
  493.  mov esi,1
  494.  mov edi,tic_table+7000
  495.  int 0x40
  496.  
  497.  mov ecx,16
  498. loop40:
  499.  push ecx
  500.  
  501.  cld
  502.  mov ecx,8
  503.  mov edi,filename
  504.  mov esi,tic_table
  505.  add esi,dword [lscnt]
  506.  rep movsb
  507.  
  508.  add dword [lscnt],8
  509.  
  510.  mov edi,filename+8
  511.  mov esi,ddot
  512.  movsb
  513.  
  514.  cld
  515.  mov ecx,3
  516.  mov edi,filename+9
  517.  mov esi,tic_table
  518.  add esi,dword [lscnt]
  519.  rep movsb
  520.  
  521.  cmp byte [filename+10],0
  522.  jne no_fn_space1
  523.  
  524.  mov edi,filename+10
  525.  mov esi,dzero
  526.  movsb
  527.  
  528. no_fn_space1:
  529.  cmp byte [filename],0xe5  ; deleted file
  530.  je no_newline
  531.  cmp byte [filename],0xf   ; long fat32 filename
  532.  je no_newline
  533.  cmp byte [filename],0x10  ; folder
  534.  je no_newline
  535.  
  536.  cmp word [filename],'AK'
  537.  jne filename_ok
  538.  cmp byte [filename+3],'e'
  539.  jne filename_ok
  540.  cmp byte [filename+5],'y'
  541.  jne filename_ok
  542.  cmp byte [filename+7],'a'
  543.  jne filename_ok
  544.  cmp byte [filename+10],'s'
  545.  jne filename_ok
  546.  
  547.  jmp no_newline
  548.  
  549. filename_ok:
  550.  mov eax,6
  551.  mov ebx,filename
  552.  mov ecx,0
  553.  mov edx,-1
  554.  mov esi,tic_table+25000
  555.  int 0x40
  556.  
  557.  cmp eax,4294967295
  558.  jne ls_print
  559.  
  560.  jmp no_newline
  561.  
  562. ls_print_done:
  563.  inc byte [lscntf]
  564.  
  565.  add dword [ypos],96
  566.  
  567.  cmp byte [lscntf],5
  568.  jne no_newline
  569.  
  570.  mov byte [lscntf],0
  571.  inc byte [lscntx]
  572.  
  573.  cmp byte [lscntx],23
  574.  je pause2n
  575.  
  576.  mov dword [ypos],6
  577.  call newline
  578.  
  579. no_newline:
  580.  add dword [lscnt],24
  581.  
  582.  pop ecx
  583.  dec ecx
  584.  cmp ecx,0
  585.  jne loop40
  586.  
  587.  cmp dword [blockcnt],16
  588.  je ls_end
  589.  
  590.  jmp no_pause2
  591.  
  592. pause2n:
  593.  mov byte [lscntx],0
  594.  
  595.  call newline
  596.  call pause2
  597.  call cls2
  598.  mov dword [lscnt],8024
  599.  jmp loopls
  600.  
  601. no_pause2:
  602.  mov dword [lscnt],8024
  603.  
  604.  jmp loopls
  605.  
  606. ls_end:
  607.  mov dword [blockcnt],0
  608.  mov dword [lscnt],8024
  609.  mov byte [lscntf],0
  610.  mov byte [lscntx],0
  611.  
  612.  cmp byte [callp],1
  613.  je go
  614.  
  615.  jmp ecmd2
  616.  
  617. ls_print:
  618.  mov edi,filename+8
  619.  mov esi,fill1
  620.  movsb
  621.  
  622.  mov eax,4
  623.  mov ebx,[ypos]
  624.  shl ebx,16
  625.  add ebx,[xpos]
  626.  mov edx,filename
  627.  mov ecx,0x00ddeeff
  628.  mov esi,12
  629.  int 0x40
  630.  
  631.  cld
  632.  mov ecx,12
  633.  mov edi,tic_table
  634.  add edi,dword [linen]
  635.  mov esi,filename
  636.  rep movsb
  637.  
  638.  add dword [linen],16
  639.  add dword [linel],16
  640.  
  641.  jmp ls_print_done
  642.  
  643. lscheck:
  644.  cmp byte [callp],1
  645.  je gonext9
  646.  call clearsum
  647. gonext9:
  648.  sub dword [count],3
  649.  
  650.  cld
  651.  mov ecx,dword [count]
  652.  mov edi,tic_table+400
  653.  mov esi,tic_table+600
  654.  add esi,3
  655.  rep movsb
  656.  
  657.  mov ebx,tic_table+400
  658.  push esi edi ecx eax
  659.  mov esi,ebx
  660.  
  661.  mov edi,tic_table+400
  662.  mov ecx,70
  663. strup2:
  664.  mov al,[esi]
  665.  cmp al,'A'
  666.  jb @f
  667.  cmp al,'z'
  668.  ja @f
  669.  cmp al,'a'
  670.  jb @f
  671.  add al,-0x20
  672. @@:
  673.  mov [edi],al
  674.  inc esi
  675.  inc edi
  676.  dec ecx
  677.  jnz strup2
  678.  pop eax ecx edi esi
  679.  
  680.  mov ecx,dword [count]
  681.  
  682. looplsc:
  683.  cmp byte [tic_table+400+ecx],'.'
  684.  je chdot
  685.  
  686.  loop looplsc
  687.  
  688.  jmp chnodot
  689.  
  690. chdot:
  691.  mov ebx,dword [count]
  692.  
  693.  cld
  694.  mov ecx,5
  695.  mov edi,tic_table+400
  696.  add edi,ebx
  697.  mov esi,dzero
  698.  rep movsb
  699.  
  700.  mov eax,6
  701.  mov ebx,tic_table+400
  702.  mov ecx,0
  703.  mov edx,-1
  704.  mov esi,tic_table+25000
  705.  int 0x40
  706.  
  707.  cmp eax,4294967295
  708.  je nosuchfile
  709.  
  710.  jmp lschok
  711.  
  712. chnodot:
  713.  mov ebx,dword [count]
  714.  
  715.  mov edi,tic_table+400
  716.  add edi,ebx
  717.  mov esi,ddot
  718.  movsb
  719.  
  720.  inc ebx
  721.  
  722.  cld
  723.  mov ecx,3
  724.  mov edi,tic_table+400
  725.  add edi,ebx
  726.  mov esi,fill3
  727.  rep movsb
  728.  
  729.  mov eax,6
  730.  mov ebx,tic_table+400
  731.  mov ecx,0
  732.  mov edx,-1
  733.  mov esi,tic_table+25000
  734.  int 0x40
  735.  
  736.  cmp eax,4294967295
  737.  je nosuchfile
  738.  
  739.  mov edi,tic_table+400
  740.  add edi,dword [count]
  741.  mov esi,fill1
  742.  movsb
  743.  
  744. lschok:
  745.  call newline
  746.  
  747.  mov eax,4
  748.  mov ebx,6
  749.  shl ebx,16
  750.  add ebx,[xpos]
  751.  mov edx,tic_table+400
  752.  mov esi,12
  753.  mov ecx,0x00ddeeff
  754.  int 0x40
  755.  
  756.  cld
  757.  mov ecx,12
  758.  mov edi,tic_table
  759.  add edi,dword [linen]
  760.  mov esi,tic_table+400
  761.  rep movsb
  762.  
  763.  add dword [linen],12
  764.  add dword [linel],12
  765.  
  766.  add dword [count],3
  767.  
  768.  cmp byte [callp],1
  769.  je go
  770.  
  771.  jmp ecmd
  772.  
  773. ps:
  774.  call oldcmd
  775.  call cls2
  776.  call newline
  777.  mov edx,proc_head
  778.  call printf
  779.  call newline
  780.  mov edx,proc_hd11
  781.  call printf
  782.  call newline
  783.  call newline
  784.  
  785.  mov eax,9
  786.  mov ebx,tic_table
  787.  mov ecx,1
  788.  int 0x40
  789.  
  790.  mov dword [count2],eax
  791.  
  792. ll1:
  793.  inc dword [pn]
  794.  mov eax,9
  795.  mov ebx,tic_table
  796.  mov ecx,[pn]
  797.  int 0x40
  798.  
  799.  mov ebx,[tic_table+30]
  800.  mov dword [fnumb],4
  801.  mov dword [ypos],6
  802.  call decnumb
  803.  
  804.  cld
  805.  mov ecx,4
  806.  mov edi,tic_table
  807.  add edi,dword [linen]
  808.  mov esi,tic_table+200
  809.  rep movsb
  810.  
  811.  add dword [linen],5
  812.  add dword [linel],5
  813.  
  814.  cld
  815.  mov ecx,11
  816.  mov esi,tic_table+10
  817.  mov edi,pname
  818.  rep movsb
  819.  
  820.  mov dword [ypos],36
  821.  mov edx,pname
  822.  mov eax,4
  823.  mov ebx,[ypos]
  824.  shl ebx,16
  825.  add ebx,[xpos]
  826.  mov ecx,0x00ddeeff
  827.  mov esi,12
  828.  int 0x40
  829.  
  830.  cld
  831.  mov ecx,11
  832.  mov edi,tic_table
  833.  add edi,dword [linen]
  834.  mov esi,pname
  835.  rep movsb
  836.  
  837.  add dword [linen],10
  838.  add dword [linel],10
  839.  
  840.  mov dword [ypos],94
  841.  mov ebx,[tic_table+22]
  842.  mov dword [fnumb],8
  843.  call decnumb
  844.  
  845.  cld
  846.  mov ecx,8
  847.  mov edi,tic_table
  848.  add edi,dword [linen]
  849.  mov esi,tic_table+200
  850.  rep movsb
  851.  
  852.  add dword [linen],10
  853.  add dword [linel],10
  854.  
  855.  mov dword [ypos],154
  856.  mov ebx,[tic_table+26]
  857.  mov dword [fnumb],8
  858.  call decnumb
  859.  
  860.  cld
  861.  mov ecx,8
  862.  mov edi,tic_table
  863.  add edi,dword [linen]
  864.  mov esi,tic_table+200
  865.  rep movsb
  866.  
  867.  add dword [linen],12
  868.  add dword [linel],12
  869.  
  870.  mov dword [ypos],228
  871.  mov ebx,[pn]
  872.  mov dword [fnumb],4
  873.  call decnumb
  874.  
  875.  cld
  876.  mov ecx,4
  877.  mov edi,tic_table
  878.  add edi,dword [linen]
  879.  mov esi,tic_table+200
  880.  rep movsb
  881.  
  882.  add dword [linel],4
  883.  add dword [linen],4
  884.  
  885.  call newline
  886.  
  887.  mov dword [ypos],60
  888.  
  889.  cmp dword [xpos],254
  890.  jne nscreen
  891.  
  892.  call pause2
  893.  call cls2
  894.  
  895.  mov dword [xpos],24
  896.  call newline
  897.  mov dword [ypos],60
  898.  
  899.  mov edx,proc_head
  900.  call printf
  901.  call newline
  902.  mov edx,proc_hd11
  903.  call printf
  904.  call newline
  905.  call newline
  906.  
  907. nscreen:
  908.  mov eax, dword [count2]
  909.  cmp dword [pn],eax
  910.  jne ll1
  911.  mov dword [pn],0
  912.  
  913.  cmp byte [callp],1
  914.  je go
  915.  
  916.  jmp ecmd2
  917.  
  918. printn:
  919.  mov eax,47
  920.  shl ebx,16
  921.  mov edx,[ypos]
  922.  shl edx,16
  923.  add edx,[xpos]
  924.  mov esi,0x00ddeeff
  925.  int 0x40
  926.  ret
  927.  
  928. pause2:
  929.  call newline
  930.  mov edx,mess1
  931.  call printf
  932.  
  933.  mov eax,10
  934.  int 0x40
  935.  
  936. red3:
  937.  cmp eax,2
  938.  je back
  939.  cmp eax,3
  940.  je exit
  941.  
  942.  call draw
  943.  call red
  944.  
  945.  mov eax,10
  946.  int 0x40
  947.  jmp red3
  948.  
  949. back:
  950.  mov eax,2
  951.  int 0x40
  952.  cmp ah,27
  953.  je checmd
  954.  ret
  955.  
  956. exit:
  957.  mov eax,-1
  958.  int 0x40
  959.  
  960. checmd:
  961.  cmp byte [callp],1
  962.  je ecmd3
  963.  
  964.  jmp ecmd
  965.  
  966. err:
  967.  call clearsum
  968.  
  969.  call newline
  970.  
  971.  call ppr
  972.  cmp dword [count],0
  973.  je ecmd1
  974.  mov edx,err1
  975.  mov eax,4
  976.  mov ebx,[ypos]
  977.  shl ebx,16
  978.  add ebx,[xpos]
  979.  mov ecx,0x00ddeeff
  980.  mov esi,27
  981.  int 0x40
  982.  
  983.  cld
  984.  mov ecx,27
  985.  mov edi,tic_table
  986.  add edi,dword [linen]
  987.  mov esi,err1
  988.  rep movsb
  989.  
  990.  add dword [linen],27
  991.  add dword [linel],27
  992.  
  993.  call clearcmd
  994.  
  995.  jmp cmd_ok2
  996.  
  997. nparam:
  998.  cmp byte [callp],1
  999.  je gonext4
  1000.  call clearsum
  1001. gonext4:
  1002.  call newline
  1003.  mov edx,mess2
  1004.  call printf
  1005.  
  1006.  cmp byte [callp],1
  1007.  je go
  1008.  
  1009.  jmp ecmd
  1010.  
  1011. nparam2:
  1012.  cmp byte [callp],1
  1013.  je gonext3
  1014.  call clearsum
  1015. gonext3:
  1016.  call newline
  1017.  mov edx,mess5
  1018.  call printf
  1019.  
  1020.  cmp byte [callp],0
  1021.  je ecmd
  1022.  
  1023.  jmp go
  1024.  
  1025. cp:
  1026.  cmp byte [callp],1
  1027.  je gonext10
  1028.  call clearsum
  1029. gonext10:
  1030.  sub dword [count],3
  1031.  
  1032.  cld
  1033.  mov ecx,dword [count]
  1034.  mov edi,tic_table+400
  1035.  mov esi,tic_table+600
  1036.  add esi,3
  1037.  rep movsb
  1038.  
  1039.  mov ecx,12
  1040. loop50:
  1041.  cmp byte [tic_table+400+ecx],'+'
  1042.  je file2
  1043.  
  1044.  loop loop50
  1045.  
  1046.  add dword [count],3
  1047.  jmp nparam3
  1048.  
  1049. file2:
  1050.  mov dword [f1len],ecx
  1051.  
  1052.  inc ecx
  1053.  mov ebx,ecx
  1054.  cld
  1055.  mov edi,tic_table+9000
  1056.  mov esi,tic_table+400
  1057.  rep movsb
  1058.  
  1059.  mov ecx,12
  1060.  mov edi,tic_table+9100
  1061.  mov esi,tic_table+400
  1062.  add esi,ebx
  1063.  rep movsb
  1064.  
  1065.  mov ebx,tic_table+9000
  1066.  push esi edi ecx eax
  1067.  mov esi,ebx
  1068.  
  1069.  mov edi,tic_table+9000
  1070.  mov ecx,12
  1071. strup3:
  1072.  mov al,[esi]
  1073.  cmp al,'A'
  1074.  jb @f
  1075.  cmp al,'z'
  1076.  ja @f
  1077.  cmp al,'a'
  1078.  jb @f
  1079.  add al,-0x20
  1080. @@:
  1081.  mov [edi],al
  1082.  inc esi
  1083.  inc edi
  1084.  dec ecx
  1085.  jnz strup3
  1086.  pop eax ecx edi esi
  1087.  
  1088.  mov ecx,dword [f1len]
  1089.  
  1090. loopcp:
  1091.  cmp byte [tic_table+9000+ecx],'.'
  1092.  je chdotcp
  1093.  
  1094.  loop loopcp
  1095.  
  1096.  jmp chnodotcp
  1097.  
  1098. chdotcp:
  1099.  mov ebx,dword [f1len]
  1100.  
  1101.  cld
  1102.  mov ecx,4
  1103.  mov edi,tic_table+9000
  1104.  add edi,ebx
  1105.  mov esi,dzero
  1106.  rep movsb
  1107.  
  1108.  jmp gocp1
  1109.  
  1110. chnodotcp:
  1111.  mov ebx,dword [f1len]
  1112.  
  1113.  mov edi,tic_table+9000
  1114.  add edi,ebx
  1115.  mov esi,ddot
  1116.  movsb
  1117.  
  1118.  inc ebx
  1119.  
  1120.  cld
  1121.  mov ecx,3
  1122.  mov edi,tic_table+9000
  1123.  add edi,ebx
  1124.  mov esi,fill3
  1125.  rep movsb
  1126.  
  1127. gocp1:
  1128.  mov eax,6
  1129.  mov ebx,tic_table+9000
  1130.  mov ecx,0
  1131.  mov edx,-1
  1132.  mov esi,tic_table+25000
  1133.  int 0x40
  1134.  
  1135.  cmp eax,4294967295
  1136.  je nosuchfile
  1137.  
  1138.  mov dword [filesize],eax
  1139.  
  1140.  mov ebx,tic_table+9100
  1141.  push esi edi ecx eax
  1142.  mov esi,ebx
  1143.  
  1144.  mov edi,tic_table+9100
  1145.  mov ecx,12
  1146. strup4:
  1147.  mov al,[esi]
  1148.  cmp al,'A'
  1149.  jb @f
  1150.  cmp al,'z'
  1151.  ja @f
  1152.  cmp al,'a'
  1153.  jb @f
  1154.  add al,-0x20
  1155. @@:
  1156.  mov [edi],al
  1157.  inc esi
  1158.  inc edi
  1159.  dec ecx
  1160.  jnz strup4
  1161.  pop eax ecx edi esi
  1162.  
  1163.  mov ebx,dword [f1len]
  1164.  mov ecx,dword [count]
  1165.  sub ecx,ebx
  1166.  
  1167.  mov dword [f2len],ecx
  1168.  
  1169. loopcp2:
  1170.  cmp byte [tic_table+9100+ecx],'.'
  1171.  je chdotcp2
  1172.  
  1173.  loop loopcp2
  1174.  
  1175.  jmp chnodotcp2
  1176.  
  1177. chdotcp2:
  1178.  mov ebx,dword [f2len]
  1179.  
  1180.  cld
  1181.  mov ecx,4
  1182.  mov edi,tic_table+9100
  1183.  add edi,ebx
  1184.  mov esi,dzero
  1185.  rep movsb
  1186.  
  1187.  jmp gocp2
  1188.  
  1189. chnodotcp2:
  1190.  mov ebx,dword [f2len]
  1191.  
  1192.  mov edi,tic_table+9100
  1193.  add edi,ebx
  1194.  mov esi,ddot
  1195.  movsb
  1196.  
  1197.  inc ebx
  1198.  
  1199.  cld
  1200.  mov ecx,3
  1201.  mov edi,tic_table+9100
  1202.  add edi,ebx
  1203.  mov esi,fill3
  1204.  rep movsb
  1205.  
  1206. gocp2:
  1207.  mov eax,6
  1208.  mov ebx,tic_table+9100
  1209.  mov ecx,0
  1210.  mov edx,-1
  1211.  mov esi,tic_table+25000
  1212.  int 0x40
  1213.  
  1214.  cmp eax,4294967295
  1215.  jne alreadyexist
  1216.  
  1217.  mov eax,33
  1218.  mov ebx,tic_table+9100
  1219.  mov ecx,tic_table+25000
  1220.  mov edx,dword [filesize]
  1221.  mov esi,0
  1222.  int 0x40
  1223.  
  1224.  cmp eax,0
  1225.  jne no_ok
  1226.  
  1227.  mov eax,6
  1228.  mov ebx,tic_table+9100
  1229.  mov ecx,0
  1230.  mov edx,-1
  1231.  mov esi,tic_table+25000
  1232.  int 0x40
  1233.  
  1234.  cmp eax,4294967295
  1235.  je no_ok
  1236.  
  1237.  call newline
  1238.  mov edx,mess11
  1239.  call printf
  1240.  jmp cp_end
  1241.  
  1242. no_ok:
  1243.  call newline
  1244.  mov edx,mess12
  1245.  call printf
  1246.  
  1247. cp_end:
  1248.  add dword [count],3
  1249.  
  1250.  cmp byte [callp],1
  1251.  je go
  1252.  
  1253.  jmp ecmd
  1254.  
  1255. alreadyexist:
  1256.  add dword [count],3
  1257.  call newline
  1258.  mov edx,mess13
  1259.  call printf
  1260.  
  1261.  cmp byte [callp],1
  1262.  je go
  1263.  
  1264.  jmp ecmd
  1265.  
  1266. rn:
  1267.  cmp byte [callp],1
  1268.  je gonext11
  1269.  call clearsum
  1270. gonext11:
  1271.  sub dword [count],3
  1272.  
  1273.  cld
  1274.  mov ecx,dword [count]
  1275.  mov edi,tic_table+400
  1276.  mov esi,tic_table+600
  1277.  add esi,3
  1278.  rep movsb
  1279.  
  1280.  mov ecx,12
  1281. loop51:
  1282.  push ecx
  1283.  cmp byte [tic_table+400+ecx],'+'
  1284.  je file3
  1285.  
  1286.  pop ecx
  1287.  loop loop51
  1288.  
  1289.  add dword [count],3
  1290.  jmp nparam4
  1291.  
  1292. file3:
  1293.  mov dword [f1len],ecx
  1294.  
  1295.  inc ecx
  1296.  mov ebx,ecx
  1297.  cld
  1298.  mov edi,tic_table+9000
  1299.  mov esi,tic_table+400
  1300.  rep movsb
  1301.  
  1302.  mov ecx,12
  1303.  mov edi,tic_table+9100
  1304.  mov esi,tic_table+400
  1305.  add esi,ebx
  1306.  rep movsb
  1307.  
  1308.  mov ebx,tic_table+9000
  1309.  push esi edi ecx eax
  1310.  mov esi,ebx
  1311.  
  1312.  mov edi,tic_table+9000
  1313.  mov ecx,12
  1314. strup5:
  1315.  mov al,[esi]
  1316.  cmp al,'A'
  1317.  jb @f
  1318.  cmp al,'z'
  1319.  ja @f
  1320.  cmp al,'a'
  1321.  jb @f
  1322.  add al,-0x20
  1323. @@:
  1324.  mov [edi],al
  1325.  inc esi
  1326.  inc edi
  1327.  dec ecx
  1328.  jnz strup5
  1329.  pop eax ecx edi esi
  1330.  
  1331.  mov ecx,dword [f1len]
  1332.  
  1333. looprn:
  1334.  cmp byte [tic_table+9000+ecx],'.'
  1335.  je chdotrn
  1336.  
  1337.  loop looprn
  1338.  
  1339.  jmp chnodotrn
  1340.  
  1341. chdotrn:
  1342.  mov ebx,dword [f1len]
  1343.  
  1344.  cld
  1345.  mov ecx,4
  1346.  mov edi,tic_table+9000
  1347.  add edi,ebx
  1348.  mov esi,dzero
  1349.  rep movsb
  1350.  
  1351.  jmp gorn1
  1352.  
  1353. chnodotrn:
  1354.  mov ebx,dword [f1len]
  1355.  
  1356.  mov edi,tic_table+9000
  1357.  add edi,ebx
  1358.  mov esi,ddot
  1359.  movsb
  1360.  
  1361.  inc ebx
  1362.  
  1363.  cld
  1364.  mov ecx,3
  1365.  mov edi,tic_table+9000
  1366.  add edi,ebx
  1367.  mov esi,fill3
  1368.  rep movsb
  1369.  
  1370. gorn1:
  1371.  mov eax,6
  1372.  mov ebx,tic_table+9000
  1373.  mov ecx,0
  1374.  mov edx,-1
  1375.  mov esi,tic_table+25000
  1376.  int 0x40
  1377.  
  1378.  cmp eax,4294967295
  1379.  je nosuchfile
  1380.  
  1381.  mov ebx,tic_table+9100
  1382.  push esi edi ecx eax
  1383.  mov esi,ebx
  1384.  
  1385.  mov edi,tic_table+9100
  1386.  mov ecx,12
  1387. strup6:
  1388.  mov al,[esi]
  1389.  cmp al,'A'
  1390.  jb @f
  1391.  cmp al,'z'
  1392.  ja @f
  1393.  cmp al,'a'
  1394.  jb @f
  1395.  add al,-0x20
  1396. @@:
  1397.  mov [edi],al
  1398.  inc esi
  1399.  inc edi
  1400.  dec ecx
  1401.  jnz strup6
  1402.  pop eax ecx edi esi
  1403.  
  1404.  mov ebx,dword [f1len]
  1405.  mov ecx,dword [count]
  1406.  sub ecx,ebx
  1407.  
  1408.  mov dword [f2len],ecx
  1409.  
  1410. looprn2:
  1411.  cmp byte [tic_table+9100+ecx],'.'
  1412.  je chdotrn2
  1413.  
  1414.  loop looprn2
  1415.  
  1416.  jmp chnodotrn2
  1417.  
  1418. chdotrn2:
  1419.  mov ebx,dword [f2len]
  1420.  
  1421.  cld
  1422.  mov ecx,4
  1423.  mov edi,tic_table+9100
  1424.  add edi,ebx
  1425.  mov esi,dzero
  1426.  rep movsb
  1427.  
  1428.  jmp gorn2
  1429.  
  1430. chnodotrn2:
  1431.  mov ebx,dword [f2len]
  1432.  
  1433.  mov edi,tic_table+9100
  1434.  add edi,ebx
  1435.  mov esi,ddot
  1436.  movsb
  1437.  
  1438.  inc ebx
  1439.  
  1440.  cld
  1441.  mov ecx,3
  1442.  mov edi,tic_table+9100
  1443.  add edi,ebx
  1444.  mov esi,fill3
  1445.  rep movsb
  1446.  
  1447. gorn2:
  1448.  mov eax,6
  1449.  mov ebx,tic_table+9100
  1450.  mov ecx,0
  1451.  mov edx,-1
  1452.  mov esi,tic_table+25000
  1453.  int 0x40
  1454.  
  1455.  cmp eax,4294967295
  1456.  jne alreadyexist
  1457.  
  1458.  mov eax,6
  1459.  mov ebx,tic_table+9000
  1460.  mov ecx,0
  1461.  mov edx,-1
  1462.  mov esi,tic_table+25000
  1463.  int 0x40
  1464.  
  1465.  mov dword [filesize],eax
  1466.  
  1467.  mov eax,33
  1468.  mov ebx,tic_table+9100
  1469.  mov ecx,tic_table+25000
  1470.  mov edx,dword [filesize]
  1471.  mov esi,0
  1472.  int 0x40
  1473.  
  1474.  cmp eax,0
  1475.  jne no_ok1
  1476.  
  1477.  mov eax,6
  1478.  mov ebx,tic_table+9100
  1479.  mov ecx,0
  1480.  mov edx,-1
  1481.  mov esi,tic_table+25000
  1482.  int 0x40
  1483.  
  1484.  cmp eax,4294967295
  1485.  je no_ok1
  1486.  
  1487.  mov eax,32
  1488.  mov ebx,tic_table+9000
  1489.  int 0x40
  1490.  
  1491.  call newline
  1492.  mov edx,mess14
  1493.  call printf
  1494.  jmp rn_end
  1495.  
  1496. no_ok1:
  1497.  call newline
  1498.  mov edx,mess15
  1499.  call printf
  1500.  
  1501. rn_end:
  1502.  add dword [count],3
  1503.  
  1504.  cmp byte [callp],1
  1505.  je go
  1506.  
  1507.  jmp ecmd
  1508.  
  1509. del:
  1510.  cmp byte [callp],1
  1511.  je gonext12
  1512.  call clearsum
  1513. gonext12:
  1514.  sub dword [count],4
  1515.  
  1516.  cld
  1517.  mov ecx,dword [count]
  1518.  mov edi,tic_table+400
  1519.  mov esi,tic_table+600
  1520.  add esi,4
  1521.  rep movsb
  1522.  
  1523.  mov ebx,tic_table+400
  1524.  push esi edi ecx eax
  1525.  mov esi,ebx
  1526.  
  1527.  mov edi,tic_table+400
  1528.  mov ecx,70
  1529. strup1:
  1530.  mov al,[esi]
  1531.  cmp al,'A'
  1532.  jb @f
  1533.  cmp al,'z'
  1534.  ja @f
  1535.  cmp al,'a'
  1536.  jb @f
  1537.  add al,-0x20
  1538. @@:
  1539.  mov [edi],al
  1540.  inc esi
  1541.  inc edi
  1542.  dec ecx
  1543.  jnz strup1
  1544.  pop eax ecx edi esi
  1545.  
  1546.  mov ecx,dword [count]
  1547.  
  1548. loopdel:
  1549.  cmp byte [tic_table+400+ecx],'.'
  1550.  je chdotdel
  1551.  
  1552.  loop loopdel
  1553.  
  1554.  jmp chnodotdel
  1555.  
  1556. chdotdel:
  1557.  mov ebx,dword [count]
  1558.  
  1559.  cld
  1560.  mov ecx,4
  1561.  mov edi,tic_table+400
  1562.  add edi,ebx
  1563.  mov esi,dzero
  1564.  rep movsb
  1565.  
  1566.  jmp godel
  1567.  
  1568. chnodotdel:
  1569.  mov ebx,dword [count]
  1570.  
  1571.  mov edi,tic_table+400
  1572.  add edi,ebx
  1573.  mov esi,ddot
  1574.  movsb
  1575.  
  1576.  inc ebx
  1577.  
  1578.  cld
  1579.  mov ecx,3
  1580.  mov edi,tic_table+400
  1581.  add edi,ebx
  1582.  mov esi,fill3
  1583.  rep movsb
  1584.  
  1585. godel:
  1586.  mov eax,6
  1587.  mov ebx,tic_table+400
  1588.  mov ecx,0
  1589.  mov edx,-1
  1590.  mov esi,tic_table+25000
  1591.  int 0x40
  1592.  
  1593.  cmp eax,4294967295
  1594.  je nosuchfile2
  1595.  
  1596.  mov eax,32
  1597.  mov ebx,tic_table+400
  1598.  int 0x40
  1599.  
  1600.  call newline
  1601.  mov edx,mess6
  1602.  call printf
  1603.  
  1604.  add dword [count],4
  1605.  
  1606. del_end:
  1607.  add dword [count],4
  1608.  
  1609.  cmp byte [callp],1
  1610.  je go
  1611.  
  1612.  jmp ecmd
  1613.  
  1614. nosuchfile:
  1615.  add dword [count],3
  1616.  call newline
  1617.  mov edx,mess7
  1618.  call printf
  1619.  
  1620.  cmp byte [callp],0
  1621.  je ecmd
  1622.  
  1623.  jmp go
  1624.  
  1625. nosuchfile2:
  1626.  add dword [count],4
  1627.  call newline
  1628.  mov edx,mess7
  1629.  call printf
  1630.  
  1631.  cmp byte [callp],1
  1632.  je go
  1633.  
  1634.  jmp ecmd
  1635.  
  1636. nosuchfile3:
  1637.  inc dword [count]
  1638.  call newline
  1639.  mov edx,mess7
  1640.  call printf
  1641.  jmp ecmd
  1642.  
  1643. autoexec:
  1644.  mov eax,6
  1645.  mov ebx,autoexfile
  1646.  mov ecx,0
  1647.  mov edx,-1
  1648.  mov esi,tic_table+15000
  1649.  int 0x40
  1650.  
  1651.  cmp eax,4294967295
  1652.  je noaxfile
  1653.  
  1654.  sub dword [linen],81
  1655.  sub dword [xpos],10
  1656.  dec dword [lpress]
  1657.  
  1658.  jmp autolabel
  1659.  
  1660. noaxfile:
  1661.  ret
  1662.  
  1663. command:
  1664.  call clearsum
  1665.  dec dword [count]
  1666.  
  1667.  cld
  1668.  mov ecx,dword [count]
  1669.  mov edi,filename
  1670.  mov esi,tic_table+601
  1671.  rep movsb
  1672.  
  1673.  mov ebx,filename
  1674.  push esi edi ecx eax
  1675.  mov esi,ebx
  1676.  
  1677.  mov edi,filename
  1678.  mov ecx,12
  1679. strup7:
  1680.  mov al,[esi]
  1681.  cmp al,'A'
  1682.  jb @f
  1683.  cmp al,'z'
  1684.  ja @f
  1685.  cmp al,'a'
  1686.  jb @f
  1687.  add al,-0x20
  1688. @@:
  1689.  mov [edi],al
  1690.  inc esi
  1691.  inc edi
  1692.  dec ecx
  1693.  jnz strup7
  1694.  pop eax ecx edi esi
  1695.  
  1696.  cld
  1697.  mov ecx,4
  1698.  mov edi,filename+8
  1699.  mov esi,dcmd
  1700.  rep movsb
  1701.  
  1702.  mov eax,6
  1703.  mov ebx,filename
  1704.  mov ecx,0
  1705.  mov edx,-1
  1706.  mov esi,tic_table+15000
  1707.  int 0x40
  1708.  
  1709.  cmp eax,4294967295
  1710.  je nosuchfile3
  1711.  
  1712. autolabel:
  1713.  mov dword [filesize2],eax
  1714.  mov byte [callp],1
  1715.  
  1716. go:
  1717.  call clearcmd
  1718.  
  1719. gonext:
  1720.  cmp dword [filesize2],0
  1721.  je ecmd3
  1722.  
  1723.  mov ebx,tic_table
  1724.  add ebx,dword [readcnt]
  1725.  cmp byte [ebx],13
  1726.  je read
  1727.  
  1728.  inc dword [readcnt]
  1729.  inc dword [readcnt2]
  1730.  dec dword [filesize2]
  1731.  
  1732.  jmp gonext
  1733.  
  1734. read:
  1735.  mov ecx,dword [readcnt2]
  1736.  mov ebx,0
  1737.  mov edx,dword [readcnt]
  1738.  sub edx,dword [readcnt2]
  1739. loop60:
  1740.  push ecx
  1741.  mov edi,tic_table+600
  1742.  add edi,ebx
  1743.  mov esi,tic_table
  1744.  add esi,edx
  1745.  movsb
  1746.  
  1747.  inc ebx
  1748.  inc edx
  1749.  
  1750.  pop ecx
  1751.  loop loop60
  1752.  
  1753.  mov eax,dword [readcnt2]
  1754.  mov dword [count],eax
  1755.  
  1756.  mov dword [readcnt2],0
  1757.  add dword [readcnt],2
  1758.  
  1759.  jmp checkcmd
  1760.  
  1761. decnumb:
  1762.  cmp dword [fnumb],4
  1763.  je go1
  1764.  
  1765.  call divide
  1766.  mov dword [n8],edx
  1767.  mov ebx,eax
  1768.  call divide
  1769.  mov dword [n7],edx
  1770.  mov ebx,eax
  1771.  call divide
  1772.  mov dword [n6],edx
  1773.  mov ebx,eax
  1774.  call divide
  1775.  mov dword [n5],edx
  1776.  mov ebx,eax
  1777.  
  1778. go1:
  1779.  call divide
  1780.  mov dword [n4],edx
  1781.  mov ebx,eax
  1782.  call divide
  1783.  mov dword [n3],edx
  1784.  mov ebx,eax
  1785.  call divide
  1786.  mov dword [n2],edx
  1787.  mov ebx,eax
  1788.  call divide
  1789.  mov dword [n1],edx
  1790.  
  1791.  add dword [n1],48
  1792.  add dword [n2],48
  1793.  add dword [n3],48
  1794.  add dword [n4],48
  1795.  
  1796.  cmp dword [fnumb],4
  1797.  je go2
  1798.  
  1799.  add dword [n5],48
  1800.  add dword [n6],48
  1801.  add dword [n7],48
  1802.  add dword [n8],48
  1803.  
  1804. go2:
  1805.  mov edi,tic_table+200
  1806.  mov esi,n1
  1807.  movsb
  1808.  mov edi,tic_table+201
  1809.  mov esi,n2
  1810.  movsb
  1811.  mov edi,tic_table+202
  1812.  mov esi,n3
  1813.  movsb
  1814.  mov edi,tic_table+203
  1815.  mov esi,n4
  1816.  movsb
  1817.  
  1818.  cmp dword [fnumb],4
  1819.  je go4
  1820.  
  1821.  mov edi,tic_table+204
  1822.  mov esi,n5
  1823.  movsb
  1824.  mov edi,tic_table+205
  1825.  mov esi,n6
  1826.  movsb
  1827.  mov edi,tic_table+206
  1828.  mov esi,n7
  1829.  movsb
  1830.  mov edi,tic_table+207
  1831.  mov esi,n8
  1832.  movsb
  1833.  
  1834. go4:
  1835.  mov eax,4
  1836.  mov ebx,[ypos]
  1837.  shl ebx,16
  1838.  add ebx,[xpos]
  1839.  mov ecx,0x00ddeeff
  1840.  mov edx,tic_table+200
  1841.  mov esi,dword [fnumb]
  1842.  int 0x40
  1843.  
  1844.  ret
  1845.  
  1846. divide:
  1847.  mov eax,ebx
  1848.  xor edx,edx
  1849.  mov ecx,10
  1850.  div ecx
  1851.  ret
  1852.  
  1853. kill:
  1854.  mov eax,0
  1855.  mov ebx,0
  1856.  mov ecx,0
  1857.  mov edx,0
  1858.  
  1859.  mov al, byte [tic_table+608]
  1860.  mov bl, byte [tic_table+607]
  1861.  mov cl, byte [tic_table+606]
  1862.  mov dl, byte [tic_table+605]
  1863.  
  1864.  sub al,48
  1865.  sub bl,48
  1866.  sub cl,48
  1867.  sub dl,48
  1868.  
  1869.  imul ebx,10
  1870.  imul ecx,100
  1871.  imul edx,1000
  1872.  
  1873.  mov esi,0
  1874.  add esi,eax
  1875.  add esi,ebx
  1876.  add esi,ecx
  1877.  add esi,edx
  1878.  mov ecx,esi
  1879.  
  1880.  mov eax,9
  1881.  mov ebx,tic_table
  1882.  int 0x40
  1883.  
  1884.  cmp eax,ecx
  1885.  jb nosuchprocess
  1886.  
  1887.  mov eax,18
  1888.  mov ebx,2
  1889.  mov edx,0
  1890.  int 0x40
  1891.  
  1892.  call clearsum
  1893.  call newline
  1894.  mov edx,mess3
  1895.  call printf
  1896.  call newline
  1897.  mov edx,mess4
  1898.  call printf
  1899.  
  1900.  cmp byte [callp],1
  1901.  je go
  1902.  
  1903.  jmp ecmd
  1904.  
  1905. ecmd1:
  1906.  sub dword [xpos],10
  1907.  jmp ecmd
  1908.  
  1909. nosuchprocess:
  1910.  call clearsum
  1911.  call newline
  1912.  mov edx,mess8
  1913.  call printf
  1914.  
  1915.  cmp byte [callp],1
  1916.  je go
  1917.  
  1918.  jmp ecmd
  1919.  
  1920. echoeol:
  1921.  cmp byte [callp],1
  1922.  je gonext15
  1923.  call clearsum
  1924. gonext15:
  1925.  call newline
  1926.  
  1927.  cmp byte [callp],1
  1928.  je go
  1929.  
  1930.  jmp ecmd
  1931.  
  1932. echo:
  1933.  cmp byte [callp],1
  1934.  je gonext13
  1935.  call clearsum
  1936. gonext13:
  1937.  sub dword [count],5
  1938.  
  1939.  cld
  1940.  mov ecx,dword [count]
  1941.  mov edi,tic_table+300
  1942.  mov esi,tic_table+600
  1943.  add esi,5
  1944.  rep movsb
  1945.  
  1946.  call newline
  1947.  
  1948.  mov eax,4
  1949.  mov ebx,6
  1950.  shl ebx,16
  1951.  add ebx,[xpos]
  1952.  mov edx,tic_table+300
  1953.  mov ecx,0x00ddeeff
  1954.  mov esi,dword [count]
  1955.  int 0x40
  1956.  
  1957.  cld
  1958.  mov ecx,dword [count]
  1959.  mov edi,tic_table
  1960.  add edi,dword [linen]
  1961.  mov esi,tic_table+300
  1962.  rep movsb
  1963.  
  1964.  mov eax,dword [count]
  1965.  add dword [linen],eax
  1966.  add dword [linel],eax
  1967.  
  1968.  add dword [count],5
  1969.  
  1970.  cmp byte [callp],1
  1971.  je go
  1972.  
  1973.  jmp ecmd
  1974.  
  1975. printf:
  1976.  mov eax,4
  1977.  mov ebx,6
  1978.  shl ebx,16
  1979.  add ebx,[xpos]
  1980.  mov ecx,0x00ddeeff
  1981.  mov esi,45
  1982.  int 0x40
  1983.  
  1984.  cld
  1985.  mov ecx,45
  1986.  mov edi,tic_table
  1987.  add edi,dword [linen]
  1988.  mov esi,edx
  1989.  rep movsb
  1990.  
  1991.  add dword [linen],46
  1992.  add dword [linel],46
  1993.  
  1994.  add dword [ypos],6
  1995.  
  1996.  ret
  1997.  
  1998. printipc:
  1999.  mov eax,4
  2000.  mov ebx,6
  2001.  shl ebx,16
  2002.  add ebx,[xpos]
  2003.  mov ecx,0x00ddeeff
  2004.  mov esi,79
  2005.  int 0x40
  2006.  
  2007.  cld
  2008.  mov ecx,79
  2009.  mov edi,tic_table
  2010.  add edi,dword [linen]
  2011.  mov esi,edx
  2012.  rep movsb
  2013.  
  2014.  add dword [linen],80
  2015.  add dword [linel],80
  2016.  
  2017.  mov dword [ypos],480
  2018.  
  2019.  ret
  2020.  
  2021. clearcmd:
  2022.  cld
  2023.  mov ecx,80
  2024.  mov edi,tic_table+600
  2025.  mov esi,tic_table+500
  2026.  rep movsb
  2027.  
  2028.  mov ecx,80
  2029.  mov edi,tic_table+400
  2030.  mov esi,tic_table+500
  2031.  rep movsb
  2032.  
  2033.  mov ecx,81
  2034.  mov edi,tic_table+800
  2035.  mov [esi],byte 'x'
  2036.  rep movsb
  2037.  
  2038.  mov ecx,12
  2039.  mov edi,filename
  2040.  mov esi,pname
  2041.  rep movsb
  2042.  
  2043.  mov dword [count],0
  2044.  mov dword [pn],0
  2045.  mov dword [blockcnt],0
  2046.  mov dword [lscnt],8024
  2047.  ret
  2048.  
  2049. oldcmd:
  2050.  mov eax,dword [count]
  2051.  mov dword [oldcount],eax
  2052.  
  2053.  cld
  2054.  mov ecx,81
  2055.  mov edi,tic_table+900
  2056.  mov esi,tic_table+500
  2057.  rep movsb
  2058.  
  2059.  cld
  2060.  mov ecx,81
  2061.  mov edi,tic_table+900
  2062.  mov esi,tic_table+600
  2063.  rep movsb
  2064.  
  2065.  ret
  2066.  
  2067. ecmd:
  2068.  call oldcmd
  2069.  call clearcmd
  2070.  call newline
  2071.  
  2072.  call ppr
  2073.  call cursor
  2074.  
  2075.  jmp still
  2076.  
  2077. ecmd2:
  2078.  call clearcmd
  2079.  call newline
  2080.  
  2081.  call ppr
  2082.  call cursor
  2083.  jmp still
  2084.  
  2085. ecmd3:
  2086.  call clearcmd
  2087.  call newline
  2088.  
  2089.  call ppr
  2090.  call cursor
  2091.  
  2092.  mov dword [readcnt],15000
  2093.  mov dword [readcnt2],0
  2094.  mov byte [callp],0
  2095.  mov dword [filesize2],0
  2096.  
  2097.  jmp still
  2098.  
  2099. chparam:
  2100.  pop ecx
  2101.  mov eax,ecx
  2102.  mov edx,eax
  2103.  push edx
  2104.  inc eax
  2105.  
  2106.  cld
  2107.  mov edi,tic_table+400
  2108.  mov esi,tic_table+600
  2109.  rep movsb
  2110.  
  2111.  mov ecx,dword [count]
  2112.  sub ecx,eax
  2113.  
  2114.  cld
  2115.  mov edi,tic_table+800
  2116.  mov esi,tic_table+600
  2117.  add esi,eax
  2118.  rep movsb
  2119.  
  2120.  pop edx
  2121.  
  2122.  mov dword [ipccount],edx
  2123.  
  2124.  cld
  2125.  mov ecx,11
  2126.  mov edi,tic_table+400
  2127.  add edi,edx
  2128.  mov esi,qspace
  2129.  rep movsb
  2130.  
  2131.  mov eax,19
  2132.  mov ebx,tic_table+400
  2133.  mov ecx,tic_table+800
  2134.  int 0x40
  2135.  
  2136.  cmp eax,0xfffffff0
  2137.  jb cmd_ok
  2138.  
  2139.  jmp err
  2140.  
  2141. cls:
  2142.  call oldcmd
  2143.  call cls2
  2144.  
  2145.  cmp byte [callp],0
  2146.  jne needret
  2147.  
  2148.  call clearcmd
  2149.  call ppr
  2150.  call cursor
  2151.  
  2152.  jmp still
  2153.  
  2154. needret:
  2155.  sub dword [linen],81
  2156.  dec dword [lpress]
  2157.  sub dword [xpos],10
  2158.  
  2159.  jmp gonext
  2160.  
  2161. cls1:
  2162.  mov eax,13
  2163.  mov ebx,6*65536+486
  2164.  mov ecx,24*65536+250
  2165.  mov edx,0
  2166.  int 0x40
  2167.  ret
  2168.  
  2169. cls2:
  2170.  mov dword [linen],2000
  2171.  mov ecx,2025
  2172. loop2:
  2173.  push ecx
  2174.  mov edi,tic_table
  2175.  add edi,dword [linen]
  2176.  mov esi,fill1
  2177.  movsb
  2178.  
  2179.  inc dword [linen]
  2180.  pop ecx
  2181.  loop loop2
  2182.  
  2183.  mov dword [linel],0
  2184.  mov dword [linen],2000
  2185.  mov dword [linev],2000
  2186.  mov dword [xpos],24
  2187.  mov dword [ypos],6
  2188.  mov dword [lpress],1
  2189.  mov dword [stnum],1
  2190.  
  2191.  call cls1
  2192.  
  2193.  ret
  2194.  
  2195. chscr:
  2196.  cmp dword [xpos],264
  2197.  jne no_scr
  2198.  
  2199.  mov dword [cnt_loop1],4500
  2200.  mov dword [cnt_loop2],2000
  2201.  
  2202.  mov ecx,2025
  2203. loop10:
  2204.  push ecx
  2205.  mov edi,tic_table
  2206.  add edi,dword [cnt_loop1]
  2207.  mov esi,tic_table
  2208.  add esi,dword [cnt_loop2]
  2209.  movsb
  2210.  
  2211.  inc dword [cnt_loop1]
  2212.  inc dword [cnt_loop2]
  2213.  
  2214.  pop ecx
  2215.  loop loop10
  2216.  
  2217.  mov dword [cnt_loop1],2000
  2218.  
  2219.  mov ecx,2025
  2220. loop11:
  2221.  push ecx
  2222.  mov edi,tic_table
  2223.  add edi,dword [cnt_loop1]
  2224.  mov esi,fill1
  2225.  movsb
  2226.  
  2227.  inc dword [cnt_loop1]
  2228.  
  2229.  pop ecx
  2230.  loop loop11
  2231.  
  2232.  mov dword [cnt_loop1],2000
  2233.  mov dword [cnt_loop2],4581
  2234.  
  2235.  mov ecx,1944
  2236. loop12:
  2237.  push ecx
  2238.  mov edi,tic_table
  2239.  add edi,dword [cnt_loop1]
  2240.  mov esi,tic_table
  2241.  add esi,dword [cnt_loop2]
  2242.  movsb
  2243.  
  2244.  inc dword [cnt_loop1]
  2245.  inc dword [cnt_loop2]
  2246.  
  2247.  pop ecx
  2248.  loop loop12
  2249.  
  2250.  dec dword [lpress]
  2251.  sub dword [linen],81
  2252.  
  2253.  mov dword [xpos],264
  2254.  mov dword [ypos],6
  2255.  mov dword [clr],480
  2256.  call clear
  2257.  
  2258.  call red
  2259.  
  2260. no_scr:
  2261.  ret
  2262.  
  2263. newline:
  2264.  call chscr
  2265.  push edx
  2266.  mov edx,81
  2267.  sub edx,dword [linel]
  2268.  add dword [linen],edx
  2269.  pop edx
  2270.  
  2271.  inc dword [lpress]
  2272.  
  2273.  mov dword [linel],0
  2274.  add dword [xpos],10
  2275.  ret
  2276.  
  2277. fill:
  2278.  cld
  2279.  mov ecx,81
  2280.  mov edi,tic_table+500
  2281.  mov esi,fill1
  2282.  rep movsb
  2283.  ret
  2284.  
  2285. nparam3:
  2286.  cmp byte [callp],1
  2287.  je gonext5
  2288.  call clearsum
  2289. gonext5:
  2290.  call newline
  2291.  mov edx,mess9
  2292.  call printf
  2293.  
  2294.  cmp byte [callp],1
  2295.  je go
  2296.  
  2297.  jmp ecmd
  2298.  
  2299. nparam4:
  2300.  cmp byte [callp],1
  2301.  je gonext6
  2302.  call clearsum
  2303. gonext6:
  2304.  call newline
  2305.  mov edx,mess0
  2306.  call printf
  2307.  
  2308.  cmp byte [callp],1
  2309.  je go
  2310.  
  2311.  jmp ecmd
  2312.  
  2313. nparam5:
  2314.  cmp byte [callp],1
  2315.  je gonext14
  2316.  call clearsum
  2317. gonext14:
  2318.  call newline
  2319.  mov edx,mess16
  2320.  call printf
  2321.  jmp ecmd
  2322.  
  2323. endscr:
  2324.  cmp byte [callp],1
  2325.  je ecmd3
  2326.  call clearsum
  2327.  call newline
  2328.  mov edx,mess17
  2329.  call printf
  2330.  jmp ecmd
  2331.  
  2332. checkcmd:
  2333.  cmp dword [tic_table+600],'help'
  2334.  jne no_help
  2335.  cmp dword [count],4
  2336.  jne no_help
  2337.  
  2338.  jmp help
  2339.  
  2340. no_help:
  2341.  cmp dword [tic_table+600],'exit'
  2342.  jne no_exit
  2343.  cmp dword [count],4
  2344.  jne no_exit
  2345.  
  2346.  jmp exit
  2347.  
  2348. no_exit:
  2349.  cmp word [tic_table+600],'ve'
  2350.  jne no_ver
  2351.  cmp byte [tic_table+602],'r'
  2352.  jne no_ver
  2353.  cmp dword [count],3
  2354.  jne no_ver
  2355.  
  2356.  jmp ver
  2357.  
  2358. no_ver:
  2359.  cmp word [tic_table+600],'cl'
  2360.  jne no_cls
  2361.  cmp byte [tic_table+602],'s'
  2362.  jne no_cls
  2363.  cmp dword [count],3
  2364.  jne no_cls
  2365.  
  2366.  jmp cls
  2367.  
  2368. no_cls:
  2369.  cmp dword [tic_table+600],'shut'
  2370.  jne no_shutdown
  2371.  cmp dword [tic_table+604],'down'
  2372.  jne no_shutdown
  2373.  cmp dword [count],8
  2374.  jne no_shutdown
  2375.  
  2376.  mov eax,18
  2377.  mov ebx,1
  2378.  int 0x40
  2379.  
  2380.  mov eax,5
  2381.  mov ebx,200
  2382.  int 0x40
  2383.  
  2384. no_shutdown:
  2385.  cmp word [tic_table+600],'ps'
  2386.  jne no_ps
  2387.  cmp dword [count],2
  2388.  je ps
  2389.  
  2390. no_ps:
  2391.  cmp dword [tic_table+600],'kill'
  2392.  jne no_kill
  2393.  cmp byte [tic_table+604],' '
  2394.  jne no_kill
  2395.  cmp dword [count],9
  2396.  je kill
  2397.  
  2398.  jmp nparam
  2399.  
  2400. no_kill:
  2401.  cmp dword [tic_table+600],'paus'
  2402.  jne no_pause
  2403.  cmp byte [tic_table+604],'e'
  2404.  jne no_pause
  2405.  cmp dword [count],5
  2406.  je pause1
  2407.  
  2408. no_pause:
  2409.  cmp dword [tic_table+600],'echo'
  2410.  jne no_echo
  2411.  cmp dword [count],4
  2412.  je echoeol
  2413.  cmp byte [tic_table+604],' '
  2414.  je echo
  2415.  
  2416. no_echo:
  2417.  cmp word [tic_table+600],'de'
  2418.  jne no_del
  2419.  cmp byte [tic_table+602],'l'
  2420.  jne no_del
  2421.  cmp byte [tic_table+603],' '
  2422.  jne no_del
  2423.  cmp dword [count],3
  2424.  je nparam2
  2425.  cmp dword [count],4
  2426.  je nparam2
  2427.  
  2428.  jmp del
  2429.  
  2430. no_del:
  2431.  cmp word [tic_table+600],'ls'
  2432.  jne no_ls
  2433.  cmp dword [count],2
  2434.  je ls
  2435.  cmp dword [count],3
  2436.  je ls
  2437.  
  2438.  jmp lscheck
  2439.  
  2440. no_ls:
  2441.  cmp word [tic_table+600],'cp'
  2442.  jne no_cp
  2443.  cmp dword [count],2
  2444.  je nparam3
  2445.  cmp dword [count],3
  2446.  je nparam3
  2447.  cmp dword [count],4
  2448.  je nparam3
  2449.  cmp dword [count],5
  2450.  je nparam3
  2451.  cmp byte [tic_table+602],' '
  2452.  jne no_cp
  2453.  
  2454.  jmp cp
  2455.  
  2456. no_cp:
  2457.  cmp word [tic_table+600],'rn'
  2458.  jne no_rn
  2459.  cmp dword [count],2
  2460.  je nparam4
  2461.  cmp dword [count],3
  2462.  je nparam4
  2463.  cmp dword [count],4
  2464.  je nparam4
  2465.  cmp dword [count],5
  2466.  je nparam4
  2467.  cmp byte [tic_table+602],' '
  2468.  jne no_rn
  2469.  
  2470.  jmp rn
  2471.  
  2472. no_rn:
  2473.  cmp dword [tic_table+600],'ends'
  2474.  jne no_end
  2475.  cmp dword [count],4
  2476.  je endscr
  2477.  
  2478. no_end:
  2479.  cmp byte [callp],1
  2480.  je checkprg
  2481.  
  2482.  ret
  2483.  
  2484. checkprg:
  2485.  mov ebx,tic_table+600
  2486.  push esi edi ecx eax
  2487.  mov esi,ebx
  2488.  
  2489.  mov edi,tic_table+600
  2490.  mov ecx,74
  2491. strup:
  2492.  mov al,[esi]
  2493.  cmp al,'A'
  2494.  jb @f
  2495.  cmp al,'z'
  2496.  ja @f
  2497.  cmp al,'a'
  2498.  jb @f
  2499.  add al,-0x20
  2500. @@:
  2501.  mov [edi],al
  2502.  inc esi
  2503.  inc edi
  2504.  dec ecx
  2505.  jnz strup
  2506.  pop eax ecx edi esi
  2507.  
  2508.  mov ecx,dword [count]
  2509. loop20:
  2510.  push ecx
  2511.  cmp byte [tic_table+600+ecx],'&'
  2512.  je chparam
  2513.  
  2514.  pop ecx
  2515.  loop loop20
  2516.  
  2517.  cld
  2518.  mov ecx,11
  2519.  mov edi,tic_table+600
  2520.  add edi,dword [count]
  2521.  mov esi,qspace
  2522.  rep movsb
  2523.  
  2524.  mov eax,19
  2525.  mov ebx,tic_table+600
  2526.  mov ecx,0
  2527.  int 0x40
  2528.  
  2529.  cmp eax,0xfffffff0
  2530.  jb cmd_ok_1
  2531.  
  2532.  jmp err
  2533.  
  2534. cmd_ok_1:
  2535.  mov eax,dword [count]
  2536.  mov dword [ipccount],eax
  2537.  
  2538. cmd_ok:
  2539.  mov eax,60
  2540.  mov ebx,1
  2541.  mov ecx,ipcb
  2542.  mov edx,118
  2543.  int 0x40
  2544.  
  2545.  call clearipc
  2546.  
  2547.  mov eax,40
  2548.  mov ebx,01000111b
  2549.  int 0x40
  2550.  
  2551.  mov eax,23
  2552.  mov ebx,10
  2553.  int 0x40
  2554.  
  2555.  cmp eax,7
  2556.  jne noipc
  2557.  
  2558.  cmp byte [callp],1
  2559.  je printipcprgname
  2560.  
  2561.  call clearsum
  2562.  
  2563. ipccontinue:
  2564.  mov eax,9
  2565.  mov ebx,tic_table+100000
  2566.  mov ecx,-1
  2567.  int 0x40
  2568.  
  2569.  mov ecx,eax
  2570. loopfindipc:
  2571.  push ecx
  2572.  
  2573.  mov eax,9
  2574.  mov ebx,tic_table+100000
  2575.  int 0x40
  2576.  
  2577.  mov bl,[tic_table+600]
  2578.  cmp byte [tic_table+100000+10],bl
  2579.  jne goonipc
  2580.  cmp dword [ipccount],1
  2581.  je ipcfinished
  2582.  
  2583.  mov bl,[tic_table+601]
  2584.  cmp byte [tic_table+100000+11],bl
  2585.  jne goonipc
  2586.  cmp dword [ipccount],2
  2587.  je ipcfinished
  2588.  
  2589.  mov bl,[tic_table+602]
  2590.  cmp byte [tic_table+100000+12],bl
  2591.  jne goonipc
  2592.  cmp dword [ipccount],3
  2593.  je ipcfinished
  2594.  
  2595.  mov bl,[tic_table+603]
  2596.  cmp byte [tic_table+100000+13],bl
  2597.  jne goonipc
  2598.  cmp dword [ipccount],4
  2599.  je ipcfinished
  2600.  
  2601.  mov bl,[tic_table+604]
  2602.  cmp byte [tic_table+100000+14],bl
  2603.  jne goonipc
  2604.  cmp dword [ipccount],5
  2605.  je ipcfinished
  2606.  
  2607.  mov bl,[tic_table+605]
  2608.  cmp byte [tic_table+100000+15],bl
  2609.  jne goonipc
  2610.  cmp dword [ipccount],6
  2611.  je ipcfinished
  2612.  
  2613.  mov bl,[tic_table+606]
  2614.  cmp byte [tic_table+100000+16],bl
  2615.  jne goonipc
  2616.  cmp dword [ipccount],7
  2617.  je ipcfinished
  2618.  
  2619.  mov bl,[tic_table+607]
  2620.  cmp byte [tic_table+100000+17],bl
  2621.  jne goonipc
  2622.  
  2623. goonipc:
  2624.  pop ecx
  2625.  dec ecx
  2626.  jnz loopfindipc
  2627.  
  2628. ipcfinished:
  2629.  mov ebx,[tic_table+100000+30]
  2630.  mov dword [ipcpid],ebx
  2631.  
  2632.  mov eax,60
  2633.  mov ebx,2
  2634.  mov ecx,dword [ipcpid]
  2635.  mov edx,ddot
  2636.  mov esi,1
  2637.  int 0x40
  2638.  
  2639.  call newline
  2640.  call clearipc
  2641.  
  2642.  jmp waitipc
  2643.  
  2644. printipcprgname:
  2645.  call newline
  2646.  call printcmd
  2647.  jmp ipccontinue
  2648.  
  2649. noipc:
  2650.  cmp byte [callp],1
  2651.  je prtcmd
  2652.  
  2653.  call clearsum
  2654.  
  2655.  jmp cmd_ok2
  2656.  
  2657. printcmd:
  2658.  mov eax,4
  2659.  mov ebx,6
  2660.  shl ebx,16
  2661.  add ebx,[xpos]
  2662.  mov edx,tic_table+600
  2663.  mov ecx,0x00ddeeff
  2664.  mov esi,dword [count]
  2665.  int 0x40
  2666.  
  2667.  cld
  2668.  mov ecx,dword [count]
  2669.  mov edi,tic_table
  2670.  add edi,dword [linen]
  2671.  mov esi,tic_table+600
  2672.  rep movsb
  2673.  
  2674.  mov eax,dword [count]
  2675.  add dword [linen],eax
  2676.  add dword [linel],eax
  2677.  
  2678.  ret
  2679.  
  2680. prtcmd:
  2681.  call newline
  2682.  call printcmd
  2683.  jmp go
  2684.  
  2685. cmd_ok2:
  2686.  cmp byte [callp],1
  2687.  je go
  2688.  
  2689.  ret
  2690.  
  2691. waitipc:
  2692.  mov eax,40
  2693.  mov ebx,01000111b
  2694.  int 0x40
  2695.  
  2696.  mov eax,10
  2697.  int 0x40
  2698.  
  2699.  cmp eax,7
  2700.  je ipcok
  2701.  cmp eax,1
  2702.  je reipc
  2703.  cmp eax,3
  2704.  je exit
  2705.  cmp eax,2
  2706.  je keyipc
  2707.  
  2708.  jmp waitipc
  2709.  
  2710. keyipc:
  2711.  mov eax,2
  2712.  int 0x40
  2713.  
  2714.  jmp waitipc
  2715.  
  2716. reipc:
  2717.  call draw
  2718.  call red
  2719.  
  2720.  jmp waitipc
  2721.  
  2722. clearipc:
  2723.  cld
  2724.  mov ecx,118
  2725.  mov edi,ipcb
  2726.  mov esi,ipcc
  2727.  rep movsb
  2728.  
  2729.  ret
  2730.  
  2731. ipcok:
  2732.  cmp dword [ipcb+16],'~ccc'
  2733.  je ipccls
  2734.  cmp dword [ipcb+16],'~eee'
  2735.  je endipc
  2736.  cmp dword [ipcb+16],'~lll'
  2737.  je ipcline
  2738.  cmp dword [ipcb+16],'~ppp'
  2739.  je ipcprint
  2740.  cmp dword [ipcb+16],'~kkk'
  2741.  je ipckey
  2742.  
  2743.  jmp waitipc
  2744.  
  2745. reipc2:
  2746.  call draw
  2747.  call red
  2748.  
  2749. ipckey:
  2750.  mov eax,10
  2751.  int 0x40
  2752.  
  2753.  cmp eax,1
  2754.  je reipc2
  2755.  cmp eax,3
  2756.  je exit
  2757.  cmp eax,2
  2758.  je ipckeypressed
  2759.  
  2760.  jmp ipckey
  2761.  
  2762. ipckeypressed:
  2763.  mov eax,2
  2764.  int 0x40
  2765.  
  2766.  mov byte [ipckeyvalue],ah
  2767.  
  2768.  mov eax,60
  2769.  mov ebx,2
  2770.  mov ecx,dword [ipcpid]
  2771.  mov edx,ipckeyvalue
  2772.  mov esi,1
  2773.  int 0x40
  2774.  
  2775.  call clearipc
  2776.  jmp waitipc
  2777.  
  2778. ipccls:
  2779.  call cls2
  2780.  call clearipc
  2781.  jmp waitipc
  2782.  
  2783. ipcline:
  2784.  call newline
  2785.  call clearipc
  2786.  jmp waitipc
  2787.  
  2788. ipcprint:
  2789.  mov edx,ipcb+20
  2790.  call printipc
  2791.  call clearipc
  2792.  jmp waitipc
  2793.  
  2794. endipc:
  2795.  cmp byte [callp],1
  2796.  je go
  2797.  
  2798.  call clearsum
  2799.  
  2800.  jmp ecmd
  2801.  
  2802. cmdexist:
  2803.  mov eax,9
  2804.  mov ebx,tic_table
  2805.  mov ecx,-1
  2806.  int 0x40
  2807.  
  2808.  mov ecx,eax
  2809. loopex:
  2810.  push ecx
  2811.  
  2812.  mov eax,9
  2813.  mov ebx,I_END
  2814.  int 0x40
  2815.  
  2816.  cmp word [I_END+10],'CM'
  2817.  jne no_cmd
  2818.  cmp byte [I_END+12],'D'
  2819.  jne no_cmd
  2820.  
  2821.  inc byte [cmd_ex]
  2822.  
  2823.  cmp byte [cmd_ex],2
  2824.  je exit
  2825.  
  2826. no_cmd:
  2827.  pop ecx
  2828.  loop loopex
  2829.  
  2830.  ret
  2831.  
  2832. title:
  2833.  db 'CMD - Command line interpreter'
  2834. title_end:
  2835.  
  2836. smb_cursor db '|'
  2837.  
  2838. prompt db 'CMD>>'
  2839.  
  2840. h1  db '  CMD - Command line interpreter version 0.26 '
  2841. h2  db '        copyleft Chemist - dmitry_gt@tut.by   '
  2842. h3  db '  Available commands:                         '
  2843. h4  db '  HELP - Display this text  LS - List files   '
  2844. h5  db '  EXIT - Exit Programm      CP - Copy file    '
  2845. h6  db '  CLS  - Clear Screen       PS - Process info '
  2846. h7  db '  KILL - Kill Process       RN - Rename File  '
  2847. h8  db '        VER  - Display programm version       '
  2848. h9  db '        DEL  - Delete file from ramdisk       '
  2849. h10 db '        SHUTDOWN - Quit Menuet                '
  2850. h11 db '        PAUSE    - Wait for keypress          '
  2851. h12 db '        ECHO     - Print text to screen       '
  2852. h13 db '        ENDS     - End script                 '
  2853. h14 db '        /[filename] - Execute script          '
  2854. h15 db '        Use & symbol to enter params:         '
  2855. h16 db '        tinypad&cmd.asm - open cmd.asm        '
  2856.  
  2857. about db 'Command Line Interpreter version 0.26         '
  2858.  
  2859. err1 db 'Unknown command or filename'
  2860.  
  2861. proc_head db  ' PID Name      Start     Length   Proc_NUMB  '
  2862. proc_hd11 db  '-------------------------------------------- '
  2863.  
  2864. mess1 db 'Press any key to continue (ESC - Cancel)...   '
  2865. mess2 db 'Plz specify a 4 byte process number (not PID) '
  2866. mess3 db 'Process with number you specified has been    '
  2867. mess4 db 'terminated.                                   '
  2868. mess5 db 'Usage: del [filename]                         '
  2869. mess6 db 'Filename you specified has been deleted.      '
  2870. mess7 db 'No such file!                                 '
  2871. mess8 db 'No such process!                              '
  2872. mess9 db 'Usage: cp [source_file+destination_file]      '
  2873. mess0 db 'Usage: rn [source_file+destination_file]      '
  2874.  
  2875. mess11 db 'File successfully copied                      '
  2876. mess12 db 'ERROR: Can not copy file!                     '
  2877. mess13 db 'ERROR: Output file alredy exist!              '
  2878. mess14 db 'File successfully renamed                     '
  2879. mess15 db 'ERROR: Can not rename file!                   '
  2880. mess16 db 'You must specify a command script filename!   '
  2881. mess17 db 'This command is available only in scripts!    '
  2882.  
  2883.  
  2884. linen dd 2000
  2885. lpress dd 1
  2886. linel dd 0
  2887. linev dd 2000
  2888. stnum dd 1
  2889. rdstat dd 0
  2890.  
  2891. ypos   dd 6
  2892. xpos   dd 24
  2893. count  dd 0
  2894. clr    dd 0
  2895. smb    db 0
  2896. pn     dd 0
  2897. count2  dd 0
  2898. count3  dd 9
  2899. oldcount dd 0
  2900. oldcount1 dd 0
  2901.  
  2902. fnumb dd 0
  2903. n1 dd 0
  2904. n2 dd 0
  2905. n3 dd 0
  2906. n4 dd 0
  2907. n5 dd 0
  2908. n6 dd 0
  2909. n7 dd 0
  2910. n8 dd 0
  2911.  
  2912. ddot db '.'
  2913. dcmd db '.CMD',0
  2914.  
  2915. cnt_loop1 dd 0
  2916. cnt_loop2 dd 0
  2917.  
  2918. lscnt dd 8024
  2919. blockcnt dd 0
  2920. lscntf db 0
  2921. lscntx db 0
  2922.  
  2923. filesize dd 0
  2924. filesize2 dd 0
  2925.  
  2926. readcnt dd 15000
  2927. readcnt2 dd 0
  2928.  
  2929. callp db 0
  2930. callp2 db 0
  2931.  
  2932. fill1 db ' '
  2933. fill3 db '   ',0
  2934.  
  2935. pname      db '            ',0
  2936. autoexfile db 'AUTOEXEC.CMD',0
  2937. filename   db '            ',0
  2938.  
  2939. dzero db 0,0,0,0
  2940. qspace db '           '
  2941.  
  2942. f1len dd 0
  2943. f2len dd 0
  2944.  
  2945. ipcpid dd 0
  2946.  
  2947. ipckeyvalue db 0
  2948.  
  2949. ipccount dd 0
  2950.  
  2951. cmd_ex db 0
  2952.  
  2953. ipcb:
  2954.  db 0
  2955.  db 0,0,0
  2956.  dd 8
  2957. times 110 db 0
  2958.  
  2959. ipcc:
  2960.  db 0
  2961.  db 0,0,0
  2962.  dd 8
  2963. times 110 db 0
  2964.  
  2965. I_END:
  2966.  
  2967. tic_table: