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
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, Menus;
type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
groupbox1: TGroupBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
Button1: TButton;
RadioButton1: TRadioButton;
Label1: TLabel;
GroupBox2: TGroupBox;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
BitBtn1: TBitBtn;
GroupBox3: TGroupBox;
CheckBox7: TCheckBox;
CheckBox8: TCheckBox;
CheckBox9: TCheckBox;
CheckBox10: TCheckBox;
CheckBox11: TCheckBox;
CheckBox12: TCheckBox;
CheckBox13: TCheckBox;
CheckBox14: TCheckBox;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function inportb (leport:longint) :byte;
var
valeur : byte;
begin
asm
push edx
mov edx, leport
in al, dx
mov valeur, al
pop edx
end;
inportb := valeur;
end;
procedure outportb ( leport:longint; valeur:byte) ; ASSEMBLER;
begin
asm
push edx
mov edx, leport
mov al, valeur
out dx, al
pop edx
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i,j:integer;
begin
radiobutton1.Checked := true;
for i:=0 to 61 do
begin
for j:=0 to 10 do
begin
outportb($378,$00);
sleep(1000);
outportb($37a,$a);
checkbox6.Checked:=false;
checkbox1.Checked:=false;
checkbox1.Color:= clred;
checkbox2.Checked:=true;
radiobutton6.checked:=false;
end;
;
outportb($37a,$b);
for j :=11 to 12 do
begin
radiobutton2.checked:=true;
end;
;
for j:=13to 23 do
begin
sleep(1000);
checkbox2.Checked:=false;
checkbox2.Color:= clred;
checkbox3.Checked:=true;
outportb ($378,$01);
radiobutton2.checked:=false;
end;
for j :=24 to 25 do
radiobutton3.checked:=true;
;
for j:=26 to 35 do
begin
sleep(1000);
checkbox3.Checked:=false;
checkbox3.Color:= clred;
checkbox4.Checked:=true;
outportb ($378,$02);
radiobutton3.checked:=false;
end;
;
for j :=36 to 37do
radiobutton4.checked:=true;
;
for j:=38 to 47 do
begin
sleep(1000);
checkbox4.Checked:=false;
checkbox4.Color:= clred;
checkbox5.Checked:=true;
outportb ($378,$04);
radiobutton4.checked:=false;
end;
;
for j :=48 to 49 do
radiobutton5.checked:=true;
;
for j:=50to 59 do
begin
sleep(1000);
checkbox5.Checked:=false;
checkbox5.Color:= clred;
checkbox6.Checked:=true;
outportb ($378,$8);
radiobutton5.checked:=false;
end;
;
for j :=60 to 61 do
radiobutton6.checked:=true;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
checkbox1.Checked:=true;
checkbox1.Color:= clred;
outportb ($378,$00);
outportb ($37a,$b);
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
form1.Close;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var d0,d1,d2,d3,d4,d5,d6,sortie:byte;
begin
if checkbox7.checked =true then outportb ($37a,$a)
else outportb ($37a,$b)
;
if checkbox8.checked =true then d0:=1
else d0:=0
;
if checkbox9.checked =true then d1:=2
else d1:=0
;
if checkbox10.checked =true then d2:=4
else d2:=0
;
if checkbox11.checked =true then d3:=8
else d3:=0
;
if checkbox12.checked =true then d4:=16
else d4:=0
;
if checkbox13.checked =true then d5:=32
else d5:=0
;
if checkbox14.checked =true then d6:=64
else d6:=0
;
sortie := d0+d1+d2+d3+d4+d5+d6;
outportb($378, sortie);
end;
end. |
Partager