forked from honeydatax/lisbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuniverse.c
6134 lines (5585 loc) · 151 KB
/
universe.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "universe.h"
void readll(char *argv1);
void msgbox();
void head();
int register_var(char *argv1 );
void tail();
void body(int c);
void pprint(int n);
void addcode(char *s1);
int findkey(char *s);
int echos();
void addtxtbody(char *s);
void addtxtbodynx(char *s);
void addtxtbodynb(int n);
int declair(char *s);
int iinteger(char *s);
int function(char *s);
int callfunction(char *s);
int locate();
int color();
int add();
int sub();
int consts();
int printnumber();
int pointers();
int pointersto();
int pointersfrom();
int ford();
int dowhile();
int dodo();
int like();
int diferent();
int big();
int less();
int inside();
int outside();
int rem();
int sstring();
int memory();
int fillmmem();
int copymem();
int printstring();
int sets();
int timerrnd();
int ands();
int inkeys();
int sleeps();
int divs();
int muls();
int getnumbers();
int doloops();
int lets();
int evals();
void evalsubs(int d0,int d1,int d2);
void evalsums(int d0,int d1,int d2);
void evalmuls(int d0,int d1,int d2);
void evaldivs(int d0,int d1,int d2);
void evalclears(int p1,int size);
int evalssplint(char *destiny,char *list[],char separete);
int PrintList(int sizes);
void priorityString(int sizes);
void priorityList(int sizes);
int strchr1(char *argv);
int evalgetnumbers(char *s1);
int getvar(char *s1);
void priorityList(int sizes);
int lists(char *argv);
int solver(char *argv);
void params(char *argv);
void emain(char *argv);
int ddouble(char *s);
int returneval;
int ffloat(char *s);
int printfloat();
int tinteger();
int tfloat();
int tdouble();
int printdouble();
int ttinteger();
int ttfloat();
int lllong(char *s);
int printhex();
int longadd();
int longsub();
int longmul();
int windowstextes();
int windowstextesprints();
int windowstextesclear();
int longdiv();
//=================================================================
//MAIN
int main(int argc, char *argv[]){
msgbox();
char *ccc;
char *dd;
int count=0;
int i;
int ae1=0;
char *s1;
char *s2;
s1=s;
f1=fopen("universe.dat","w");
f2=fopen("universe1.dat","w");
f4=fopen("universe2.dat","w");
head();
fprintf(f4,"\nmain:\n");
f3=f2;
page=0;
lineno=0;
eerror=0;
mainsub=0;
do{
if (!feof(stdin)){
lineno++;
fgets(c,800,stdin);
dd=strstr(c,"\n");
if (dd!=NULL) dd[0]=0;
ae1=1;
fprintf(f4,";%s\n",c);
fprintf(f4,"call ringa%d\n",ringa);
do{
dd=strstr(c,"#");
if (dd!=NULL) {
ccc=dd + 1;
ae1=1;
dd[0]=0;
}else{
ae1=0;
}
if (c[0]!=0){
fprintf(f2,";%s\n",c);
readll(c);
}else{
ae1=0;
}
if(ae1!=0)c=ccc;
}while(ae1!=0);
}
fprintf(f2,"ringa%d:\nret\n",ringa);
ringa++;
c[0]=0;
}while(!feof(stdin));
tail();
fclose(f1);
fclose(f2);
fclose(f4);
if (eerror==1) {
printf("fail to compile error\n");
}else{
eerror=0;
system("nasm -o out.com universe.dat 2> universexx.dat");
f1=fopen("universexx.dat","r");
do{
if (!feof(f1)){
lineno++;
fgets(c,800,f1);
dd=strstr(c,"sub");
if (dd!=NULL){
dd=dd+3;
i=atoi(dd);
printf("function declare not exists you are call a function not creat \"%s\"\n", subs[i]);
eerror=1;
c[0]=0;
}
printf("%s\n",c);
}
c[0]=0;
}while(!feof(stdin));
fclose(f1);
if(eerror==0) printf("\ndone...\nopen file universe.dat and universe1.dat and universe2.dat to see codes\n");
}
return 0;
}
//=================================================================
//READLL
void readll(char *argv1){
char *s1;
char *s2;
int r;
count=0;
r=0;
ss[count]=argv1;
count++;
s1=argv1;
do{
ss[count]=strstr(s1,",");
if (ss[count]==NULL)r=1;
if (ss[count]!=NULL){
s2=ss[count];
s1=s2+1;
s2[0]=0;
ss[count]=s1;
count++;
}
}while(r==0);
s1=uppercase(ss[0]);
ss[0]=s1;
n=findkey(ss[0]);
error=1;
if (n==0) printstring();
if (n==1) sets();
if (n==2) error=0;
if (n==3) echos();
if (n==5) iinteger(ss[1]);
if (n==6) lets();
if (n==7) add();
if (n==8) sub();
if (n==13) like();
if (n==14) diferent();
if (n==15) big();
if (n==16) less();
if (n==19) fillmmem();
if (n==20) copymem();
if (n==21) sstring();
if (n==29) ford();
if (n==31) pointers();
if (n==35) getnumbers();
if (n==36) printnumber();
if (n==39) muls();
if (n==40) divs();
if (n==50) sleeps();
if (n==51) timerrnd();
if (n==55) ands();
if (n==66 || n==17) rem();
if (n==68) inkeys();
if (n==69) consts();
if (n==70) locate();
if (n==74) ffloat(ss[1]);
if (n==82) memory();
if (n==84) color();
if (n==93) declair(ss[1]);
if (n==94) function(ss[1]);
if (n==95) pointersto();
if (n==96) pointersfrom();
if (n==97) dowhile();
if (n==98) dodo();
if (n==99) inside();
if (n==100) outside();
if (n==101) doloops();
if (n==102) evals();
if (n==103) printfloat();
if (n==104) tinteger();
if (n==105) tfloat();
if (n==106) ddouble(ss[1]);
if (n==107) tdouble();
if (n==108) printdouble();
if (n==109) ttinteger();
if (n==110) ttfloat();
if (n==111) lllong(ss[1]);
if (n==112) printhex();
if (n==113) longadd();
if (n==114) longsub();
if (n==115) longmul();
if (n==116) windowstextes();
if (n==117) windowstextesprints();
if (n==118) windowstextesclear();
if (n==119) longdiv();
if (n>=substart) callfunction(ss[0]);
readll2(n);
//printf("**%d\n",n);
if (error==1){
printf("line error:%d\n",lineno);
eerror=1;
}
}
//=================================================================
//register_var
int register_var(char *argv1 ){
int i=ccount;
int nn=strlen(argv1);
nn=nn & 255;
fprintf (f1,"var%d db %d,\"%s\",13,10,0 \n",ccount,nn,argv1);
ccount++;
return i;
}
//=================================================================
//pprint
void pprint(int n){
body(n);
page++;
if (page>19){
page=0;
//fprintf(f2,"\ncall key\n",c);
}
}
//=================================================================
//body
void body(int c){
fprintf(f2,"ringa%d:\n",ringa);
fprintf(f2,"\nmov dx,var%d\ncall echos\n",c);
ringa++;
fprintf(f2," call ringa%d\nret\n",ringa);
}
//=================================================================
//tail
void tail(){
fprintf(f4,"\nret\n");
fprintf(f4,"\nret\n");
fprintf(f1,"endf db 0\n");
}
//=================================================================
//msgbox()
void msgbox(){
printf ("\e[0;37;44m");
}
//=================================================================
//head()
void head(){
//by line sky lib gnu (c)
addcode ("section .text");
addcode ("org 0x100");
addcode ("main1:");
addcode ("jmp start");
addcode ("db 'build in universe32 developer tools.... '");
addcode ("%include \"universe1.dat\"");
addcode ("%include \"universe2.dat\"");
addcode ("mains:");
addcode ("call main");
addcode ("");
addcode (";body start");
addcode ("");
addcode (";end of body");
addcode ("exit:");
addcode (" mov si,rreservemem");
addcode (" mov eax,[si]");
addcode (" mov ax,0");
addcode (" mov ds,ax");
addcode (" mov ebx,180004h");
addcode (" mov [ebx],eax");
addcode (" mov ax,cs");
addcode (" mov ds,ax");
addcode (" mov ax,0ffffh");
addcode (" mov sp,ax");
addcode (" mov ax,cs");
addcode (" mov ss,ax");
addcode (" xor ax,ax");
addcode (" push ax");
addcode (" xor ax,ax");
addcode (" int 0x21");
addcode (" ret");
addcode ("ret");
addcode ("len32:");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" push ds ");
addcode (" mov bp,0 ");
addcode (" mov ds,bp");
addcode (" mov ecx,0");
addcode ("len321:");
addcode (" ds");
addcode (" mov al,[esi]");
addcode (" cmp al,0");
addcode (" jz len323");
addcode (" inc esi");
addcode (" inc ecx");
addcode (" jmp len321");
addcode ("len323:");
addcode (" mov eax,ecx");
addcode (" pop ds ");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" ret");
addcode ("ret");
addcode ("strcat:");
addcode (" mov ax,0");
addcode (" mov ds,ax");
addcode (" mov ah,0");
addcode ("strcat2:");
addcode (" mov al,[edi]");
addcode (" cmp al,ah");
addcode (" jz strcat3");
addcode (" inc edi");
addcode (" jmp strcat2");
addcode ("strcat3:");
addcode (" mov al,[esi]");
addcode (" mov [edi],al");
addcode (" cmp al,ah");
addcode (" jz strcat4");
addcode (" inc esi");
addcode (" inc edi");
addcode (" jmp strcat3");
addcode ("strcat4:");
addcode (" mov ax,cs");
addcode (" mov ds,ax");
addcode (" ret");
addcode ("COPYMEM32:");
addcode (" push eax ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" push ds ");
addcode (" mov bp,0 ");
addcode (" mov ds,bp");
addcode (" cmp edx,0");
addcode (" JZ COPYMEM326");
addcode (" COPYMEM3211:");
addcode (" cmp ecx,0");
addcode (" JZ COPYMEM326");
addcode (" COPYMEM321:");
addcode (" ds");
addcode (" mov al,[esi]");
addcode (" ds");
addcode (" mov [edi],al");
addcode (" clc ");
addcode (" add edi,edx");
addcode (" inc esi ");
addcode (" dec ecx ");
addcode (" jnz COPYMEM321");
addcode (" COPYMEM326:");
addcode (" pop ds ");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" pop eax ");
addcode (" RET ");
addcode ("MEM32: ");
addcode (" push esi ");
addcode (" and eax,0ffffh");
addcode (" clc ");
addcode (" shl eax,4");
addcode (" and esi,0ffffh");
addcode (" clc ");
addcode (" add eax,esi");
addcode (" pop esi ");
addcode (" RET ");
addcode ("MOVEMEM32:");
addcode (" push eax ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" push ds ");
addcode (" mov bp,0 ");
addcode (" mov ds,bp");
addcode (" MOVEMEM3211:");
addcode (" cmp ecx,0");
addcode (" JZ MOVEMEM326");
addcode (" MOVEMEM321:");
addcode (" ds");
addcode (" mov al,[esi]");
addcode (" ds");
addcode (" mov [edi],al");
addcode (" dec edi");
addcode (" dec esi ");
addcode (" dec ecx ");
addcode (" jnz MOVEMEM321");
addcode (" MOVEMEM326:");
addcode (" pop ds ");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" pop eax ");
addcode (" RET ");
addcode ("GOTOXY: ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" mov si,ax");
addcode (" mov di,bx");
addcode (" and si,0fffh");
addcode (" and di,0fffh");
addcode (" xor cx,cx");
addcode (" xor dx,dx");
addcode (" mov ax,si");
addcode (" mov bx,2 ");
addcode (" clc ");
addcode (" mul bx ");
addcode (" mov si,ax");
addcode (" mov ax,di");
addcode (" mov bx,160");
addcode (" clc ");
addcode (" mul bx ");
addcode (" mov bx,si");
addcode (" clc ");
addcode (" add ax,bx");
addcode (" and eax,0ffffh");
addcode (" mov ebx,0b8000h");
addcode (" clc ");
addcode (" add eax,ebx");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" RET ");
addcode ("PRINT32: ");
addcode (" push eax ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" cmp ecx,0");
addcode (" JZ PRINT3213");
addcode (" push esi ");
addcode (" mov si,x ");
addcode (" cs ");
addcode (" mov al,[si] ");
addcode (" cs ");
addcode (" mov bl,[si+1] ");
addcode (" pop esi ");
addcode (" and ax,0ffh");
addcode (" and bx,0ffh");
addcode (" call GOTOXY");
addcode (" mov edi,eax");
addcode (" cmp ecx,255");
addcode (" JB PRINT3212");
addcode (" mov ebx,255");
addcode (" PRINT3212:");
addcode (" mov edx,2");
addcode (" call COPYMEM32");
addcode (" push esi ");
addcode (" mov si,x ");
addcode (" cs ");
addcode (" mov al,[si] ");
addcode (" cs ");
addcode (" mov bl,[si+1] ");
addcode (" pop esi ");
addcode (" and ax,0ffh");
addcode (" and bx,0ffh");
addcode (" mov si,bx");
addcode (" clc ");
addcode (" ");
addcode (" add ax,cx");
addcode (" cmp ax,80");
addcode (" JB PRINT328");
addcode (" mov bx,80");
addcode (" sub ax,bx");
addcode (" xor dx,dx");
addcode (" xor cx,cx");
addcode (" mov bx,80");
addcode (" clc ");
addcode (" div bx ");
addcode (" clc ");
addcode (" add ax,si");
addcode (" cmp ax,24");
addcode (" JB PRINT328");
addcode (" mov ax,24");
addcode (" PRINT328:");
addcode (" push esi ");
addcode (" mov si,x ");
addcode (" cs ");
addcode (" mov al,[si+1] ");
addcode (" inc al ");
addcode (" cs ");
addcode (" mov [si+1],al ");
addcode (" mov al,0 ");
addcode (" cs ");
addcode (" mov [si],al ");
addcode (" pop esi ");
addcode (" PRINT3213:");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" pop eax ");
addcode (" RET ");
addcode ("timer:");
addcode (" push ebx");
addcode (" push ds");
addcode (" mov ax,0x40");
addcode (" mov ds,ax");
addcode (" mov bx,0x6c");
addcode (" mov eax,[bx]");
addcode (" pop ds");
addcode (" pop ebx");
addcode ("ret");
addcode ("sleep:");
addcode (" mov ecx,eax");
addcode (" xor eax,eax");
addcode (" cmp eax,ecx");
addcode (" jz sleep6");
addcode (" call timer");
addcode (" clc");
addcode (" add ecx,eax");
addcode (" jo sleep8");
addcode (" call timer");
addcode (" cmp eax,ecx");
addcode (" jz sleep6");
addcode (" sleep1:");
addcode (" call timer");
addcode (" cmp eax,ecx");
addcode (" jz sleep6");
addcode (" jb sleep1");
addcode (" jmp sleep6");
addcode (" sleep8:");
addcode (" sleep5:");
addcode (" call timer");
addcode (" cmp eax,ecx");
addcode (" jz sleep6");
addcode (" ja sleep5");
addcode (" jmp sleep1");
addcode ("sleep6:");
addcode ("ret");
addcode ("inkey:");
addcode (" mov ah,0x1");
addcode (" int 0x16");
addcode (" jnz waits");
addcode ("nwaits:");
addcode (" xor ax,ax");
addcode (" ret");
addcode ("waits:");
addcode (" xor ax,ax");
addcode (" int 0x16");
addcode (" xor cl,cl");
addcode (" mov ah,cl");
addcode (" ret");
addcode ("echo:");
addcode (" push ax");
addcode (" push bx");
addcode (" push cx");
addcode (" push dx");
addcode (" push di");
addcode (" push si");
addcode (" push bp");
addcode (" push es");
addcode (" mov ax,cs");
addcode (" mov es,ax");
addcode (" xchg si,bp");
addcode (" mov bx,bp");
addcode (" cs");
addcode (" mov cl,[bx]");
addcode (" inc bp");
addcode (" and cx,0ffh");
addcode (" mov bx,x");
addcode (" cs");
addcode (" mov dx,[bx]");
addcode (" mov bx,color");
addcode (" cs");
addcode (" mov al,[bx]");
addcode (" mov bl,al");
addcode (" mov bh,0");
addcode (" mov al,0");
addcode (" mov ah,13h");
addcode (" int 10h");
addcode (" pop es");
addcode (" pop bp");
addcode (" pop si");
addcode (" pop di");
addcode (" pop dx");
addcode (" pop cx");
addcode (" pop bx");
addcode (" pop ax");
addcode (" RET");
addcode ("val:");
addcode (" mov ax,0");
addcode (" mov ds,ax");
addcode (" mov ecx,0");
addcode (" mov edx,0");
addcode (" mov ebx,1");
addcode (" mov eax,0");
addcode ("val2:");
addcode (" mov al,[esi]");
addcode (" cmp al,48");
addcode (" jb val3");
addcode (" cmp al,57");
addcode (" ja val3");
addcode (" jmp val4");
addcode ("val3:");
addcode (" cmp cl,0");
addcode (" jz val40");
addcode (" jmp val5");
addcode ("val4:");
addcode (" cmp cl,9");
addcode (" jz val55");
addcode (" inc cl");
addcode (" inc esi");
addcode (" jmp val2");
addcode ("val55:");
addcode (" dec cl");
addcode ("val5:");
addcode (" dec esi");
addcode ("val6:");
addcode (" push ecx");
addcode (" push edx");
addcode (" xor eax,eax");
addcode (" mov al,[esi]");
addcode (" clc");
addcode (" sub al,48");
addcode (" xor ecx,ecx");
addcode (" xor edx,edx");
addcode (" push ebx");
addcode (" imul ebx");
addcode (" xor ecx,ecx");
addcode (" xor edx,edx");
addcode (" pop ebx");
addcode (" push eax");
addcode (" mov eax,10");
addcode (" imul ebx");
addcode (" mov ebx,eax");
addcode (" pop eax");
addcode (" pop edx");
addcode (" pop ecx");
addcode (" clc");
addcode (" add edx,eax");
addcode (" dec esi");
addcode (" dec cl");
addcode (" cmp cl,0");
addcode (" jz val40");
addcode (" jmp val6");
addcode ("val40:");
addcode (" mov eax,edx");
addcode (" mov bp,cs");
addcode (" mov ds,bp");
addcode (" mov [di],eax");
addcode ("ret");
addcode ("STR32: ");
addcode (" push eax ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push edi ");
addcode (" push esi ");
addcode (" push ebp ");
addcode (" push ds ");
addcode (" mov eax,[si]");
addcode (" mov ebp,0");
addcode (" mov ds,bp ");
addcode (" mov ebp,1000000000");
addcode (" STR321: ");
addcode (" xor edx,edx");
addcode (" xor ecx,ecx");
addcode (" mov ebx,ebp");
addcode (" clc ");
addcode (" div ebx ");
addcode (" mov esi,edx");
addcode (" mov ah,'0'");
addcode (" clc ");
addcode (" add al,ah");
addcode (" mov [edi],al");
addcode (" inc edi ");
addcode (" mov eax,ebp");
addcode (" xor edx,edx");
addcode (" xor ecx,ecx");
addcode (" mov ebx,10");
addcode (" clc ");
addcode (" div ebx ");
addcode (" mov ebp,eax");
addcode (" mov eax,esi");
addcode (" cmp ebp,0");
addcode (" JNZ STR321");
addcode (" ");
addcode (" pop ds ");
addcode (" pop ebp ");
addcode (" pop esi ");
addcode (" pop edi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" pop eax ");
addcode (" RET ");
addcode ("start:");
addcode (" ;start stack 64k");
addcode (" mov ax,cs");
addcode (" mov cx,0x1000");
addcode (" add ax,cx");
addcode (" mov ss,ax");
addcode (" mov ax,0xffff");
addcode (" mov sp,ax");
addcode (" xor ax,ax");
addcode (" push ax");
addcode (" ;end stack 64k");
addcode (" ;start alocate");
addcode (" mov bx,L18");
addcode (" mov ax,endf");
addcode (" mov cx,8");
addcode (" add ax,cx");
addcode (" mov [bx],ax");
addcode (" ;end alocate");
addcode (" ;start randomize");
addcode (" call timer");
addcode (" mov bx,L20");
addcode (" xor cx,cx");
addcode (" mov cl,al");
addcode (" mov ax,257");
addcode (" add ax,cx");
addcode (" mov [bx],ax");
addcode (" ;end randomize");
addcode (" xor ax,ax");
addcode (" mov ds,ax");
addcode (" mov edx,1234567890");
addcode (" mov ebx,180000h");
addcode (" mov eax,[ebx]");
addcode (" cmp eax,edx");
addcode (" jz reservemem");
addcode (" mov eax,4");
addcode (" clc");
addcode (" add ebx,eax");
addcode (" mov eax,100h");
addcode (" clc");
addcode (" add eax,ebx");
addcode (" mov [ebx],eax");
addcode (" mov eax,1234567890");
addcode (" mov ebx,180000h");
addcode (" mov [ebx],eax");
addcode ("reservemem:");
addcode (" mov ebx,180004h");
addcode (" mov eax,[ebx]");
addcode (" mov si,rreservemem");
addcode (" cs");
addcode (" mov [si],eax");
addcode (" mov ax,cs");
addcode (" mov ds,ax");
addcode ("");
addcode ("jmp mains");
addcode ("RESERVES:");
addcode (" push ebx");
addcode (" push ecx");
addcode (" push edx");
addcode (" push edi");
addcode (" push esi");
addcode (" push ebp");
addcode (" push ds ");
addcode (" push es ");
addcode (" JMP RESERVES2");
addcode (" RESERVES2:");
addcode (" xor ax,ax");
addcode (" mov ds,ax");
addcode (" mov ebx,180004h");
addcode (" mov eax,[ebx]");
addcode ("");
addcode (" mov edx,eax");
addcode (" clc ");
addcode (" add edx,ecx");
addcode (" add edx,4");
addcode (" mov [ebx],edx");
addcode (" mov ebx,eax");
addcode (" mov esi,eax");
addcode (" mov [ebx],ecx");
addcode (" mov eax,esi");
addcode (" clc");
addcode (" add eax,4");
addcode (" clc");
addcode (" add eax,ecx");
addcode (" dec eax");
addcode (" mov ebx,eax");
addcode (" mov al,0");
addcode (" mov [ebx],al");
addcode (" mov eax,esi");
addcode (" clc");
addcode (" add eax,4");
addcode (" pop es");
addcode (" pop ds");
addcode (" pop ebp");
addcode (" pop esi");
addcode (" pop edi");
addcode (" pop edx");
addcode (" pop ecx");
addcode (" pop ebx");
addcode (" ");
addcode (" RET ");
addcode ("FILL32: ");
addcode (" push eax ");
addcode (" push ebx ");
addcode (" push ecx ");
addcode (" push edx ");
addcode (" push esi ");
addcode (" push edi ");
addcode (" push ebp ");
addcode (" push ds ");
addcode (" mov bp,0 ");
addcode (" mov ds,bp");
addcode (" cmp edx,0");
addcode (" JNZ FILL3211");
addcode (" inc edx ");
addcode (" FILL3211:");
addcode (" FILL321: ");
addcode (" mov [edi],al");
addcode (" clc ");
addcode (" add edi,edx");
addcode (" dec ecx ");
addcode (" JNZ FILL321");
addcode (" pop ds ");
addcode (" pop ebp ");
addcode (" pop edi ");
addcode (" pop esi ");
addcode (" pop edx ");
addcode (" pop ecx ");
addcode (" pop ebx ");
addcode (" pop eax ");
addcode (" RET ");
addcode ("scr:");
addcode (" mov ebx,255");
addcode (" cmp eax,ebx");
addcode (" ja scr1");
addcode (" mov ah,0");
addcode (" int 10h");
addcode (" ret");
addcode ("scr1:");
addcode (" mov bx,ax");
addcode (" mov ax,4f02h");
addcode (" int 10h");
addcode (" ret");
addcode ("setvideo:");
addcode (" push ds");
addcode (" push es");
addcode (" mov dx,0");
addcode (" mov esi,140000h");
addcode (" mov ds,dx");
addcode (" mov es,dx");
addcode ("setvideo2:");
addcode (" mov ax,4f05h");
addcode (" mov bx,0");
addcode (" int 10h");
addcode (" inc dx");
addcode ("setvideo3:");
addcode (" mov edi,0a0000h");
addcode (" mov ecx,4000h");
addcode (" call memcopyd");
addcode (" cmp dx,4");
addcode (" jb setvideo2");
addcode (" pop es");
addcode (" pop ds");
addcode (" ret");
addcode ("hline32:");
addcode (" mov si,hlinex");
addcode (" mov ax,[si]");
addcode (" mov bx,640");
addcode (" cmp ax,bx");
addcode (" jb hline32xxl");
addcode (" dec bx");
addcode (" mov [si],bx");
addcode ("hline32xxl:");
addcode (" mov bx,-1");
addcode (" cmp ax,bx");
addcode (" jg hline32xxh");
addcode (" inc bx");
addcode (" mov [si],bx");
addcode ("hline32xxh:");
addcode (" mov si,hliney");
addcode (" mov ax,[si]");
addcode (" mov bx,400");
addcode (" cmp ax,bx");
addcode (" jb hline32yyl");
addcode (" dec bx");
addcode (" mov [si],bx");
addcode ("hline32yyl:");
addcode (" mov bx,-1");
addcode (" cmp ax,bx");
addcode (" jg hline32yyh");
addcode (" inc bx");
addcode (" mov [si],bx");
addcode ("hline32yyh:");
addcode (" mov si,hlinex1");
addcode (" mov ax,[si]");
addcode (" mov bx,640");
addcode (" cmp ax,bx");
addcode (" jb hline32xxxl");
addcode (" dec bx");