PAM Programming Manual
Link-Level Programming Examples
PAM Programming Manual—142482
B-7
Procedures
( NoWait^depth > Max^NoWait^Depth ) THEN
BEGIN
CALL Clear^Report^Buffer;
report^buf^ptr ’:=’ [”NoWait depth is bad.”];
CALL Write^Report^Buf^and^Abend;
END;
--/---------------------------------------------------------------/
-- Pick up Foreign Address. It is a string of ASCII digits.
-- Convert it into a string of hex digits.
--/---------------------------------------------------------------/
@startup^message^ptr := end^addr + 1;
SCAN startup^message^ptr WHILE “ “ -> @startup^message^ptr;
Hex^digit^ndx := 0;
WHILE ( ( hex^digit^ndx / 2 ) <
( ZLAM^Val^MAC^Addr^Size + 2 ) ) AND
( startup^message^ptr[hex^digit^ndx] <> “ “ ) AND
( startup^message^ptr[hex^digit^ndx] <> “,” ) DO
BEGIN
IF ( startup^message^ptr[hex^digit^ndx] >= “0” ) AND
( startup^message^ptr[hex^digit^ndx] <= “9” ) THEN
hex^value := startup^message^ptr[hex^digit^ndx] - “0”
ELSE IF ( startup^message^ptr[hex^digit^ndx] >= “A” ) AND
( startup^message^ptr[hex^digit^ndx] <= “F” ) THEN
hex^value := ( startup^message^ptr[hex^digit^ndx] - “A” ) + 10
ELSE
BEGIN
CALL Clear^Report^Buffer;
report^buf^ptr ’:=’ [”Foreign Addr Digit is bad.”];
CALL Write^Report^Buf^and^AbEnd;
END;
IF NOT ( hex^digit^ndx.<15> ) THEN
foreign^addr^ptr[(hex^digit^ndx / 2)].<8:11> := hex^value
ELSE
foreign^addr^ptr[(hex^digit^ndx / 2)].<12:15> := hex^value;
hex^digit^ndx := hex^digit^ndx + 1;
END;
--/---------------------------------------------------------------/
-- Initialize Buffers
--/---------------------------------------------------------------/
buffer^lst^ndx := 0D;
WHILE ( buffer^lst^ndx < $UDbl ( Max^NoWait^Depth ) ) DO
BEGIN
buffer^lst^ptr[buffer^lst^ndx].in^use^flag := False;
buffer^lst^ndx := buffer^lst^ndx + 1D;
END;
END;