1. A. Program menyalakan_led4;
» Pascal:
uses crt;
var i:byte;
begin
i:=4;
port[$378]:=i;
end.
» Assembly:
Mov DX, 378 H
Mov AL, 4
Out DX, AL
B. Program nyalakan_led7;
» Pascal:
uses crt;
var i:byte;
begin
i:=64;
port[$378]:=i;
end.
» Assembly:
Mov DX, 378 H
Mov AL, DF
Out DX, AL
2. Program menyalakan LED membentuk angka 15014 dengan 7 Segment
uses crt;
begin
port[$378]:=$06; {mengaktifkan data 2, 3 / b, c}
delay(500);
port[$378]:=$75; {mengaktifkan data 1, 3, 5, 6, 7 / a, c, e, f, g}
delay(500);
port[$378]:=$3f; {mengaktifkan data 1, 2, 3, 4, 5, 6 /a, b, c, e, d, f}
delay(500);
port[$378]:=$06; {mengaktifkan data 2, 3 / b, c}
delay(500);
port[$378]:=$66; {mengaktifkan data 2, 3, 6, 7 / b, c, f, g}
end.
0 komentar:
Posting Komentar