-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrfCpu.pas
executable file
·908 lines (719 loc) · 22.7 KB
/
GrfCpu.pas
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
unit GrfCpu;
{$MODE Delphi}
interface
uses
ExtCtrls, Graphics, SysUtils;
const
cmdAlu = 0;
cmdFlags = 1;
cmdGenReg = 2;
cmdSP = 3;
cmdT = 4;
cmdPC = 5;
cmdIVR = 6;
cmdADR = 7;
cmdMDR = 8;
cmdMDRMux = 9;
cmdMem = 10;
type
TGrfCpu = class
private
own: TObject;
procedure DrowBuss(tmpX: Integer; tmpY: Integer; tmpSz: Integer; tmpName: String; Use: Boolean);
procedure DrowData(tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String; Use: Boolean);
procedure DrowALU(tmpX: Integer; tmpY: Integer; Use: Boolean);
procedure DrowMUX(tmpX: Integer; tmpY: Integer; Use: Boolean);
procedure DrowBGC(tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String);
procedure DrowResetImg();
public
constructor Create(tmpOwn: TObject);
procedure ResetCpu();
procedure PdSFLAGS;
procedure PdDFLAGS;
procedure pdSGenReg;
procedure pdDGenReg;
procedure pdSSP;
procedure pdDSP;
procedure pdST;
procedure pdDT;
procedure pdSPC;
procedure pdDPC;
procedure pdSIVR;
procedure pdDIVR;
procedure pdSADR;
procedure pdDADR;
procedure pdSMDR;
procedure pdDMDR;
procedure pdSIR;
procedure pdDIR;
procedure pdRALU;
procedure pdCONDALU;
procedure pdMem;
procedure pmALU;
procedure pmFLAGS;
procedure pmGenReg;
procedure pmSP;
procedure pmT;
procedure pmPC;
procedure pmIVR;
procedure pmADR;
procedure pmMDR;
procedure pmMuxMDR;
procedure cmdMem;
end;
implementation
uses main;
procedure TGrfCpu.DrowData(tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String; Use: Boolean);
begin
with (Own as TImage) do
begin
Canvas.Pen.Width := 1;
Canvas.Pen.Style := psSolid;
if pos('CMD', Uppercase(tmpTyp))>0 then
begin
if not use then
Canvas.Pen.Color := clBlue
else
Canvas.Pen.Color := clFuchsia;
end
else
begin
if use then
Canvas.Pen.Color := clRed
else
Canvas.Pen.Color := clGreen;
end;
Canvas.MoveTo(tmpXs, tmpYs);
canvas.LineTo(tmpXe, tmpYe);
if pos('START', Uppercase(tmpTyp))>0 then
begin
Canvas.MoveTo(tmpXs, tmpYs);
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := Canvas.Pen.Color;
Canvas.Ellipse(tmpXs - 3, tmpYs - 3, tmpXs + 3, tmpYs + 3);
end;
if pos('END', Uppercase(tmpTyp))>0 then
begin
Canvas.MoveTo(tmpXe, tmpYe);
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := Canvas.Pen.Color;
if pos('UP', Uppercase(tmpTyp))>0 then
begin
Canvas.LineTo(tmpXe - 3, tmpYe + 3);
Canvas.LineTo(tmpXe + 3, tmpYe + 3);
Canvas.LineTo(tmpXe, tmpYe);
end;
if pos('DOWN', Uppercase(tmpTyp))>0 then
begin
Canvas.LineTo(tmpXe - 3, tmpYe - 3);
Canvas.LineTo(tmpXe + 3, tmpYe - 3);
Canvas.LineTo(tmpXe, tmpYe);
end;
if pos('LEFT', Uppercase(tmpTyp))>0 then
begin
Canvas.LineTo(tmpXe + 3, tmpYe + 3);
Canvas.LineTo(tmpXe + 3, tmpYe - 3);
Canvas.LineTo(tmpXe, tmpYe);
end;
if pos('RIGHT', Uppercase(tmpTyp))>0 then
begin
Canvas.LineTo(tmpXe - 3, tmpYe + 3);
Canvas.LineTo(tmpXe - 3, tmpYe - 3);
Canvas.LineTo(tmpXe, tmpYe);
end;
end;
end;
end;//procedure TGfrCpu.DrowData(tmpOwn: TObject; tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String; Use: Boolean);
procedure TGrfCpu.DrowMUX(tmpX: Integer; tmpY: Integer; Use: Boolean);
var
x, y: Integer;
begin
with (Own as TImage) do
begin
if use then
Canvas.Pen.Color := clRed
else
Canvas.Pen.Color := clGreen;
Canvas.Pen.Width := 1;
Canvas.Pen.Style := psSolid;
Canvas.Brush.Style := bsClear;
x:= tmpX + 10;
y:= tmpY;
Canvas.MoveTo(x, y);
x := x - 10;
y := y + 10;
Canvas.LineTo(x, y);
x := x;
y := y + 10;
Canvas.LineTo(x, y);
x := x + 10;
y := y + 10;
Canvas.LineTo(x, y);
x := x;
y := y - 30;
Canvas.LineTo(x, y);
end;
end;//procedure TGfrCpu.DrowMUX(tmpOwn: TObject; tmpX: Integer; tmpY: Integer; Use: Boolean);
procedure TGrfCpu.DrowBGC(tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String);
begin
with (Own as TImage) do
begin
Canvas.Pen.Color := clBlack;
Canvas.Pen.Width := 1;
Canvas.Pen.Style := psSolid;
Canvas.Brush.Style := bsClear;
Canvas.Brush.Color := clWhite;
Canvas.MoveTo(tmpXs, tmpYs);
canvas.LineTo(tmpXs, tmpYe);
canvas.LineTo(tmpXe, tmpYe);
canvas.LineTo(tmpXe, tmpYs);
canvas.LineTo(tmpXs, tmpYs);
Canvas.TextOut(tmpXs + 10, tmpYs + 10, tmpTyp);
end;
end;//procedure TGrfCpu.DrowBGC(tmpOwn: TObject; tmpXs: Integer; tmpYs: Integer; tmpXe: Integer; tmpYe: Integer; tmpTyp: String);
procedure TGrfCpu.DrowALU(tmpX: Integer; tmpY: Integer; Use: Boolean);
var
x, y: Integer;
begin
with (Own as TImage) do
begin
if use then
Canvas.Pen.Color := clRed
else
Canvas.Pen.Color := clGreen;
Canvas.Pen.Width := 1;
Canvas.Pen.Style := psSolid;
Canvas.Brush.Style := bsClear;
x:= tmpX;
y:= tmpY;
Canvas.MoveTo(x, y);
x := x + 20;
y := y + 10;
Canvas.LineTo(x, y);
y := y + 20;
Canvas.LineTo(x, y);
x := x - 20;
y := y + 10;
Canvas.LineTo(x, y);
x := x;
y := y - 15;
Canvas.LineTo(x, y);
x := x + 5;
y := y - 5;
Canvas.LineTo(x, y);
x := x-5;
y := y - 5;
Canvas.LineTo(x, y);
x := x;
y := y - 15;
Canvas.LineTo(x, y);
Canvas.Font.Name := 'arial';
Canvas.Font.Size := 6;
x := tmpX + 2;
y := tmpY + 10 - round(Canvas.TextHeight('D')/2);
Canvas.TextOut(x, y, 'D');
Canvas.Font.Size := 6;
x := tmpX + 2;
y := tmpY + 30 - round(Canvas.TextHeight('S')/2);
Canvas.TextOut(x, y, 'S');
Canvas.Font.Size := 6;
x := tmpX + 20 - Canvas.TextWidth('R') - 1;
y := tmpY + 15;
Canvas.TextOut(x, y, 'R');
end;
end;//procedure TGfrCpu.DrowALU(tmpOwn: TObject; tmpX: Integer; tmpY: Integer; Use: Boolean);
procedure TGrfCpu.DrowBuss(tmpX: Integer; tmpY: Integer; tmpSz: Integer; tmpName: String; Use: Boolean);
begin
with (Own as TImage) do
begin
if use then
Canvas.Pen.Color := clRed
else
Canvas.Pen.Color := clGreen;
Canvas.Pen.Width := 3;
Canvas.Pen.Style := psSolid;
Canvas.Brush.Style := bsClear;
Canvas.MoveTo(tmpX, tmpY);
Canvas.LineTo(tmpX, tmpY + tmpSz);
Canvas.Font.Name := 'arial';
Canvas.Font.Size := 7;
Canvas.TextOut(tmpX - Canvas.TextWidth(tmpName)-1, tmpY + 10, tmpName);
end;
end;//procedure TGfrCpu.DrowBuss(tmpOwn: TObject; tmpX: Integer; tmpY: Integer; tmpSz: Integer; tmpName: String; Use: Boolean);
procedure TGrfCpu.DrowResetImg();
begin
with (Own as TImage) do
begin
Canvas.Pen.Color := clWhite;
Canvas.Brush.Color := clWhite;
Canvas.Clear;
end;
end;
constructor TGrfCpu.Create(tmpOwn: TObject);
begin
own := tmpOwn;
end;//constructor TGfrCpu.Create();
procedure TGrfCpu.ResetCpu();
var
i: Integer;
regEnd: Integer;
sel: Boolean;
begin
regEnd := MainForm.LabeledEdit1.Left + MainForm.LabeledEdit1.Width;
DrowResetImg();
sel := false;
DrowALU(300, 15, sel);
//RBus
DrowMUX(370, 85, sel);
DrowBuss(430, 15, 485, 'RBus(16 b)', sel);//RBus
DrowData(320, 35, 429, 35, 'DATA END Right', sel);//ALU -> RBus
//COND
DrowData(310, 50, 310, 60, 'DATA', sel);
DrowData(310, 60, 400, 60, 'DATA', sel);
DrowData(400, 60, 400, 95, 'DATA', sel);
DrowData(400, 95, 380, 95, 'DATA END LEFT', sel);
//COND
DrowData(370, 100, regEnd, 100, 'DATA END LEFT', sel);//MUX -> Flags
DrowData(430, 105, 380, 105, 'DATA START END LEFT', sel);//RBus -> MUX
DrowData(430, 170, 414, 170, 'DATA START END LEFT', sel);//RBus -> GenReg
//RBus -> Reg
for i:=1 to 5 do
DrowData(430, 250 + (i-1)*48, regEnd, 250+ (i-1)*48, 'DATA START END LEFT', sel);
//RBus -> Reg
DrowMUX(370, 475, sel);
DrowData(430, 485, 380, 485, 'DATA START END LEFT', sel);//RBus -> MUX
DrowData(370, 490, regEnd, 490, 'DATA END LEFT', sel);//Mux -> MDR
//RBus
//DBus
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 93, 202, 93, 'DATA START END LEFT', sel);//FLAGS -> DBus
DrowData(256, 150, 202, 150, 'DATA START END LEFT', sel);//GenReg -> DBus
//reg - > DBus
for i:=1 to 6 do
DrowData(256, 245 + (i-1)*48, 202, 245+ (i-1)*48, 'DATA START END LEFT', sel);
//reg - > DBus
DrowData(229, 486, 229, 530, 'DATA START END DOWN', sel);//MDR -> Mem
DrowData(126, 440, 198, 440, 'DATA START END RIGHT', sel);//IR -> DBus
//DBus
//SBus
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 103, 152, 103, 'DATA START END LEFT', sel);//FLAGS -> SBus
DrowData(256, 200, 152, 200, 'DATA START END LEFT', sel);//GenReg -> SBus
//reg - > SBus
for i:=1 to 6 do
DrowData(256, 255 + (i-1)*48, 152, 255+ (i-1)*48, 'DATA START END LEFT', sel);
//reg - > SBus
DrowData(219, 448, 219, 530, 'DATA START END DOWN', sel);//ADR -> Mem
DrowData(126, 430, 148, 430, 'DATA START END RIGHT', sel);//IR -> SBus
//SBus
//MemBus
DrowData(15, 435, 20, 435, 'DATA END RIGHT', sel);//MemBus -> IR
DrowData(15, 435, 15, 620, 'DATA', sel);//MemBus
DrowData(15, 620, 400, 620, 'DATA', sel);//MemBus
DrowData(400, 620, 400, 495, 'DATA', sel);//MemBus
DrowData(400, 495, 380, 495, 'DATA END LEFT', sel);//MemBus
DrowData(190, 604, 190, 620, 'DATA START END Down', sel);//Mem -> MemBus
//MemBus
//BGC
DrowBGC(10, 100, 130, 500, 'BGC');
//BGC
//cmdAlu
DrowData(50, 100, 50, 10, 'CMD START', sel);//BGC -> CmdALU
DrowData(50, 10, 310, 10, 'CMD', sel);//mdALU
DrowData(310, 10, 310, 20, 'CMD END DOWN', sel);//CmdALU -> ALU
//cmdAlu
//cmdFLAG
DrowData(80, 100, 80, 70, 'CMD START', sel);//BGC -> CmdFLAGS
DrowData(80, 70, 375, 70, 'CMD', sel);//CmdFLAGS
DrowData(310, 70, 310, 87, 'CMD END DOWN', sel);//CmdFLAGS -> FLAGS
DrowData(375, 70, 375, 88, 'CMD END DOWN', sel);//CmdFLAGS -> MUX
//cmdFLAG
//cmdGenReg
DrowData(130, 115, 340, 115, 'CMD START', sel);//BGC -> cmdGenReg
DrowData(340, 115, 340, 137, 'CMD END DOWN', sel);//cmdGenReg -> GenReg
//cmdGenReg
//cmdSP
DrowData(130, 220, 300, 220, 'CMD START', sel);//BGC -> cmdSP
DrowData(300, 220, 300, 240, 'CMD END DOWN', sel);//cmdSP -> SP
//cmdSP
//cmdT
DrowData(130, 270, 300, 270, 'CMD START', sel);//BGC -> cmdSP
DrowData(300, 270, 300, 287, 'CMD END DOWN', sel);//cmdSP -> SP
//cmdT
//cmdPC
DrowData(130, 320, 300, 320, 'CMD START', sel);//BGC -> cmdPC
DrowData(300, 320, 300, 335, 'CMD END DOWN', sel);//cmdPC -> SP
//cmdPC
//cmdIVR
DrowData(130, 365, 300, 365, 'CMD START', sel);//BGC -> cmdIVR
DrowData(300, 365, 300, 385, 'CMD END DOWN', sel);//cmdIVR -> SP
//cmdIVR
//cmdADR
DrowData(130, 415, 300, 415, 'CMD START', sel);//BGC -> cmdADR
DrowData(300, 415, 300, 431, 'CMD END DOWN', sel);//cmdADR -> SP
//cmdADR
//cmdMDR
DrowData(130, 460, 300, 460, 'CMD START', sel);//BGC -> cmdMDR
DrowData(300, 460, 300, 480, 'CMD END DOWN', sel);//cmdMDR -> SP
//cmdMDR
//cmdMDRMux
DrowData(80, 500, 80, 510, 'CMD START', sel);//BGC -> cmdMDRMux
DrowData(80, 510, 375, 510, 'CMD', sel);//cmdMDRmux
DrowData(375, 510, 375, 500, 'CMD END UP', sel);//cmdMDRmux -> MDRMux
//cmdMDRMux
//cmdMem
DrowData(50, 500, 50, 570, 'CMD START', sel);//BGC -> cmdMem
DrowData(50, 570, 125, 570, 'CMD END Right', sel);//cmdMem -> Mem
//cmdMem
end;//procedure TGfrCpu.ResetCpu(own: TObject);
procedure TGrfCpu.PdSFLAGS;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 103, 152, 103, 'DATA START END LEFT', sel);//FLAGS -> SBus
pmFLAGS;
end;//procedure TGrfCpu.PdSFLAGS;
procedure TGrfCpu.PdDFLAGS;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 93, 202, 93, 'DATA START END LEFT', sel);//FLAGS -> DBus
pmFLAGS;
end;//procedure TGrfCpu.PdDFLAGS;
procedure TGrfCpu.pdSGenReg;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 200, 152, 200, 'DATA START END LEFT', sel);//GenReg -> SBus
pmGenReg;
end;//procedure TGrfCpu.pdSGenReg;
procedure TGrfCpu.pdDGenReg;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 150, 202, 150, 'DATA START END LEFT', sel);//GenReg -> DBus
pmGenReg;
end;//procedure TGrfCpu.pdDGenReg;
procedure TGrfCpu.pdSSP;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 255, 152, 255, 'DATA START END LEFT', sel);//SP -> SBus
pmSP;
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDSP;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 245, 202, 245, 'DATA START END LEFT', sel);//SP -> DBus
pmSP;
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdST;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 303, 152, 303, 'DATA START END LEFT', sel);//T -> SBus
pmT;
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDT;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 293, 202, 293, 'DATA START END LEFT', sel);//T -> DBus
pmT;
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdSPC;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 351, 152, 351, 'DATA START END LEFT', sel);//PC -> SBus
pmPC;
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDPC;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 341, 202, 341, 'DATA START END LEFT', sel);//T -> DBus
pmPC;
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdSIVR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 399, 152, 399, 'DATA START END LEFT', sel);//IVR -> SBus
pmIVR;
end;//procedure TGrfCpu.pdSIVR;
procedure TGrfCpu.pdDIVR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 389, 202, 389, 'DATA START END LEFT', sel);//IVR -> DBus
pmIVR;
end;//procedure TGrfCpu.pdDIVR;
procedure TGrfCpu.pdSADR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 447, 152, 447, 'DATA START END LEFT', sel);//ADR -> SBus
DrowData(219, 448, 219, 530, 'DATA START END DOWN', sel);//ADR -> Mem
pmADR;
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDADR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 437, 202, 437, 'DATA START END LEFT', sel);//ADR -> DBus
pmADR;
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdSMDR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(256, 495, 152, 495, 'DATA START END LEFT', sel);//MDR -> SBus
pmMDR;
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDMDR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(256, 485, 202, 485, 'DATA START END LEFT', sel);//MDR -> DBus
DrowData(229, 486, 229, 530, 'DATA START END DOWN', sel);//MDR -> Mem
pmMDR;
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdSIR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(150, 15, 485, 'SBus(16 b)', sel);
DrowData(150, 45, 300, 45, 'DATA START END RIGHT', sel);//SBus -> ALU
DrowData(126, 430, 148, 430, 'DATA START END RIGHT', sel);//IR -> SBus
end;//procedure TGrfCpu.pdSSP;
procedure TGrfCpu.pdDIR;
var
sel: Boolean;
begin
sel := True;
DrowBuss(200, 15, 485, 'DBus(16 b)', sel);
DrowData(200, 25, 300, 25, 'DATA START END RIGHT', sel);//DBus -> ALU
DrowData(126, 440, 198, 440, 'DATA START END RIGHT', sel);//IR -> DBus
end;//procedure TGrfCpu.pdDSP;
procedure TGrfCpu.pdRALU;
var
sel: Boolean;
i: Integer;
regEnd: Integer;
begin
regEnd := MainForm.LabeledEdit1.Left + MainForm.LabeledEdit1.Width;
sel := True;
DrowBuss(430, 15, 485, 'RBus(16 b)', sel);//RBus
DrowData(320, 35, 429, 35, 'DATA END Right', sel);//ALU -> RBus
DrowData(430, 105, 380, 105, 'DATA START END LEFT', sel);//RBus -> MUX
DrowData(430, 170, 414, 170, 'DATA START END LEFT', sel);//RBus -> GenReg
//RBus -> Reg
for i:=1 to 5 do
DrowData(430, 250 + (i-1)*48, regEnd, 250+ (i-1)*48, 'DATA START END LEFT', sel);
//RBus -> Reg
DrowData(430, 485, 380, 485, 'DATA START END LEFT', sel);//RBus -> MUX
//cmdAlu
DrowData(50, 100, 50, 10, 'CMD START', sel);//BGC -> CmdALU
DrowData(50, 10, 310, 10, 'CMD', sel);//mdALU
DrowData(310, 10, 310, 20, 'CMD END DOWN', sel);//CmdALU -> ALU
//cmdAlu
end;//procedure TGrfCpu.pdRALU;
procedure TGrfCpu.pdCONDALU;
var
sel: Boolean;
begin
sel := True;
//COND
DrowData(310, 50, 310, 60, 'DATA', sel);
DrowData(310, 60, 400, 60, 'DATA', sel);
DrowData(400, 60, 400, 95, 'DATA', sel);
DrowData(400, 95, 380, 95, 'DATA END LEFT', sel);
//COND
pmALU;
end;//procedure TGrfCpu.pdCONDALU;
procedure TGrfCpu.pdMem;
var
sel: Boolean;
begin
sel := True;
//MemBus
DrowData(15, 435, 20, 435, 'DATA END RIGHT', sel);//MemBus -> IR
DrowData(15, 435, 15, 620, 'DATA', sel);//MemBus
DrowData(15, 620, 400, 620, 'DATA', sel);//MemBus
DrowData(400, 620, 400, 495, 'DATA', sel);//MemBus
DrowData(400, 495, 380, 495, 'DATA END LEFT', sel);//MemBus
DrowData(190, 604, 190, 620, 'DATA START END Down', sel);//Mem -> MemBus
//MemBus
//cmdMem
DrowData(50, 500, 50, 570, 'CMD START', sel);//BGC -> cmdMem
DrowData(50, 570, 125, 570, 'CMD END Right', sel);//cmdMem -> Mem
//cmdMem
end;//procedure TGrfCpu.pdMem;
procedure TGrfCpu.pmALU;
var
sel: Boolean;
begin
sel := True;
//cmdAlu
DrowData(50, 100, 50, 10, 'CMD START', sel);//BGC -> CmdALU
DrowData(50, 10, 310, 10, 'CMD', sel);//cmdALU
DrowData(310, 10, 310, 20, 'CMD END DOWN', sel);//CmdALU -> ALU
//cmdAlu
end;//procedure TGrfCpu.pmALU;
procedure TGrfCpu.pmFLAGS;
var
sel: Boolean;
begin
sel := True;
//cmdFLAG
DrowData(80, 100, 80, 70, 'CMD START', sel);//BGC -> CmdFLAGS
DrowData(80, 70, 375, 70, 'CMD', sel);//CmdFLAGS
DrowData(310, 70, 310, 87, 'CMD END DOWN', sel);//CmdFLAGS -> FLAGS
DrowData(375, 70, 375, 88, 'CMD END DOWN', sel);//CmdFLAGS -> MUX
//cmdFLAG
end;//procedure TGrfCpu.pmFLAGS;
procedure TGrfCpu.pmGenReg;
var
sel: Boolean;
begin
sel := True;
//cmdGenReg
DrowData(130, 115, 340, 115, 'CMD START', sel);//BGC -> cmdGenReg
DrowData(340, 115, 340, 137, 'CMD END DOWN', sel);//cmdGenReg -> GenReg
//cmdGenReg
end;//procedure TGrfCpu.pmGenReg;
procedure TGrfCpu.pmSP;
var
sel: Boolean;
begin
sel := True;
//cmdSP
DrowData(130, 220, 300, 220, 'CMD START', sel);//BGC -> cmdSP
DrowData(300, 220, 300, 240, 'CMD END DOWN', sel);//cmdSP -> SP
//cmdSP
end;//procedure TGrfCpu.pmSP;
procedure TGrfCpu.pmT;
var
sel: Boolean;
begin
sel := True;
//cmdT
DrowData(130, 270, 300, 270, 'CMD START', sel);//BGC -> cmdSP
DrowData(300, 270, 300, 287, 'CMD END DOWN', sel);//cmdSP -> SP
//cmdT
end;//procedure TGrfCpu.pmT;
procedure TGrfCpu.pmPC;
var
sel: Boolean;
begin
sel := True;
//cmdPC
DrowData(130, 320, 300, 320, 'CMD START', sel);//BGC -> cmdPC
DrowData(300, 320, 300, 335, 'CMD END DOWN', sel);//cmdPC -> SP
//cmdPC
end;//procedure TGrfCpu.pmPC;
procedure TGrfCpu.pmIVR;
var
sel: Boolean;
begin
sel := True;
//cmdIVR
DrowData(130, 365, 300, 365, 'CMD START', sel);//BGC -> cmdIVR
DrowData(300, 365, 300, 385, 'CMD END DOWN', sel);//cmdIVR -> SP
//cmdIVR
end;//procedure TGrfCpu.pmIVR;
procedure TGrfCpu.pmADR;
var
sel: Boolean;
begin
sel := True;
//cmdADR
DrowData(130, 415, 300, 415, 'CMD START', sel);//BGC -> cmdADR
DrowData(300, 415, 300, 431, 'CMD END DOWN', sel);//cmdADR -> SP
//cmdADR
end;//procedure TGrfCpu.pmADR;
procedure TGrfCpu.pmMDR;
var
sel: Boolean;
begin
sel := True;
//cmdMDR
DrowData(130, 460, 300, 460, 'CMD START', sel);//BGC -> cmdMDR
DrowData(300, 460, 300, 480, 'CMD END DOWN', sel);//cmdMDR -> SP
//cmdMDR
end;//procedure TGrfCpu.pmMDR;
procedure TGrfCpu.pmMuxMDR;
var
sel: Boolean;
begin
sel := True;
//cmdMDRMux
DrowData(80, 500, 80, 510, 'CMD START', sel);//BGC -> cmdMDRMux
DrowData(80, 510, 375, 510, 'CMD', sel);//cmdMDRmux
DrowData(375, 510, 375, 500, 'CMD END UP', sel);//cmdMDRmux -> MDRMux
//cmdMDRMux
end;//procedure TGrfCpu.pmMuxMDR;
procedure TGrfCpu.cmdMem;
var
sel: Boolean;
begin
sel := True;
//cmdMem
DrowData(50, 500, 50, 570, 'CMD START', sel);//BGC -> cmdMem
DrowData(50, 570, 125, 570, 'CMD END Right', sel);//cmdMem -> Mem
//cmdMem
end;//procedure TGrfCpu.cmdMem;
end.