Line | |
---|
1 | unit Machine;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, CpuBitWidth, Memory, SerialPort;
|
---|
7 |
|
---|
8 | type
|
---|
9 |
|
---|
10 | { TMachine }
|
---|
11 |
|
---|
12 | TMachine1 = class
|
---|
13 | public
|
---|
14 | Cpu: TCpuBitWidth1;
|
---|
15 | Memory: TMemory1;
|
---|
16 | VideoMemory: TMemory1;
|
---|
17 | SystemMemory: TMemory1;
|
---|
18 | SerialPort: TSerialPort1;
|
---|
19 | constructor Create;
|
---|
20 | destructor Destroy; override;
|
---|
21 | end;
|
---|
22 |
|
---|
23 | { TMachine2 }
|
---|
24 |
|
---|
25 | TMachine2 = class
|
---|
26 | public
|
---|
27 | Cpu: TCpuBitWidth2;
|
---|
28 | Memory: TMemory2;
|
---|
29 | VideoMemory: TMemory2;
|
---|
30 | SystemMemory: TMemory2;
|
---|
31 | SerialPort: TSerialPort2;
|
---|
32 | constructor Create;
|
---|
33 | destructor Destroy; override;
|
---|
34 | end;
|
---|
35 |
|
---|
36 | implementation
|
---|
37 |
|
---|
38 | { TMachine2 }
|
---|
39 |
|
---|
40 | constructor TMachine2.Create;
|
---|
41 | begin
|
---|
42 | Memory := TMemory2.Create;
|
---|
43 | VideoMemory := TMemory2.Create;
|
---|
44 | SystemMemory := TMemory2.Create;
|
---|
45 | SerialPort := TSerialPort2.Create;
|
---|
46 | Cpu := TCpuBitWidth2.Create;
|
---|
47 | Cpu.IO := SerialPort;
|
---|
48 | Cpu.Memory := Memory;
|
---|
49 | end;
|
---|
50 |
|
---|
51 | destructor TMachine2.Destroy;
|
---|
52 | begin
|
---|
53 | FreeAndNil(SerialPort);
|
---|
54 | FreeAndNil(Cpu);
|
---|
55 | FreeAndNil(SystemMemory);
|
---|
56 | FreeAndNil(VideoMemory);
|
---|
57 | FreeAndNil(Memory);
|
---|
58 | inherited;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | { TMachine }
|
---|
62 |
|
---|
63 | constructor TMachine1.Create;
|
---|
64 | begin
|
---|
65 | Memory := TMemory1.Create;
|
---|
66 | VideoMemory := TMemory1.Create;
|
---|
67 | SystemMemory := TMemory1.Create;
|
---|
68 | SerialPort := TSerialPort1.Create;
|
---|
69 | Cpu := TCpuBitWidth1.Create;
|
---|
70 | Cpu.IO := SerialPort;
|
---|
71 | Cpu.Memory := Memory;
|
---|
72 | end;
|
---|
73 |
|
---|
74 | destructor TMachine1.Destroy;
|
---|
75 | begin
|
---|
76 | FreeAndNil(SerialPort);
|
---|
77 | FreeAndNil(Cpu);
|
---|
78 | FreeAndNil(SystemMemory);
|
---|
79 | FreeAndNil(VideoMemory);
|
---|
80 | FreeAndNil(Memory);
|
---|
81 | inherited;
|
---|
82 | end;
|
---|
83 |
|
---|
84 | end.
|
---|
85 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.