Subversion Repositories Kolibri OS

Rev

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

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