-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCAD.ASM
More file actions
11011 lines (11011 loc) · 189 KB
/
CAD.ASM
File metadata and controls
11011 lines (11011 loc) · 189 KB
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
ifndef ??version
?debug macro
endm
$comm macro name,dist,size,count
comm dist name:BYTE:count*size
endm
else
$comm macro name,dist,size,count
comm dist name[size]:BYTE:count
endm
endif
?debug S "cad.c"
?debug C E9798C973A056361642E63
?debug C E9438C973A054341442E68
?debug C E920105C1613433A5C54435C494E434C5544455C646F732E68
?debug C E920105C1615433A5C54435C494E434C5544455C737464696F2E68
?debug C E920105C1616433A5C54435C494E434C5544455C7374646C69622E+
?debug C 68
?debug C E920105C1615433A5C54435C494E434C5544455C636F6E696F2E68
?debug C E92B58943A087478776E64312E68
?debug C E920105C1613433A5C54435C494E434C5544455C646F732E68
?debug C E920105C1615433A5C54435C494E434C5544455C737464696F2E68
?debug C E920105C1616433A5C54435C494E434C5544455C7374646C69622E+
?debug C 68
?debug C E920105C1615433A5C54435C494E434C5544455C636F6E696F2E68
CAD_TEXT segment byte public 'CODE'
CAD_TEXT ends
assume cs:CAD_TEXT,ds:CAD_DATA
CAD_DATA segment word public 'DATA'
d@ label byte
d@w label word
b@ label byte
b@w label word
CAD_DATA ends
CAD_TEXT segment byte public 'CODE'
;
; void cad_()
;
assume cs:CAD_TEXT
_cad_ proc far
push bp
mov bp,sp
sub sp,10638
push si
push di
push ds
mov ax,CAD_DATA
mov ds,ax
;
; {
; FILE *inStream;
;
; int iLauf, jLauf, x_pos, y_pos, x_cpos, y_cpos, disp, tx_disp, tx_disp2, tx_disp21, f1, fix, lng, lng2, txlng, schub;
;
; int index = 1, index1 = 1, zeile[300];
;
mov word ptr [bp-34],1
mov word ptr [bp-36],1
;
; char taste, text[100][100] ;
;
; _setcursortype(_NOCURSOR);//-------------------------------------------> unterdr�ckt cursoranzeige
;
xor ax,ax
push ax
call far ptr __setcursortype
inc sp
inc sp
;
;
; disp = 0; tx_disp = 6;tx_disp2= 8;//-------------------------------------> farbvoreinstellungen
;
mov word ptr [bp-14],0
mov word ptr [bp-16],6
mov word ptr [bp-18],8
;
; x_pos=6, y_pos=14 ;//---------------------------------------------------> fensterposition
;
mov word ptr [bp-6],6
mov word ptr [bp-8],14
;
; x_cpos=10, y_cpos=20 ;//-----------------------------------------------> cursorposition
;
mov word ptr [bp-10],10
mov word ptr [bp-12],20
;
;
; fix= -1;
;
mov word ptr [bp-24],65535
;
;
; f1= 2 +1;
;
mov word ptr [bp-22],3
;
; lng=46;
;
mov word ptr [bp-26],46
;
; lng2=7;
;
mov word ptr [bp-28],7
;
; schub=0;
;
mov word ptr [bp-32],0
;
;
; inStream = fopen( "txwnd.txt", "r" );
;
push ds
mov ax,offset s@+10
push ax
push ds
mov ax,offset s@
push ax
call far ptr _fopen
add sp,8
mov word ptr [bp-4],ax
mov word ptr [bp-2],dx
;
;
; for(iLauf=1;iLauf<300;iLauf++) zeile[iLauf]=0;
;
mov si,1
jmp short @1@98
@1@50:
mov bx,si
shl bx,1
lea ax,word ptr [bp-638]
add bx,ax
mov word ptr ss:[bx],0
inc si
@1@98:
cmp si,300
jl short @1@50
@1@122:
;
;
; do
; {
; while(1)
; {
; text[index1][index] = fgetc(inStream);
;
push word ptr [bp-2]
push word ptr [bp-4]
call far ptr _fgetc
add sp,4
push ax
mov ax,word ptr [bp-36]
mov dx,100
imul dx
add ax,word ptr [bp-34]
lea dx,word ptr [bp-10638]
add ax,dx
mov bx,ax
pop ax
mov byte ptr ss:[bx],al
;
; if (text[index1][index] == '\n') break;
;
mov ax,word ptr [bp-36]
mov dx,100
imul dx
add ax,word ptr [bp-34]
lea dx,word ptr [bp-10638]
add ax,dx
mov bx,ax
cmp byte ptr ss:[bx],10
jne short @1@170
jmp short @1@242
@1@170:
;
; index++;zeile[index1]++;
;
inc word ptr [bp-34]
mov bx,word ptr [bp-36]
shl bx,1
lea ax,word ptr [bp-638]
add bx,ax
inc word ptr ss:[bx]
;
; if (feof (inStream) != 0) break;
;
les bx,dword ptr [bp-4]
test word ptr es:[bx+2],32
je short @1@218
jmp short @1@242
@1@218:
jmp short @1@122
@1@242:
;
; }
; index1++;index=1;txlng=index1;
;
inc word ptr [bp-36]
mov word ptr [bp-34],1
mov ax,word ptr [bp-36]
mov word ptr [bp-30],ax
;
;
; }while (feof (inStream) == 0);
;
les bx,dword ptr [bp-4]
test word ptr es:[bx+2],32
je short @1@122
;
;
;
; fclose( inStream );
;
push word ptr [bp-2]
push word ptr [bp-4]
call far ptr _fclose
add sp,4
@1@314:
;
;
;
;
; while(1)//--------------------------------------------------------------| hauptschleife
; {
; textbackground(disp);
;
push word ptr [bp-14]
call far ptr _textbackground
inc sp
inc sp
;
; clrscr();
;
call far ptr _clrscr
;
; //cprintf("x:%i y:%i tx_disp:%i",x_cpos, y_cpos-1, tx_disp);
;
;
; //----------------------------------------------------------------------------> fenster
;
; if(fix==1)if((x_cpos == x_pos+1) && (y_cpos == y_pos+f1)){tx_disp21=7;}else{tx_disp21=8;}
;
cmp word ptr [bp-24],1
jne short @1@434
mov ax,word ptr [bp-6]
inc ax
cmp ax,word ptr [bp-10]
jne short @1@410
mov ax,word ptr [bp-8]
add ax,word ptr [bp-22]
cmp ax,word ptr [bp-12]
jne short @1@410
mov word ptr [bp-20],7
jmp short @1@434
@1@410:
mov word ptr [bp-20],8
@1@434:
;
; if(fix == -1)tx_disp21=tx_disp2;
;
cmp word ptr [bp-24],65535
jne short @1@482
mov ax,word ptr [bp-18]
mov word ptr [bp-20],ax
@1@482:
;
;
; textcolor(tx_disp21);
;
push word ptr [bp-20]
call far ptr _textcolor
inc sp
inc sp
;
;
; if(y_pos - lng2 >0)
;
mov ax,word ptr [bp-8]
sub ax,word ptr [bp-28]
jle short @1@626
;
; {
; gotoxy(x_pos-1, y_pos - lng2);cprintf("\xDA");
;
mov ax,word ptr [bp-8]
sub ax,word ptr [bp-28]
push ax
mov ax,word ptr [bp-6]
dec ax
push ax
call far ptr _gotoxy
add sp,4
push ds
mov ax,offset s@+12
push ax
call far ptr _cprintf
add sp,4
;
; for(iLauf=1;iLauf<=lng-2;iLauf++)cprintf("\xC4");
;
mov si,1
jmp short @1@578
@1@530:
push ds
mov ax,offset s@+14
push ax
call far ptr _cprintf
add sp,4
inc si
@1@578:
mov ax,word ptr [bp-26]
add ax,65534
cmp ax,si
jge short @1@530
;
; cprintf("\xC2");
;
push ds
mov ax,offset s@+16
push ax
call far ptr _cprintf
add sp,4
@1@626:
;
;
; }
; textcolor(tx_disp);
;
push word ptr [bp-16]
call far ptr _textcolor
inc sp
inc sp
;
; for(iLauf=1;iLauf<= lng2-1 ;iLauf++)
;
mov si,1
jmp short @1@794
@1@650:
;
; {
; if(y_pos+1-iLauf >0)
;
mov ax,word ptr [bp-8]
inc ax
sub ax,si
jle short @1@770
;
; for(jLauf=1;jLauf<= lng-4 ;jLauf+=1)
;
mov di,1
jmp short @1@746
@1@698:
;
; {
; gotoxy( x_pos+jLauf , (y_pos+1)-iLauf ); cprintf("%c", text[ ((txlng-3)-iLauf)+schub ][jLauf]);
;
mov ax,word ptr [bp-8]
inc ax
sub ax,si
push ax
mov ax,word ptr [bp-6]
add ax,di
push ax
call far ptr _gotoxy
add sp,4
mov ax,word ptr [bp-30]
add ax,65533
sub ax,si
add ax,word ptr [bp-32]
mov dx,100
imul dx
add ax,di
lea dx,word ptr [bp-10638]
add ax,dx
mov bx,ax
mov al,byte ptr ss:[bx]
cbw
push ax
push ds
mov ax,offset s@+18
push ax
call far ptr _cprintf
add sp,6
inc di
@1@746:
mov ax,word ptr [bp-26]
add ax,65532
cmp ax,di
jge short @1@698
@1@770:
inc si
@1@794:
mov ax,word ptr [bp-28]
dec ax
cmp ax,si
jge short @1@650
;
; }
; }
;
; textcolor(tx_disp21);
;
push word ptr [bp-20]
call far ptr _textcolor
inc sp
inc sp
;
; if(y_pos+2 >0)
;
mov ax,word ptr [bp-8]
inc ax
inc ax
jle short @1@962
;
; {
; gotoxy(x_pos-1, y_pos+2); cprintf("\xC0\xC4o");
;
mov ax,word ptr [bp-8]
inc ax
inc ax
push ax
mov ax,word ptr [bp-6]
dec ax
push ax
call far ptr _gotoxy
add sp,4
push ds
mov ax,offset s@+21
push ax
call far ptr _cprintf
add sp,4
;
; for(iLauf=1;iLauf<=lng-4;iLauf++)cprintf("\xC4");
;
mov si,1
jmp short @1@914
@1@866:
push ds
mov ax,offset s@+25
push ax
call far ptr _cprintf
add sp,4
inc si
@1@914:
mov ax,word ptr [bp-26]
add ax,65532
cmp ax,si
jge short @1@866
;
; cprintf("\xD9");
;
push ds
mov ax,offset s@+27
push ax
call far ptr _cprintf
add sp,4
@1@962:
;
;
; }
;
;
; //------------------------------------------------------------------------------> cursor
; textcolor(tx_disp);
;
push word ptr [bp-16]
call far ptr _textcolor
inc sp
inc sp
;
; gotoxy(x_cpos, y_cpos-1);cprintf(".");
;
mov ax,word ptr [bp-12]
dec ax
push ax
push word ptr [bp-10]
call far ptr _gotoxy
add sp,4
push ds
mov ax,offset s@+29
push ax
call far ptr _cprintf
add sp,4
;
; gotoxy(x_cpos, y_cpos);cprintf("\x1E");
;
push word ptr [bp-12]
push word ptr [bp-10]
call far ptr _gotoxy
add sp,4
push ds
mov ax,offset s@+31
push ax
call far ptr _cprintf
add sp,4
;
;
; if(fix==1){gotoxy(x_cpos, y_cpos+1);cprintf("\xEE");}//-------------------------> fixierungsschaltersymbol
;
cmp word ptr [bp-24],1
jne short @1@1010
mov ax,word ptr [bp-12]
inc ax
push ax
push word ptr [bp-10]
call far ptr _gotoxy
add sp,4
push ds
mov ax,offset s@+33
push ax
call far ptr _cprintf
add sp,4
@1@1010:
;
;
;
; //---------------------------------------------------------------> zuordnung der aktivierten taste
;
; taste=getch();
;
call far ptr _getch
mov byte ptr [bp-37],al
;
;
; //-----------------------------------------------------------------> ereignisse
;
; if(taste == 'v') {tx_disp--;if(tx_disp<0)tx_disp = 15;}//--------------------> v_taste �ndert fensterfarbe
;
cmp byte ptr [bp-37],118
jne short @1@1082
dec word ptr [bp-16]
cmp word ptr [bp-16],0
jge short @1@1082
mov word ptr [bp-16],15
@1@1082:
;
; if(taste == 'c') {tx_disp2--;if(tx_disp2<7)tx_disp2 = 8;}//-------------------> c_taste �ndert text
;
cmp byte ptr [bp-37],99
jne short @1@1154
dec word ptr [bp-18]
cmp word ptr [bp-18],7
jge short @1@1154
mov word ptr [bp-18],8
@1@1154:
;
; if(taste == 'b') {disp--;if(disp<0) disp = 7;}//---------------------------> b_taste �ndert displayfarbe
;
cmp byte ptr [bp-37],98
jne short @1@1226
dec word ptr [bp-14]
cmp word ptr [bp-14],0
jge short @1@1226
mov word ptr [bp-14],7
@1@1226:
;
;
; if(taste == 'u') fix*=-1;//--------------------------------------> u_schaltet markierungsfixierung
;
cmp byte ptr [bp-37],117
jne short @1@1274
mov dx,65535
mov ax,word ptr [bp-24]
imul dx
mov word ptr [bp-24],ax
@1@1274:
;
;
; if(taste == 'w' && y_cpos > 3)//------------------------------------------------------------------------------> w_taste versc
;
cmp byte ptr [bp-37],119
jne short @1@1538
cmp word ptr [bp-12],3
jle short @1@1538
;
; {
; if(fix==1)
;
cmp word ptr [bp-24],1
jne short @1@1514
;
; {
; if((x_cpos == x_pos+1) && (y_cpos == y_pos+f1))y_pos--;
;
mov ax,word ptr [bp-6]
inc ax
cmp ax,word ptr [bp-10]
jne short @1@1418
mov ax,word ptr [bp-8]
add ax,word ptr [bp-22]
cmp ax,word ptr [bp-12]
jne short @1@1418
dec word ptr [bp-8]
@1@1418:
;
; if((x_cpos == x_pos+lng-2) && (y_cpos == y_pos+1-lng2))if(lng2-schub<=txlng-4)lng2++;
;
mov ax,word ptr [bp-6]
add ax,word ptr [bp-26]
add ax,65534
cmp ax,word ptr [bp-10]
jne short @1@1514
mov ax,word ptr [bp-8]
inc ax
sub ax,word ptr [bp-28]
cmp ax,word ptr [bp-12]
jne short @1@1514
mov ax,word ptr [bp-28]
sub ax,word ptr [bp-32]
mov dx,word ptr [bp-30]
add dx,65532
cmp ax,dx
jg short @1@1514
inc word ptr [bp-28]
@1@1514:
;
;
; }
; y_cpos--;
;
dec word ptr [bp-12]
@1@1538:
;
; }
;
; if(taste == 's' && y_cpos < 49) //---------------------------------------------------------------------------> s_taste versch
;
cmp byte ptr [bp-37],115
jne short @1@1802
cmp word ptr [bp-12],49
jge short @1@1802
;
; {
; if(fix==1)
;
cmp word ptr [bp-24],1
jne short @1@1778
;
; {
; if((x_cpos == x_pos+1) && (y_cpos == y_pos+f1))y_pos++;
;
mov ax,word ptr [bp-6]
inc ax
cmp ax,word ptr [bp-10]
jne short @1@1682
mov ax,word ptr [bp-8]
add ax,word ptr [bp-22]
cmp ax,word ptr [bp-12]
jne short @1@1682
inc word ptr [bp-8]
@1@1682:
;
; if((x_cpos == x_pos+lng-2) && (y_cpos == y_pos+1-lng2))if(lng2>=0)lng2--;
;
mov ax,word ptr [bp-6]
add ax,word ptr [bp-26]
add ax,65534
cmp ax,word ptr [bp-10]
jne short @1@1778
mov ax,word ptr [bp-8]
inc ax
sub ax,word ptr [bp-28]
cmp ax,word ptr [bp-12]
jne short @1@1778
cmp word ptr [bp-28],0
jl short @1@1778
dec word ptr [bp-28]
@1@1778:
;
;
; }
; y_cpos++;
;
inc word ptr [bp-12]
@1@1802:
;
; }
;
; if(taste == 'a' && x_cpos > 3) //----------------------------------------------------------------------------> a_taste versch
;
cmp byte ptr [bp-37],97
jne short @1@2066
cmp word ptr [bp-10],3
jle short @1@2066
;
; {
; if(fix==1)
;
cmp word ptr [bp-24],1
jne short @1@2042
;
; {
; if((x_cpos == x_pos+1) && (y_cpos == y_pos+f1))x_pos--;
;
mov ax,word ptr [bp-6]
inc ax
cmp ax,word ptr [bp-10]
jne short @1@1946
mov ax,word ptr [bp-8]
add ax,word ptr [bp-22]
cmp ax,word ptr [bp-12]
jne short @1@1946
dec word ptr [bp-6]
@1@1946:
;
; if((x_cpos == x_pos+lng-2) && (y_cpos == y_pos+1-lng2))if(lng>4)lng--;
;
mov ax,word ptr [bp-6]
add ax,word ptr [bp-26]
add ax,65534
cmp ax,word ptr [bp-10]
jne short @1@2042
mov ax,word ptr [bp-8]
inc ax
sub ax,word ptr [bp-28]
cmp ax,word ptr [bp-12]
jne short @1@2042
cmp word ptr [bp-26],4
jle short @1@2042
dec word ptr [bp-26]
@1@2042:
;
;
; }
;
; x_cpos--;
;
dec word ptr [bp-10]
@1@2066:
;
; }
;
; if(taste == 'd' && x_cpos < 78) //---------------------------------------------------------------------------> d_taste versch
;
cmp byte ptr [bp-37],100
jne short @1@2306
cmp word ptr [bp-10],78
jge short @1@2306
;
; {
; if(fix==1)
;
cmp word ptr [bp-24],1
jne short @1@2282
;
; {
; if((x_cpos == x_pos+1) && (y_cpos == y_pos+f1))x_pos++;
;
mov ax,word ptr [bp-6]
inc ax
cmp ax,word ptr [bp-10]
jne short @1@2210
mov ax,word ptr [bp-8]
add ax,word ptr [bp-22]
cmp ax,word ptr [bp-12]
jne short @1@2210
inc word ptr [bp-6]
@1@2210:
;
; if((x_cpos == x_pos+lng-2) && (y_cpos == y_pos+1-lng2))lng++;
;
mov ax,word ptr [bp-6]
add ax,word ptr [bp-26]
add ax,65534
cmp ax,word ptr [bp-10]
jne short @1@2282
mov ax,word ptr [bp-8]
inc ax
sub ax,word ptr [bp-28]
cmp ax,word ptr [bp-12]
jne short @1@2282
inc word ptr [bp-26]
@1@2282:
;
;
; }
; x_cpos++;
;
inc word ptr [bp-10]
@1@2306:
;
; }
;
; if(taste == 'i')schub++;
;
cmp byte ptr [bp-37],105
jne short @1@2354
inc word ptr [bp-32]
@1@2354:
;
; if(taste == 'k')if(lng2-(txlng-4)<=schub)schub--;
;
cmp byte ptr [bp-37],107
jne short @1@2426
mov ax,word ptr [bp-30]
add ax,65532
mov dx,word ptr [bp-28]
sub dx,ax
cmp dx,word ptr [bp-32]
jg short @1@2426
dec word ptr [bp-32]
@1@2426:
;
;
;
; if(taste == 'q') break; // q_ende
;
cmp byte ptr [bp-37],113
jne short @1@2474
jmp short @1@2498
@1@2474:
jmp @1@314
@1@2498:
;
;
;
; }
; }
;
pop ds
pop di
pop si
mov sp,bp
pop bp
ret
_cad_ endp
CAD_TEXT ends
CAD_DATA segment word public 'DATA'
_x_pos label word
db 70
db 0
_y_pos label word
db 4
db 0
_x_2pos label word
db 4
db 0
_y_2pos label word
db 34
db 0
_x_3pos label word
db 62
db 0
_y_3pos label word
db 41
db 0
_x_cpos label word
db 40
db 0
_y_cpos label word
db 26
db 0
_grdy label word
db 5
db 0
_grdx label word
db 6
db 0
_n_ label word
db 0
db 0
_cad_in label word
db 1
db 0
_cadini label word
db 0
db 0
_index label word
db 1
db 0
_grid label word
db 1
db 0
_lin label word
db 1
db 0
_fix label word
db 255
db 255
_fix1 label word
db 0
db 0
_set label word
db 1
db 0
_wnd3 label word
db 1
db 0
_drw label word
db 255
db 255
_drw_m label word
db 0
db 0
_f1 label word
db 7
db 0
_f2 label word
db 15
db 0
_f3 label word
db 8
db 0
_symb_ label word
db 4
db 0
_tx_disp label word
db 15
db 0
_disp label word
db 2
db 0
_tx_disp2 label word
db 7
db 0
CAD_DATA ends
CAD_TEXT segment byte public 'CODE'
;
; void symbole()
;
assume cs:CAD_TEXT
_symbole proc far
push bp
mov bp,sp
push ds
mov ax,CAD_DATA
mov ds,ax
;
; {
; gotoxy(cadx_pos[iLauf], cady_pos[iLauf]);
;
mov bx,word ptr _iLauf
shl bx,1
push word ptr _cady_pos[bx]
mov bx,word ptr _iLauf
shl bx,1
push word ptr _cadx_pos[bx]
call far ptr _gotoxy
add sp,4
;
; if(symb[iLauf]==1)cprintf("\xDB"); if(symb[iLauf]==2)cprintf("\x9E"); if(symb[iLauf]==3)cprintf("o");
;
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],1
jne short @2@74
push ds
mov ax,offset s@+35
push ax
call far ptr _cprintf
add sp,4
@2@74:
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],2
jne short @2@122
push ds
mov ax,offset s@+37
push ax
call far ptr _cprintf
add sp,4
@2@122:
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],3
jne short @2@170
push ds
mov ax,offset s@+39
push ax
call far ptr _cprintf
add sp,4
@2@170:
;
; if(symb[iLauf]==4)cprintf("."); if(symb[iLauf]==5)cprintf(" "); if(symb[iLauf]==6)cprintf("+");
;
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],4
jne short @2@218
push ds
mov ax,offset s@+41
push ax
call far ptr _cprintf
add sp,4
@2@218:
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],5
jne short @2@266
push ds
mov ax,offset s@+43
push ax
call far ptr _cprintf
add sp,4
@2@266:
mov bx,word ptr _iLauf
shl bx,1
cmp word ptr _symb[bx],6
jne short @2@314
push ds