*DECK NS$FBH
USETEXT NAT$NS
USETEXT SMB$NS
PROC NS$FBH((TLC),(ZEROSMB));# FORMAT ABH FOR NETWORK SM #
# TITLE NS$FBH - FORMAT ABH FOR NETWORK SM. #
BEGIN # NS$FBH #
#
** NS$FBH - FORMAT ABH FOR NETWORK SM.
*
* THIS ROUTINE FORAMTS THE ABH OFR NETWORK SM.
*
* PROC NS$FBH((TLC),(ZEROSMB))
*
* ENTRY:
* TLC - SM TEXT LENGTH IN 8-BIT BYTES.
* ZEROSMB - INDICATOR IF SMB$BUFFER IS TO BE CLEARED.
*
* EXIT:
* NONE.
*
* METHOD:
* BUILD ABH WITH ABT = 4, TLC = TLC, BT = 4,
* ACT = 8-BIT ASCII. SET DESTINATION AND SOURCE NODE.
* IF "ZEROSMB" SET, CLEAR SMB$BUFFER.
*
#
ITEM TLC U; # SM TEXT LENGTH IN 8-BIT BYTES #
ITEM ZEROSMB B; # INDICATE IF SMB$BUFFER IS TO BE CLEARED #
$BEGIN
XREF
BEGIN
PROC NS$DBG; # TRACE PROCEDURE CALL #
END
$END
ITEM I I; # LOOP VARIABLE #
ITEM N U; # SM TEXT LENGTH IN CM WORDS #
CONTROL EJECT;
$BEGIN
NS$DBG("FBH");
$END
ABHWORD[0] = 0; # CLEAR ABH WORD #
ABHABT[0] = APPPN; # APPLICATION BLOCK TYPE = 4 #
ABHDN[0] = NAT$SN[0]; # DESTINATION NODE #
ABHSN[0] = NAT$HN[0]; # SOURCE NODE #
ABHBT[0] = NETCMD; # BLOCK TYPE = 4 #
ABHACT[0] = CT8ASCII; # ACT IS ASCII-8 #
ABHTLC[0] = TLC; # TEXT LENGTH IN ASCII-8 CHAR #
IF ZEROSMB
THEN # ZERO SM BUFFER #
BEGIN
N = (2*TLC+14)/15; # TEXT LENGTH IN CM WORDS #
P<SMB> = LOC(SMB$BUFFER); # FWA OF SM BUFFER #
FOR I = 0 STEP 1 UNTIL N - 1
DO
BEGIN
SMBWORD[I] = 0;
END
END
RETURN;
END # NS$FBH #
TERM