DIGITAL INPUT/OUTPUT CARD IOD-144 USER MANUAL
6-6
{of each sensor}
begin
tempA := port[BASEADDR]; {this procedure loads tempA and tempB} {with cor-
responding inputs from the Card}
tempB := port[BASEADDR+1];
for i := 0 to 7 do begin
if ((tempA shr i) AND ON) > 0 then {this tests to see if bit #i is ON and sets the}
ary[i]:=ON {corresponding array element to ON if it is}
else {else, the array element is set to OFF}
ary[i]:=OFF
end;
for i:=0 to 7 do begin
if ((tempB shr i) AND ON) > 0 then
ary[i+8]:=ON {in order to get Port B into array, elements}
else {8 thru 15, we add 8 to the bit numbers in }
ary[i+8]:=OFF; {in the assignment}
end;
end;{procedure read_sensors}
function get_status:integer;
var temp:integer;
begin {this sets status to the lower nybble of Port}
temp:=port[BASEADDR+2]; {;the half defined by Initialize to be input for}
get_status:=temp AND $0F; {four arming switches}
end; {function get_arming_status
procedure ALARM
var temp:longint;
begin
sound(2000); {this starts the computer's speaker which }
{acts as siren for the alarm}
temp:=0
port[BASEADDR+2]:=$F; {this sets Port C's lower nybble bits to ON}
repeat
arming_stations:=get_status {this activates four alarm outputs and then}
if arming_stations <> old_arming_stations then {toggles Port C Hi's LSB which}
temp:=2000000000; {disarmed}{might be used with an external siren}
port[BASEADDR+2]:=port[BASEADDR+2] XOR $10;
temp:=temp+1;
until temp>=2000000000;
nosound;
end; {procedure ALARM}
begin
initialize_board;
clrscr;
gotoxy(5,5);