Google
 

Trailing-Edge - PDP-10 Archives - BB-FB51A-RM - sna-ai/sources/saimac.lst
There are no other files named saimac.lst in the archive.
		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   1
								13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (1)

;   0001  0	%title 'SNA GATEWAY ACCESS MACRO-20 INTERFACE'
;   0002  0	
;   0003  0	module SAIMAC (ident = 'Version 1.0') =
;   0004  1	begin
;   0005  1	
;   0006  1	! Copyright (c) 1985 by
;   0007  1	! DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts
;   0008  1	!
;   0009  1	! This software is furnished under a license and may be used and  copied
;   0010  1	! only  in  accordance  with  the  terms  of  such  license and with the
;   0011  1	! inclusion of the above copyright notice.  This software or  any  other
;   0012  1	! copies  thereof may not be provided or otherwise made available to any
;   0013  1	! other person.  No title to and ownership of  the  software  is  hereby
;   0014  1	! transferred.
;   0015  1	!
;   0016  1	! The information in this software is subject to change  without  notice
;   0017  1	! and  should  not  be  construed  as  a commitment by Digital Equipment
;   0018  1	! Corporation.
;   0019  1	!
;   0020  1	! Digital assumes no responsibility for the use or  reliability  of  its
;   0021  1	! software on equipment which is not supplied by Digital.
;   0022  1	
;   0023  1	
;   0024  1	!++
;   0025  1	! FACILITY:
;   0026  1	!
;   0027  1	!	SNA Gateway Access Module
;   0028  1	!
;   0029  1	! ABSTRACT:
;   0030  1	!
;   0031  1	!	The following Macro calls are supported by this module:
;   0032  1	!
;   0033  1	!	Call		Function
;   0034  1	!	____		________
;   0035  1	!
;   0036  1	!       A_ACC           Accept a BIND
;   0037  1	!       A_CON           Connect to an IBM application
;   0038  1	!       A_LIS           Listen for an IBM BIND
;   0039  1	!       A_RDE           Read Event Data
;   0040  1	!       A_RBD           Read BIND Data
;   0041  1	!       A_RAD           Read Abort Data
;   0042  1	!       A_REC           Recieve a data message
;   0043  1	!       A_REM           Recieve expedited message
;   0044  1	!       A_RCN           Reconnect after a UNBIND type 2
;   0045  1	!       A_REJ           Reject a connect
;   0046  1	!       A_TER           Terminate port access
;   0047  1	!       A_TRA           Transmit to an IBM application
;   0048  1	!
;   0049  1	! ENVIRONMENT:
;   0050  1	!
;   0051  1	!	TOPS-20 Operating Systems, user interface.
;   0052  1	!
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   2
Version 1.0							13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (1)

;   0053  1	! AUTHOR:	Vicki Gary     March 17, 1984
;   0054  1	!
;   0055  1	! MODIFIED BY:
;   0056  1	!
;   0057  1	! 	, : VERSION
;   0058  1	! 01	-
;   0059  1	!--
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   3
Version 1.0							13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (2)

;   0060  1	!
;   0061  1	! TABLE OF CONTENTS
;   0062  1	!
;   0063  1	
;   0064  1	!
;   0065  1	! INCLUDE FILES
;   0066  1	!
;   0067  1	
;   0068  1	library 'MONSYM';                       ! Monitor symbols
;   0069  1	library 'SNACOM';                       ! SNA Gateway Access common symbols
;   0070  1	require 'JSYS';                         ! JSYS declarations
;   0411  1	
;   0412  1	!
;   0413  1	! MACROS
;   0414  1	!
;   0415  1	
; M 0416  1	macro PORT_STATE (STATE) [ ] =
; M 0417  1	    begin
; M 0418  1	    selectone STATE of
; M 0419  1	        set
; M 0420  1	        [%remaining]: $TRUE;
; M 0421  1	        [otherwise]: $FALSE;
; M 0422  1	        tes
;   0423  1	    end %;
;   0424  1	
;   0425  1	!
;   0426  1	! FORWARD ROUTINE
;   0427  1	!
;   0428  1	
;   0429  1	forward routine
;   0430  1	    GAM$VERIFY_PORT,
;   0431  1	    GAM$SERVICE_PORT,
;   0432  1	    GAM$PORT_STATE,
;   0433  1	    GAM$ASCIZ: novalue,
;   0434  1	    GAM$ASCIC: novalue;
;   0435  1	
;   0436  1	!
;   0437  1	! EXTERNAL REFERENCES
;   0438  1	!
;   0439  1	
;   0440  1	external                                ! SNA Virtual Circuit Data Blocks
;   0441  1	    SNAVCB: PORT_CONTROL_BLOCKS,
;   0442  1	    SNAEIB: RING_BLOCK_VECTOR,
;   0443  1	    SNAEOB: RING_BLOCK_VECTOR,
;   0444  1	    SNAIOB: IO_BUFFER_BLOCKS;
;   0445  1	
;   0446  1	external                                ! Free virtual circuit ports and index
;   0447  1	    FREECI,
;   0448  1	    FREECP: STACK (MAXIMUM_SUPPORTED_PORTS*2);
;   0449  1	
;   0450  1	external routine                        ! DECnet specific functions
;   0451  1	    GAD$ABORT_LINK,
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   4
Version 1.0	JSYS Declarations				13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (2)

;   0452  1	    GAD$ABORT_REASON,
;   0453  1	    GAD$DISCONNECT_LINK,
;   0454  1	    GAD$LINK_STATUS,
;   0455  1	    GAD$NETWORK_DESCRIPTOR,
;   0456  1	    GAD$OPEN_LINK,
;   0457  1	    GAD$OPEN_SERVER,
;   0458  1	    GAD$PROTOCOL_TYPE,
;   0459  1	    GAD$PSI_CHANNELS,
;   0460  1	    GAD$RECEIVE_DATA,
;   0461  1	    GAD$RECEIVE_INTERRUPT,
;   0462  1	    GAD$SEND_DATA,
;   0463  1	    GAD$SEND_INTERRUPT,
;   0464  1	    GAD$EC_SEND_DATA;
;   0465  1	
;   0466  1	external routine                        ! DECnet logical link function
;   0467  1	    GAL$TERMINATE,
;   0468  1	    GAL$INTERRUPT,
;   0469  1	    GAL$REJECT,
;   0470  1	    GAL$LINK_SERVICE: novalue;
;   0471  1	
;   0472  1	external routine                        ! Protocol building routines
;   0473  1	    GAP$O_ACCEPT,
;   0474  1	    GAP$O_CALL,
;   0475  1	    GAP$O_RECONNECT,
;   0476  1	    GAP$O_LISTEN,
;   0477  1	    GAP$O_FLUSH,
;   0478  1	    GAP$O_DATA;
;   0479  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   5
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

;   0480  1	%global_routine ('A_ACC', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   0481  1	
;   0482  1	!++
;   0483  1	! FUNCTIONAL DESCRIPTION:
;   0484  1	!
;   0485  1	!       A%ACC           Accept Incoming BIND
;   0486  1	!
;   0487  1	! FORMAL PARAMETERS:
;   0488  1	!
;   0489  1	!	ARGBLK          Argument block address of the port in AC1.
;   0490  1	!
;   0491  1	! IMPLICIT INPUTS:
;   0492  1	!
;   0493  1	!	none
;   0494  1	!
;   0495  1	! IMPLICIT OUTPUTS:
;   0496  1	!
;   0497  1	!	none
;   0498  1	!
;   0499  1	! COMPLETION CODES:
;   0500  1	!
;   0501  1	!	none
;   0502  1	!
;   0503  1	! SIDE EFFECTS:
;   0504  1	!
;   0505  1	!	none
;   0506  1	!
;   0507  1	!--
;   0508  1	
;   0509  2	    begin
;   0510  2	
;   0511  2	    local
;   0512  2		LENGTH,
;   0513  2	        RCODE,
;   0514  2	        PORT: ref PORT_CONTROL_BLOCK,
;   0515  2	        DATA_BASE: ref USER_DATA_BASE;
;   0516  2	
;   0517  2	    ! Verify for legal port number and port data base
;   0518  2	
;   0519  2	    if (PORT = GAM$VERIFY_PORT (.ARGBLK[ACC_PORT_NUMBER], AF_ACC)) neq 0
;   0520  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base
;   0521  3	    else begin                          ! Failed to locate port control block
;   0522  3	         ARGBLK[ACC_RETURN_CODE] = AC_BPN;
;   0523  3	         return;
;   0524  2	         end;
;   0525  2	
;   0526  2	    ARGBLK[ACC_RETURN_CODE] = 0;        ! Initialize return code
;   0527  2	
;   0528  2	    ! Build protocol message
;   0529  2	
;   0530  2	    GAP$O_ACCEPT (.ARGBLK, .PORT[PCB_OUTPUT_BUFFER], LENGTH);
;   0531  2	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   6
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

;   0532  2	    ! Send protocol message to the Gateway node
;   0533  2	
;   0534  2	    if not GAD$SEND_DATA (.PORT[PCB_JFN], ch$ptr (.PORT[PCB_OUTPUT_BUFFER],,8), .LENGTH) 
;   0535  3	    then begin
;   0536  3	           ARGBLK[ACC_RETURN_CODE] = .ARGBLK[ACC_RETURN_CODE] or AC_SER;
;   0537  3	           return;
;   0538  2	         end;
;   0539  2	
;   0540  2	    PORT[PCB_STATE] = AS_RUN;      ! Update port state
;   0541  2	    ARGBLK[ACC_RETURN_CODE] = AC_SUC;
;   0542  2	
;   0543  2	    GAP$O_FLUSH (.PORT[PCB_OUTPUT_BUFFER]);
;   0544  2	
;   0545  2	    while .DATA_BASE[UDB_FLUSH_SEND] gtr 0 do
;   0546  3	         begin
;   0547  3	           local PTR;
;   0548  3	
;   0549  3	         DATA_BASE[UDB_FLUSH_SEND] = .DATA_BASE[UDB_FLUSH_SEND] - 1;
;   0550  3	         
;   0551  3	         ! Send flush messages to the Gateway node
;   0552  3	         
;   0553  3	         PTR = ch$ptr (.PORT[PCB_OUTPUT_BUFFER],,8);
;   0554  3	
;   0555  3	         if not GAD$SEND_DATA (.PORT[PCB_JFN], .PTR, 2) 
;   0556  4	            then begin
;   0557  4	                 ARGBLK[ACC_RETURN_CODE] = .ARGBLK[ACC_RETURN_CODE] or AC_SER;
;   0558  3	                 end;
;   0559  3	
;   0560  2	         end;
;   0561  2	
;   0562  2	    return;
;   0563  1	    end;                                ! End of A_ACC


	TITLE	SAIMAC
	TWOSEG


	.REQUEST  SYS:B362LB.REL


	EXTERN	SNAVCB, SNAEIB, SNAEOB, SNAIOB, FREECI, FREECP, GADABT, GADRSN, GADDIS, GADSTA, GADNET
	EXTERN	GADOPN, GADSRV, GADTYP, GADPSI, GADRCV, GADRCI, GADSEN, GADSNI, GADSEC, GALTER, GALINT
	EXTERN	GALREJ, GALSRV, GPOACP, GPOCAL, GPORCN, GPOLIS, GPOFLB, GPODAT


JSYS_ACCES==	    552				;						000000	000552
JSYS_ADBRK==	    570				;						000000	000570
JSYS_AIC==	    131				;						000000	000131
JSYS_ALLOC==	    520				;						000000	000520
JSYS_ARCF==	    247				;						000000	000247
JSYS_ASND==	    70				;						000000	000070
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   7
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

JSYS_ASNSQ==	    752				;						000000	000752
JSYS_ATACH==	    116				;						000000	000116
JSYS_ATI==	    137				;						000000	000137
JSYS_ATNVT==	    274				;						000000	000274
JSYS_BIN==	    50				;						000000	000050
JSYS_BKJFN==	    42				;						000000	000042
JSYS_BOOT==	    562				;						000000	000562
JSYS_BOUT==	    51				;						000000	000051
JSYS_CACCT==	    4				;						000000	000004
JSYS_CFIBF==	    100				;						000000	000100
JSYS_CFOBF==	    101				;						000000	000101
JSYS_CFORK==	    152				;						000000	000152
JSYS_CHFDB==	    64				;						000000	000064
JSYS_CHKAC==	    521				;						000000	000521
JSYS_CIS==	    141				;						000000	000141
JSYS_CLOSF==	    22				;						000000	000022
JSYS_CLZFF==	    34				;						000000	000034
JSYS_COMND==	    544				;						000000	000544
JSYS_CRDIR==	    240				;						000000	000240
JSYS_CRJOB==	    2				;						000000	000002
JSYS_CRLNM==	    502				;						000000	000502
JSYS_CVHST==	    276				;						000000	000276
JSYS_CVSKT==	    275				;						000000	000275
JSYS_DEBRK==	    136				;						000000	000136
JSYS_DELDF==	    67				;						000000	000067
JSYS_DELF==	    26				;						000000	000026
JSYS_DELNF==	    317				;						000000	000317
JSYS_DEQ==	    514				;						000000	000514
JSYS_DEVST==	    121				;						000000	000121
JSYS_DFIN==	    234				;						000000	000234
JSYS_DFOUT==	    235				;						000000	000235
JSYS_DIAG==	    530				;						000000	000530
JSYS_DIBE==	    212				;						000000	000212
JSYS_DIC==	    133				;						000000	000133
JSYS_DIR==	    130				;						000000	000130
JSYS_DIRST==	    41				;						000000	000041
JSYS_DISMS==	    167				;						000000	000167
JSYS_DOBE==	    104				;						000000	000104
JSYS_DSKAS==	    244				;						000000	000244
JSYS_DSKOP==	    242				;						000000	000242
JSYS_DTACH==	    115				;						000000	000115
JSYS_DTI==	    140				;						000000	000140
JSYS_DUMPI==	    65				;						000000	000065
JSYS_DUMPO==	    66				;						000000	000066
JSYS_DVCHR==	    117				;						000000	000117
JSYS_EIR==	    126				;						000000	000126
JSYS_ENQ==	    513				;						000000	000513
JSYS_ENQC==	    515				;						000000	000515
JSYS_EPCAP==	    151				;						000000	000151
JSYS_ERSTR==	    11				;						000000	000011
JSYS_ESOUT==	    313				;						000000	000313
JSYS_FFFFP==	    31				;						000000	000031
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   8
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

JSYS_FFORK==	    154				;						000000	000154
JSYS_FFUFP==	    211				;						000000	000211
JSYS_FLHST==	    277				;						000000	000277
JSYS_FLIN==	    232				;						000000	000232
JSYS_FLOUT==	    233				;						000000	000233
JSYS_GACCT==	    546				;						000000	000546
JSYS_GACTF==	    37				;						000000	000037
JSYS_GCVEC==	    300				;						000000	000300
JSYS_GDSKC==	    214				;						000000	000214
JSYS_GDSTS==	    145				;						000000	000145
JSYS_GDVEC==	    542				;						000000	000542
JSYS_GET==	    200				;						000000	000200
JSYS_GETAB==	    10				;						000000	000010
JSYS_GETER==	    12				;						000000	000012
JSYS_GETJI==	    507				;						000000	000507
JSYS_GETNM==	    177				;						000000	000177
JSYS_GETOK_==	    574				;						000000	000574
JSYS_GEVEC==	    205				;						000000	000205
JSYS_GFRKH==	    164				;						000000	000164
JSYS_GFRKS==	    166				;						000000	000166
JSYS_GFUST==	    550				;						000000	000550
JSYS_GIVOK_==	    576				;						000000	000576
JSYS_GJINF==	    13				;						000000	000013
JSYS_GNJFN==	    17				;						000000	000017
JSYS_GPJFN==	    206				;						000000	000206
JSYS_GTAD==	    227				;						000000	000227
JSYS_GTDAL==	    305				;						000000	000305
JSYS_GTDIR==	    241				;						000000	000241
JSYS_GTFDB==	    63				;						000000	000063
JSYS_GTHST==	    273				;						000000	000273
JSYS_GTJFN==	    20				;						000000	000020
JSYS_GTRPI==	    172				;						000000	000172
JSYS_GTNCP==	    272				;						000000	000272
JSYS_GTRPW==	    171				;						000000	000171
JSYS_GTSTS==	    24				;						000000	000024
JSYS_GTTYP==	    303				;						000000	000303
JSYS_HALTF==	    170				;						000000	000170
JSYS_HFORK==	    162				;						000000	000162
JSYS_HPTIM==	    501				;						000000	000501
JSYS_HSYS==	    307				;						000000	000307
JSYS_IDCNV==	    223				;						000000	000223
JSYS_IDTIM==	    221				;						000000	000221
JSYS_IDTNC==	    231				;						000000	000231
JSYS_IIC==	    132				;						000000	000132
JSYS_INLNM==	    503				;						000000	000503
JSYS_JFNS==	    30				;						000000	000030
JSYS_KFORK==	    153				;						000000	000153
JSYS_LGOUT==	    3				;						000000	000003
JSYS_LNMST==	    504				;						000000	000504
JSYS_LOGIN==	    1				;						000000	000001
JSYS_LPINI==	    547				;						000000	000547
JSYS_MDDT_==	    777				;						000000	000777
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page   9
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

JSYS_METER_==	    766				;						000000	000766
JSYS_MRECV==	    511				;						000000	000511
JSYS_MSEND==	    510				;						000000	000510
JSYS_MSFRK==	    312				;						000000	000312
JSYS_MSTR==	    555				;						000000	000555
JSYS_MTALN==	    774				;						000000	000774
JSYS_MTOPR==	    77				;						000000	000077
JSYS_MTU_==	    600				;						000000	000600
JSYS_MUTIL==	    512				;						000000	000512
JSYS_NIN==	    225				;						000000	000225
JSYS_NODE==	    567				;						000000	000567
JSYS_NOUT==	    224				;						000000	000224
JSYS_ODCNV==	    222				;						000000	000222
JSYS_ODTIM==	    220				;						000000	000220
JSYS_ODTNC==	    230				;						000000	000230
JSYS_OPENF==	    21				;						000000	000021
JSYS_PBIN==	    73				;						000000	000073
JSYS_PBOUT==	    74				;						000000	000074
JSYS_PEEK==	    311				;						000000	000311
JSYS_PLOCK==	    561				;						000000	000561
JSYS_PMAP==	    56				;						000000	000056
JSYS_PMCTL==	    560				;						000000	000560
JSYS_PPNST==	    557				;						000000	000557
JSYS_PRARG==	    545				;						000000	000545
JSYS_PSOUT==	    76				;						000000	000076
JSYS_RCDIR==	    553				;						000000	000553
JSYS_RCM==	    134				;						000000	000134
JSYS_RCUSR==	    554				;						000000	000554
JSYS_RCVIM==	    751				;						000000	000751
JSYS_RCVOK_==	    575				;						000000	000575
JSYS_RDTTY==	    523				;						000000	000523
JSYS_RELD==	    71				;						000000	000071
JSYS_RELSQ==	    753				;						000000	000753
JSYS_RESET==	    147				;						000000	000147
JSYS_RFACS==	    161				;						000000	000161
JSYS_RFBSZ==	    45				;						000000	000045
JSYS_RFCOC==	    112				;						000000	000112
JSYS_RFMOD==	    107				;						000000	000107
JSYS_RFORK==	    155				;						000000	000155
JSYS_RFPOS==	    111				;						000000	000111
JSYS_RFPTR==	    43				;						000000	000043
JSYS_RFRKH==	    165				;						000000	000165
JSYS_RFSTS==	    156				;						000000	000156
JSYS_RFTAD==	    533				;						000000	000533
JSYS_RIN==	    54				;						000000	000054
JSYS_RIR==	    144				;						000000	000144
JSYS_RIRCM==	    143				;						000000	000143
JSYS_RLJFN==	    23				;						000000	000023
JSYS_RMAP==	    61				;						000000	000061
JSYS_RNAMF==	    35				;						000000	000035
JSYS_ROUT==	    55				;						000000	000055
JSYS_RPACS==	    57				;						000000	000057
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  10
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

JSYS_RPCAP==	    150				;						000000	000150
JSYS_RSCAN==	    500				;						000000	000500
JSYS_RTFRK==	    322				;						000000	000322
JSYS_RTIW==	    173				;						000000	000173
JSYS_RUNTM==	    15				;						000000	000015
JSYS_RWM==	    135				;						000000	000135
JSYS_RWSET==	    176				;						000000	000176
JSYS_SACTF==	    62				;						000000	000062
JSYS_SAVE==	    202				;						000000	000202
JSYS_SCTTY==	    324				;						000000	000324
JSYS_SCVEC==	    301				;						000000	000301
JSYS_SDSTS==	    146				;						000000	000146
JSYS_SDVEC==	    543				;						000000	000543
JSYS_SETER==	    336				;						000000	000336
JSYS_SETJB==	    541				;						000000	000541
JSYS_SETNM==	    210				;						000000	000210
JSYS_SETSN==	    506				;						000000	000506
JSYS_SEVEC==	    204				;						000000	000204
JSYS_SFACS==	    160				;						000000	000160
JSYS_SFBSZ==	    46				;						000000	000046
JSYS_SFCOC==	    113				;						000000	000113
JSYS_SFMOD==	    110				;						000000	000110
JSYS_SFORK==	    157				;						000000	000157
JSYS_SFPOS==	    526				;						000000	000526
JSYS_SFPTR==	    27				;						000000	000027
JSYS_SFRKV==	    201				;						000000	000201
JSYS_SFTAD==	    534				;						000000	000534
JSYS_SFUST==	    551				;						000000	000551
JSYS_SIBE==	    102				;						000000	000102
JSYS_SIN==	    52				;						000000	000052
JSYS_SINR==	    531				;						000000	000531
JSYS_SIR==	    125				;						000000	000125
JSYS_SIRCM==	    142				;						000000	000142
JSYS_SIZEF==	    36				;						000000	000036
JSYS_SJPRI==	    245				;						000000	000245
JSYS_SKED_==	    577				;						000000	000577
JSYS_SKPIR==	    127				;						000000	000127
JSYS_SMAP_==	    767				;						000000	000767
JSYS_SMON==	    6				;						000000	000006
JSYS_SNDIM==	    750				;						000000	000750
JSYS_SNOOP==	    516				;						000000	000516
JSYS_SOBE==	    103				;						000000	000103
JSYS_SOBF==	    175				;						000000	000175
JSYS_SOUT==	    53				;						000000	000053
JSYS_SOUTR==	    532				;						000000	000532
JSYS_SPACS==	    60				;						000000	000060
JSYS_SPJFN==	    207				;						000000	000207
JSYS_SPLFK==	    314				;						000000	000314
JSYS_SPOOL==	    517				;						000000	000517
JSYS_SPRIW==	    243				;						000000	000243
JSYS_SSAVE==	    203				;						000000	000203
JSYS_STAD==	    226				;						000000	000226
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  11
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

JSYS_STCMP==	    540				;						000000	000540
JSYS_STDEV==	    120				;						000000	000120
JSYS_STI==	    114				;						000000	000114
JSYS_STIW==	    174				;						000000	000174
JSYS_STO==	    246				;						000000	000246
JSYS_STPAR==	    217				;						000000	000217
JSYS_STPPN==	    556				;						000000	000556
JSYS_STSTS==	    25				;						000000	000025
JSYS_STTYP==	    302				;						000000	000302
JSYS_SWJFN==	    47				;						000000	000047
JSYS_SWTRP_==	    573				;						000000	000573
JSYS_SYERR==	    527				;						000000	000527
JSYS_SYSGT==	    16				;						000000	000016
JSYS_TBADD==	    536				;						000000	000536
JSYS_TBDEL==	    535				;						000000	000535
JSYS_TBLUK==	    537				;						000000	000537
JSYS_TEXTI==	    524				;						000000	000524
JSYS_TFORK==	    321				;						000000	000321
JSYS_THIBR==	    770				;						000000	000770
JSYS_TIME==	    14				;						000000	000014
JSYS_TIMER==	    522				;						000000	000522
JSYS_TLINK==	    216				;						000000	000216
JSYS_TMON==	    7				;						000000	000007
JSYS_TTMSG==	    775				;						000000	000775
JSYS_TWAKE==	    771				;						000000	000771
JSYS_UFPGS==	    525				;						000000	000525
JSYS_USAGE==	    564				;						000000	000564
JSYS_USRIO==	    310				;						000000	000310
JSYS_UTEST==	    563				;						000000	000563
JSYS_UTFRK==	    323				;						000000	000323
JSYS_VACCT==	    566				;						000000	000566
JSYS_WAIT==	    306				;						000000	000306
JSYS_WFORK==	    163				;						000000	000163
JSYS_WILD_==	    565				;						000000	000565
JSYS_XRIR_==	    601				;						000000	000601
JSYS_XSIR_==	    602				;						000000	000602


AC0=	0
AC1=	1
AC2=	2
AC3=	3
AC4=	4
AC5=	5
AC6=	6
AC7=	7
AC10=	10
AC11=	11
AC12=	12
AC13=	13
AC14=	14
FP=	15
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  12
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

AC16=	16
SP=	17


	RELOC	400000				;					400000'
A_ACC:: PUSH	SP,AC1				; SP,AC1				400000' 261 17 0 00 000001		0480
	PUSH	SP,AC2				; SP,AC2				400001' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				400002' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				400003' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				400004' 261 17 0 00 000005
	PUSH	SP,AC12				; SP,AC12				400005' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				400006' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				400007' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				400010' 261 17 0 00 000016
	ADJSP	SP,1				; SP,1					400011' 105 17 0 00 000001
	MOVE	AC16,AC1			; ARGBLK,AC1				400012' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				400013' 261 17 0 16 000000		0519
	PUSH	SP,C.4				; SP,[1]				400014' 261 17 0 00 400123'
	PUSHJ	SP,GAMVFY			; SP,GAMVFY				400015' 260 17 0 00 000000V
	MOVE	AC13,AC1			; PORT,AC1				400016' 200 13 0 00 000001
	ADJSP	SP,-2				; SP,-2					400017' 105 17 0 00 777776
	JUMPE	AC13,L.1			; PORT,L.1				400020' 322 13 0 00 400023'
	HLRZ	AC12,2(AC13)			; DATA_BASE,2(PORT)			400021' 554 12 0 13 000002		0520
	JRST	L.2				; L.2					400022' 254 00 0 00 400026'		0519
L.1:	MOVEI	AC1,1000			; AC1,1000				400023' 201 01 0 00 001000		0522
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				400024' 202 01 0 16 000001
	JRST	L.6				; L.6					400025' 254 00 0 00 400105'		0521
L.2:	SETZM	1(AC16)				; 1(ARGBLK)				400026' 402 00 0 16 000001		0526
	PUSH	SP,AC16				; SP,ARGBLK				400027' 261 17 0 00 000016		0530
	HLRZ	AC14,3(AC13)			; AC14,3(PORT)				400030' 554 14 0 13 000003
	PUSH	SP,AC14				; SP,AC14				400031' 261 17 0 00 000014
	MOVEI	AC1,-2(SP)			; AC1,LENGTH				400032' 201 01 0 17 777776
	PUSH	SP,AC1				; SP,AC1				400033' 261 17 0 00 000001
	PUSHJ	SP,GPOACP			; SP,GPOACP				400034' 260 17 0 00 000000*
	LDB	AC1,C.1				; AC1,[POINT 9,0(PORT),35]  <0,9>	400035' 135 01 0 00 400120'		0534
	PUSH	SP,AC1				; SP,AC1				400036' 261 17 0 00 000001
	MOVEI	AC1,-1(AC14)			; AC1,-1(AC14)				400037' 201 01 0 14 777777
	HRLI	AC1,41000			; AC1,41000				400040' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				400041' 261 17 0 00 000001
	PUSH	SP,-5(SP)			; SP,LENGTH				400042' 261 17 0 17 777773
	PUSHJ	SP,GADSEN			; SP,GADSEN				400043' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					400044' 105 17 0 00 777775
	TRNE	AC1,1				; AC1,1					400045' 602 01 0 00 000001
	JRST	L.3				; L.3					400046' 254 00 0 00 400053'
	MOVEI	AC1,20000			; AC1,20000				400047' 201 01 0 00 020000		0536
	IORM	AC1,1(AC16)			; AC1,1(ARGBLK)				400050' 436 01 0 16 000001
	ADJSP	SP,-3				; SP,-3					400051' 105 17 0 00 777775		0537
	JRST	L.6				; L.6					400052' 254 00 0 00 400105'		0535
L.3:	MOVEI	AC1,4				; AC1,4					400053' 201 01 0 00 000004		0540
	DPB	AC1,C.2				; AC1,[POINT 9,0(PORT),26]  <9,9>	400054' 137 01 0 00 400121'
	SETZM	1(AC16)				; 1(ARGBLK)				400055' 402 00 0 16 000001		0541
	HLRZ	AC14,3(AC13)			; AC14,3(PORT)				400056' 554 14 0 13 000003		0543
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  13
Version 1.0	A_ACC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (3)

	PUSH	SP,AC14				; SP,AC14				400057' 261 17 0 00 000014
	PUSHJ	SP,GPOFLB			; SP,GPOFLB				400060' 260 17 0 00 000000*
	JRST	L.5				; L.5					400061' 254 00 0 00 400100'		0545
L.4:	SUBI	AC1,1				; AC1,1					400062' 275 01 0 00 000001		0549
	DPB	AC1,C.3				; AC1,[POINT 18,0(DATA_BASE),26]  <9,18>400063' 137 01 0 00 400122'
	MOVEI	AC1,-1(AC14)			; AC1,-1(AC14)				400064' 201 01 0 14 777777		0553
	HRLI	AC1,41000			; AC1,41000				400065' 505 01 0 00 041000
	LDB	AC2,C.1				; AC2,[POINT 9,0(PORT),35]  <0,9>	400066' 135 02 0 00 400120'		0555
	PUSH	SP,AC2				; SP,AC2				400067' 261 17 0 00 000002
	PUSH	SP,AC1				; SP,PTR				400070' 261 17 0 00 000001
	PUSH	SP,C.5				; SP,[2]				400071' 261 17 0 00 400124'
	PUSHJ	SP,GADSEN			; SP,GADSEN				400072' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					400073' 105 17 0 00 777775
	TRNE	AC1,1				; AC1,1					400074' 602 01 0 00 000001
	JRST	L.5				; L.5					400075' 254 00 0 00 400100'
	MOVEI	AC1,20000			; AC1,20000				400076' 201 01 0 00 020000		0557
	IORM	AC1,1(AC16)			; AC1,1(ARGBLK)				400077' 436 01 0 16 000001
L.5:	LDB	AC1,C.3				; AC1,[POINT 18,0(DATA_BASE),26]  <9,18>400100' 135 01 0 00 400122'		0545
	TRC	AC1,400000			; AC1,400000				400101' 640 01 0 00 400000
	SUBI	AC1,400000			; AC1,400000				400102' 275 01 0 00 400000
	JUMPG	AC1,L.4				; AC1,L.4				400103' 327 01 0 00 400062'
	ADJSP	SP,-4				; SP,-4					400104' 105 17 0 00 777774		0562
L.6:	ADJSP	SP,-1				; SP,-1					400105' 105 17 0 00 777777		0480
	POP	SP,AC16				; SP,AC16				400106' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				400107' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				400110' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				400111' 262 17 0 00 000012
	POP	SP,AC5				; SP,AC5				400112' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				400113' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				400114' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				400115' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				400116' 262 17 0 00 000001
	POPJ	SP,				; SP,					400117' 263 17 0 00 000000
C.1:	POINT	9,0(AC13),35			; 9,0(PORT),35				400120' 00 11 0 13 000000
C.2:	POINT	9,0(AC13),26			; 9,0(PORT),26				400121' 11 11 0 13 000000
C.3:	POINT	18,0(AC12),26			; 18,0(DATA_BASE),26			400122' 11 22 0 12 000000
C.4:	EXP	1				; 1					400123' 000000	000001
C.5:	EXP	2				; 2					400124' 000000	000002

; Routine Size:  85 words


;   0564  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  14
Version 1.0	A_REJ						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (4)

;   0565  1	%global_routine ('A_REJ', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   0566  1	
;   0567  1	!++
;   0568  1	! FUNCTIONAL DESCRIPTION:
;   0569  1	!
;   0570  1	!       A%REJ           REJECT the BIND request
;   0571  1	!
;   0572  1	! FORMAL PARAMETERS:
;   0573  1	!
;   0574  1	!	ARGBLK          Argument block address of the port in AC1.
;   0575  1	!
;   0576  1	! IMPLICIT INPUTS:
;   0577  1	!
;   0578  1	!	none
;   0579  1	!
;   0580  1	! IMPLICIT OUTPUTS:
;   0581  1	!
;   0582  1	!	none
;   0583  1	!
;   0584  1	! COMPLETION CODES:
;   0585  1	!
;   0586  1	!	none
;   0587  1	!
;   0588  1	! SIDE EFFECTS:
;   0589  1	!
;   0590  1	!	none
;   0591  1	!
;   0592  1	!--
;   0593  1	
;   0594  2	    begin
;   0595  2	
;   0596  2	    local
;   0597  2		PTR,
;   0598  2		LENGTH,
;   0599  2		PORT: ref PORT_CONTROL_BLOCK,
;   0600  2	        DATA_BASE: ref USER_DATA_BASE;
;   0601  2	
;   0602  2	    ! Verify for legal port number and port data base
;   0603  2	
;   0604  2	    if (PORT = GAM$VERIFY_PORT (.ARGBLK[REJ_PORT_NUMBER], AF_REJ)) neq 0
;   0605  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   0606  3	    else begin                          ! Failed to get port control block
;   0607  3	         ARGBLK[REJ_RETURN_CODE] = AC_BPN;
;   0608  3	         return;
;   0609  2	         end;
;   0610  2	
;   0611  2	    ARGBLK[REJ_RETURN_CODE] = 0;        ! Initialize return code
;   0612  2	    PORT[PCB_STATE] = AS_ABG;
;   0613  2	
;   0614  2	    ! Assemble protocol message
;   0615  2	
;   0616  2	    GAL$REJECT (.PORT[PCB_JFN], .ARGBLK[REJ_SENSE_CODE], AR_URJ);
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  15
Version 1.0	A_REJ						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (4)

;   0617  2	
;   0618  2	    PORT[PCB_STATE] = AS_ABD;
;   0619  2	
;   0620  2	    ! Erase port data base
;   0621  2	
;   0622  2	    FREECI = .FREECI - 1;
;   0623  2	    FREECP[.FREECI] = .ARGBLK[REJ_PORT_NUMBER];
;   0624  2	
;   0625  2	    return;
;   0626  1	    end;                                ! End of A_REJ


A_REJ:: PUSH	SP,AC1				; SP,AC1				400125' 261 17 0 00 000001		0565
	PUSH	SP,AC2				; SP,AC2				400126' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				400127' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				400130' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				400131' 261 17 0 00 000005
	PUSH	SP,AC14				; SP,AC14				400132' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				400133' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				400134' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				400135' 261 17 0 16 000000		0604
	PUSH	SP,C.8				; SP,[5]				400136' 261 17 0 00 400200'
	PUSHJ	SP,GAMVFY			; SP,GAMVFY				400137' 260 17 0 00 000000V
	MOVE	AC14,AC1			; PORT,AC1				400140' 200 14 0 00 000001
	ADJSP	SP,-2				; SP,-2					400141' 105 17 0 00 777776
	JUMPE	AC14,L.7			; PORT,L.7				400142' 322 14 0 00 400145'
	HLRZ	AC1,2(AC14)			; DATA_BASE,2(PORT)			400143' 554 01 0 14 000002		0605
	JRST	L.8				; L.8					400144' 254 00 0 00 400150'		0604
L.7:	MOVEI	AC1,1000			; AC1,1000				400145' 201 01 0 00 001000		0607
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				400146' 202 01 0 16 000001
	JRST	L.9				; L.9					400147' 254 00 0 00 400166'		0606
L.8:	SETZM	1(AC16)				; 1(ARGBLK)				400150' 402 00 0 16 000001		0611
	MOVEI	AC1,6				; AC1,6					400151' 201 01 0 00 000006		0612
	DPB	AC1,C.6				; AC1,[POINT 9,0(PORT),26]  <9,9>	400152' 137 01 0 00 400176'
	LDB	AC1,C.7				; AC1,[POINT 9,0(PORT),35]  <0,9>	400153' 135 01 0 00 400177'		0616
	PUSH	SP,AC1				; SP,AC1				400154' 261 17 0 00 000001
	PUSH	SP,2(AC16)			; SP,2(ARGBLK)				400155' 261 17 0 16 000002
	PUSH	SP,C.9				; SP,[145]				400156' 261 17 0 00 400201'
	PUSHJ	SP,GALREJ			; SP,GALREJ				400157' 260 17 0 00 000000*
	MOVEI	AC1,7				; AC1,7					400160' 201 01 0 00 000007		0618
	DPB	AC1,C.6				; AC1,[POINT 9,0(PORT),26]  <9,9>	400161' 137 01 0 00 400176'
	SOS	AC1,FREECI			; AC1,FREECI				400162' 370 01 0 00 000000*		0623
	MOVE	AC2,0(AC16)			; AC2,0(ARGBLK)				400163' 200 02 0 16 000000
	MOVEM	AC2,FREECP(AC1)			; AC2,FREECP(AC1)			400164' 202 02 0 01 000000*
	ADJSP	SP,-3				; SP,-3					400165' 105 17 0 00 777775		0625
L.9:	POP	SP,AC16				; SP,AC16				400166' 262 17 0 00 000016		0565
	POP	SP,AC14				; SP,AC14				400167' 262 17 0 00 000014
	POP	SP,AC5				; SP,AC5				400170' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				400171' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				400172' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				400173' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				400174' 262 17 0 00 000001
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  16
Version 1.0	A_REJ						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (4)

	POPJ	SP,				; SP,					400175' 263 17 0 00 000000
C.6:	POINT	9,0(AC14),26			; 9,0(PORT),26				400176' 11 11 0 14 000000
C.7:	POINT	9,0(AC14),35			; 9,0(PORT),35				400177' 00 11 0 14 000000
C.8:	EXP	5				; 5					400200' 000000	000005
C.9:	EXP	145				; 145					400201' 000000	000145

; Routine Size:  45 words


;   0627  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  17
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

;   0628  1	%global_routine ('A_CON', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   0629  1	
;   0630  1	!++
;   0631  1	! FUNCTIONAL DESCRIPTION:
;   0632  1	!
;   0633  1	!       A%CON           Connect to an IBM application
;   0634  1	!
;   0635  1	! FORMAL PARAMETERS:
;   0636  1	!
;   0637  1	!	ARGBLK          Argument block address of the port in AC1.
;   0638  1	!
;   0639  1	! IMPLICIT INPUTS:
;   0640  1	!
;   0641  1	!	none
;   0642  1	!
;   0643  1	! IMPLICIT OUTPUTS:
;   0644  1	!
;   0645  1	!	none
;   0646  1	!
;   0647  1	! COMPLETION CODES:
;   0648  1	!
;   0649  1	!	none
;   0650  1	!
;   0651  1	! SIDE EFFECTS:
;   0652  1	!
;   0653  1	!	none
;   0654  1	!
;   0655  1	!--
;   0656  1	
;   0657  2	    begin
;   0658  2	
;   0659  2	    local
;   0660  2	
;   0661  2	        DESCRIPTOR: CH$SEQUENCE (80),
;   0662  2	        SNABUF: CH$SEQUENCE (280, 8);
;   0663  2	
;   0664  2	    local
;   0665  2	        JFN,
;   0666  2	        PTR,
;   0667  2	        POINTER,
;   0668  2	        STATUS,
;   0669  2	        SYSERR,
;   0670  2		LENGTH,
;   0671  2	        OBJECT,
;   0672  2		PORT: ref PORT_CONTROL_BLOCK,
;   0673  2	        DATA_BASE: ref USER_DATA_BASE;
;   0674  2	
;   0675  2	    if .FREECI geq MAXIMUM_SUPPORTED_PORTS
;   0676  3	    then begin                          ! Run out of ports to allocate
;   0677  3	         ARGBLK[CON_RETURN_CODE] = AC_IAR;
;   0678  3	         return;
;   0679  2	         end;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  18
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

;   0680  2	
;   0681  2	    DATA_BASE = .ARGBLK[WORKING_AREA];  ! Get port data base
;   0682  2	
;   0683  2	    ! Get the target task name
;   0684  2	
;   0685  2	    POINTER = ch$ptr (DESCRIPTOR);
;   0686  2	    OBJECT = ch$ptr (uplit ('-10'));
;   0687  2	
;   0688  2	    STATUS = GAD$NETWORK_DESCRIPTOR (.POINTER, .ARGBLK[CON_NODE_NAME], .OBJECT);   
;   0689  2	
;   0690  2	    if .STATUS neq $TRUE
;   0691  3	        then begin                         ! Failed to build the DCN: filespec
;   0692  4	             ARGBLK[CON_RETURN_CODE] = (selectone .STATUS of
;   0693  4	                                        set
;   0694  4	                                        [-1]: AC_NLN;
;   0695  4	                                        [otherwise]: AC_PER;
;   0696  3	                                        tes);
;   0697  3	                                        return;
;   0698  2	              end;
;   0699  2	
;   0700  2	    STATUS = GAD$OPEN_LINK (.POINTER, JFN, SYSERR); 
;   0701  2	
;   0702  2	    if .STATUS neq $TRUE
;   0703  3	    then begin                          ! Failed to connect to the Gateway
;   0704  4	         ARGBLK[CON_RETURN_CODE] = (selectone .STATUS of
;   0705  4	                                        set
;   0706  4	                                        [-1]: AC_DCE;
;   0707  4	                                        [-2]: AC_DLA;
;   0708  4	                                        [otherwise]: AC_PER;
;   0709  3	                                        tes);
;   0710  3	         ARGBLK[CON_NODE_NAME] = .SYSERR;
;   0711  3	         return;
;   0712  2	         end;
;   0713  2	
;   0714  2	    ! Assemble protocol message
;   0715  2	
;   0716  2	    GAP$O_CALL (.ARGBLK, SNABUF, LENGTH);
;   0717  2	
;   0718  2	    ! Return error if data truncated
;   0719  2	
;   0720  2	    if .(ARGBLK[CON_RETURN_CODE])<$(AC_DFT)> ! Data field truncated
;   0721  2	    then return;
;   0722  2	
;   0723  2	    ! Send OUTGOING CALL message to Gateway node
;   0724  2	
;   0725  2	    if not GAD$EC_SEND_DATA (.JFN, ch$ptr (SNABUF,,8), .LENGTH, SYSERR)
;   0726  3	    then begin
;   0727  3	         GAD$ABORT_LINK (.JFN);
;   0728  3	         ARGBLK[CON_RETURN_CODE] = .ARGBLK[CON_RETURN_CODE] or AC_DCE;
;   0729  3	         ARGBLK[CON_NODE_NAME] = .SYSERR;
;   0730  3	         end
;   0731  3	    else begin
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  19
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

;   0732  3	         local 	
;   0733  3			INTERRUPT_CHANNEL,
;   0734  3			PORT_NUMBER,
;   0735  3			LEN, 
;   0736  3	                RING0,
;   0737  3	                RING: ref RING_BLOCK,
;   0738  3	                ENTRY: ref RING_ENTRY,
;   0739  3			PTR;
;   0740  3	
;   0741  3		 INTERRUPT_CHANNEL = .ARGBLK[CON_INTERRUPT_CHANNEL];
;   0742  3		 ARGBLK[CON_PORT_NUMBER] = PORT_NUMBER = .FREECP[.FREECI];
;   0743  3	         FREECI = .FREECI + 1;          ! Push down on stack
;   0744  3	
;   0745  3	         PORT = SNAVCB[.PORT_NUMBER,PCB_BLOCK_FIELD]; ! Get control block
;   0746  3	         XERO (.PORT, PORT_CONTROL_BLOCK_SIZE);
;   0747  3	
;   0748  3	         PORT[PCB_JFN] = .JFN;          ! Save DECnet logical link JFN
;   0749  3	         PORT[PCB_STATE] = AS_BNW;      ! Set port state to BINDWAIT
;   0750  3	         PORT[PCB_ERROR] = 0;           ! No error
;   0751  3	         PORT[PCB_RCV_INTERRUPT] = $FALSE;
;   0752  3	         PORT[PCB_PACKET_SIZE] = 0;
;   0753  3	         PORT[PCB_RESET_SEEN] = 0;      ! No reset seen yet
;   0754  3	         PORT[PCB_INTCNT] = 0;
;   0755  3	         PORT[PCB_DATA_BASE] = .DATA_BASE; ! Save user data base address
;   0756  3	         PORT[PCB_INPUT_BUFFER] = SNAIOB[.PORT_NUMBER,IOB_INPUT_BUFFER];
;   0757  3	         PORT[PCB_OUTPUT_BUFFER] = SNAIOB[.PORT_NUMBER,IOB_OUTPUT_BUFFER];
;   0758  3	
;   0759  3	         RING = SNAEIB[.PORT_NUMBER];
;   0760  3	         XERO (.RING, RING_SIZE);
;   0761  3	
;   0762  3	         incr I from 0 to MAX_INTERRUPTS - 2 do
;   0763  4	              begin
;   0764  4	              ENTRY = RING[.I];
;   0765  4	              ENTRY[NEXT_RING_PTR] = RING[.I+1];
;   0766  4	              ENTRY = RING[.I+1];
;   0767  3	              end;
;   0768  3	
;   0769  3	         RING0 = ENTRY[NEXT_RING_PTR] = RING[0];
;   0770  3	
;   0771  3	         PORT[PCB_INHEAD_BUFFER] = .RING0;
;   0772  3	         PORT[PCB_INTAIL_BUFFER] = .RING0;
;   0773  3	
;   0774  3	
;   0775  3	         RING = SNAEOB[.PORT_NUMBER];
;   0776  3	         XERO (.RING, RING_SIZE);
;   0777  3	
;   0778  3	         incr I from 0 to MAX_INTERRUPTS - 2 do
;   0779  4	              begin
;   0780  4	              ENTRY = RING[.I];
;   0781  4	              ENTRY[NEXT_RING_PTR] = RING[.I+1];
;   0782  4	              ENTRY = RING[.I+1];
;   0783  3	              end;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  20
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

;   0784  3	
;   0785  3	         RING0 = ENTRY[NEXT_RING_PTR] = RING[0];
;   0786  3	
;   0787  3	         PORT[PCB_OUTHEAD_BUFFER] = .RING0;
;   0788  3	         PORT[PCB_OUTTAIL_BUFFER] = .RING0;
;   0789  3	
;   0790  3	         GAM$ASCIC (.ARGBLK[CON_USER_DATA_LENGTH], ! Save call data
;   0791  3	                    ch$ptr (.ARGBLK[CON_USER_DATA],,8),
;   0792  3	                    ch$ptr (DATA_BASE[UDB_USER_DATA],,8));
;   0793  3	
;   0794  3	
;   0795  3	         if GAD$PSI_CHANNELS (.JFN, .INTERRUPT_CHANNEL)
;   0796  3	         then ARGBLK[CON_RETURN_CODE] = AC_SUC
;   0797  4	         else begin                     ! Failed to set up PSI channel
;   0798  4	              GAD$ABORT_LINK (.JFN);
;   0799  4	              ARGBLK[CON_RETURN_CODE] = .ARGBLK[CON_RETURN_CODE] or AC_PER;
;   0800  4	              return;
;   0801  3	              end;
;   0802  3	
;   0803  3	
;   0804  3	         if .PORT[PCB_PACKET_SIZE] leq 0
;   0805  3	         then PORT[PCB_PACKET_SIZE] = 1 ^ AF_STANDARD_PACKET_SIZE;
;   0806  2	         end;
;   0807  2	
;   0808  2	    return;
;   0809  1	    end;                                ! End of A_CON


P.AAA:	BYTE	(7)"-","1","0",000,000		; -10					400202' 055 061 060 000 000


A_CON:: PUSH	SP,AC1				; SP,AC1				400203' 261 17 0 00 000001		0628
	PUSH	SP,AC2				; SP,AC2				400204' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				400205' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				400206' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				400207' 261 17 0 00 000005
	PUSH	SP,AC12				; SP,AC12				400210' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				400211' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				400212' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				400213' 261 17 0 00 000016
	ADJSP	SP,131				; SP,131				400214' 105 17 0 00 000131
	MOVE	AC14,AC1			; ARGBLK,AC1				400215' 200 14 0 00 000001
	MOVEI	AC1,24				; AC1,24				400216' 201 01 0 00 000024		0675
	CAMLE	AC1,FREECI			; AC1,FREECI				400217' 313 01 0 00 000000*
	JRST	L.10				; L.10					400220' 254 00 0 00 400224'
	MOVEI	AC1,2				; AC1,2					400221' 201 01 0 00 000002		0677
	MOVEM	AC1,1(AC14)			; AC1,1(ARGBLK)				400222' 202 01 0 14 000001
	JRST	L.26				; L.26					400223' 254 00 0 00 400514'		0676
L.10:	HRRZ	AC13,0(AC14)			; DATA_BASE,0(ARGBLK)			400224' 550 13 0 14 000000		0681
	MOVEI	AC16,-131(SP)			; AC16,DESCRIPTOR-1			400225' 201 16 0 17 777647		0685
	HRLI	AC16,10700			; AC16,10700				400226' 505 16 0 00 010700
	MOVE	AC1,C.12			; OBJECT,[POINT 7,P.AAA-1,34]  <1,7>	400227' 200 01 0 00 400531'		0686
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  21
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

	PUSH	SP,AC16				; SP,POINTER				400230' 261 17 0 00 000016		0688
	PUSH	SP,2(AC14)			; SP,2(ARGBLK)				400231' 261 17 0 14 000002
	PUSH	SP,AC1				; SP,OBJECT				400232' 261 17 0 00 000001
	PUSHJ	SP,GADNET			; SP,GADNET				400233' 260 17 0 00 000000*
	CAIN	AC1,1				; STATUS,1				400234' 306 01 0 00 000001		0690
	JRST	L.13				; L.13					400235' 254 00 0 00 400246'
	CAME	AC1,C.13			; STATUS,[-1]				400236' 312 01 0 00 400532'		0694
	JRST	L.11				; L.11					400237' 254 00 0 00 400242'
	MOVEI	AC2,20				; AC2,20				400240' 201 02 0 00 000020		0692
	JRST	L.12				; L.12					400241' 254 00 0 00 400243'
L.11:	MOVEI	AC2,4				; AC2,4					400242' 201 02 0 00 000004
L.12:	MOVEM	AC2,1(AC14)			; AC2,1(ARGBLK)				400243' 202 02 0 14 000001
	ADJSP	SP,-3				; SP,-3					400244' 105 17 0 00 777775		0697
	JRST	L.26				; L.26					400245' 254 00 0 00 400514'		0691
L.13:	MOVEM	AC16,0(SP)			; POINTER,0(SP)				400246' 202 16 0 17 000000		0700
	MOVEI	AC2,-3(SP)			; AC2,JFN				400247' 201 02 0 17 777775
	PUSH	SP,AC2				; SP,AC2				400250' 261 17 0 00 000002
	MOVEI	AC2,-6(SP)			; AC2,SYSERR				400251' 201 02 0 17 777772
	PUSH	SP,AC2				; SP,AC2				400252' 261 17 0 00 000002
	PUSHJ	SP,GADOPN			; SP,GADOPN				400253' 260 17 0 00 000000*
	CAIN	AC1,1				; STATUS,1				400254' 306 01 0 00 000001		0702
	JRST	L.17				; L.17					400255' 254 00 0 00 400274'
	CAME	AC1,C.13			; STATUS,[-1]				400256' 312 01 0 00 400532'		0706
	JRST	L.14				; L.14					400257' 254 00 0 00 400262'
	MOVEI	AC1,1				; AC1,1					400260' 201 01 0 00 000001		0704
	JRST	L.16				; L.16					400261' 254 00 0 00 400267'
L.14:	CAME	AC1,C.14			; STATUS,[-2]				400262' 312 01 0 00 400533'		0707
	JRST	L.15				; L.15					400263' 254 00 0 00 400266'
	MOVEI	AC1,400000			; AC1,400000				400264' 201 01 0 00 400000		0704
	JRST	L.16				; L.16					400265' 254 00 0 00 400267'
L.15:	MOVEI	AC1,4				; AC1,4					400266' 201 01 0 00 000004
L.16:	MOVEM	AC1,1(AC14)			; AC1,1(ARGBLK)				400267' 202 01 0 14 000001
	MOVE	AC1,-7(SP)			; AC1,SYSERR				400270' 200 01 0 17 777771		0710
	MOVEM	AC1,2(AC14)			; AC1,2(ARGBLK)				400271' 202 01 0 14 000002
	ADJSP	SP,-5				; SP,-5					400272' 105 17 0 00 777773		0711
	JRST	L.26				; L.26					400273' 254 00 0 00 400514'		0703
L.17:	MOVEM	AC14,0(SP)			; ARGBLK,0(SP)				400274' 202 14 0 17 000000		0716
	MOVEI	AC1,-115(SP)			; AC1,SNABUF				400275' 201 01 0 17 777663
	PUSH	SP,AC1				; SP,AC1				400276' 261 17 0 00 000001
	MOVEI	AC1,-7(SP)			; AC1,LENGTH				400277' 201 01 0 17 777771
	PUSH	SP,AC1				; SP,AC1				400300' 261 17 0 00 000001
	PUSHJ	SP,GPOCAL			; SP,GPOCAL				400301' 260 17 0 00 000000*
	MOVEI	AC1,200				; AC1,200				400302' 201 01 0 00 000200		0720
	TDNN	AC1,1(AC14)			; AC1,1(ARGBLK)				400303' 616 01 0 14 000001
	JRST	L.18				; L.18					400304' 254 00 0 00 400307'
	ADJSP	SP,-7				; SP,-7					400305' 105 17 0 00 777771		0628
	JRST	L.26				; L.26					400306' 254 00 0 00 400514'		0721
L.18:	PUSH	SP,-7(SP)			; SP,JFN				400307' 261 17 0 17 777771		0725
	MOVEI	AC1,-121(SP)			; AC1,SNABUF-1				400310' 201 01 0 17 777657
	HRLI	AC1,41000			; AC1,41000				400311' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				400312' 261 17 0 00 000001
	PUSH	SP,-12(SP)			; SP,LENGTH				400313' 261 17 0 17 777766
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  22
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

	MOVEI	AC1,-14(SP)			; AC1,SYSERR				400314' 201 01 0 17 777764
	PUSH	SP,AC1				; SP,AC1				400315' 261 17 0 00 000001
	PUSHJ	SP,GADSEC			; SP,GADSEC				400316' 260 17 0 00 000000*
	ADJSP	SP,-4				; SP,-4					400317' 105 17 0 00 777774
	TRNE	AC1,1				; AC1,1					400320' 602 01 0 00 000001
	JRST	L.19				; L.19					400321' 254 00 0 00 400331'
	PUSH	SP,-7(SP)			; SP,JFN				400322' 261 17 0 17 777771		0727
	PUSHJ	SP,GADABT			; SP,GADABT				400323' 260 17 0 00 000000*
	MOVEI	AC1,1				; AC1,1					400324' 201 01 0 00 000001		0728
	IORM	AC1,1(AC14)			; AC1,1(ARGBLK)				400325' 436 01 0 14 000001
	MOVE	AC1,-12(SP)			; AC1,SYSERR				400326' 200 01 0 17 777766		0729
	MOVEM	AC1,2(AC14)			; AC1,2(ARGBLK)				400327' 202 01 0 14 000002
	JRST	L.25				; L.25					400330' 254 00 0 00 400513'		0725
L.19:	HLRZ	AC12,0(AC14)			; INTERRUPT_CHANNEL,0(ARGBLK)		400331' 554 12 0 14 000000		0741
	MOVE	AC1,FREECI			; AC1,FREECI				400332' 200 01 0 00 000000*		0742
	MOVE	AC2,FREECP(AC1)			; PORT_NUMBER,FREECP(AC1)		400333' 200 02 0 01 000000*
	HRRM	AC2,0(AC14)			; PORT_NUMBER,0(ARGBLK)			400334' 542 02 0 14 000000
	AOS	FREECI				; FREECI				400335' 350 00 0 00 000000*		0743
	MOVE	AC1,AC2				; AC1,PORT_NUMBER			400336' 200 01 0 00 000002		0745
	IMULI	AC1,6				; AC1,6					400337' 221 01 0 00 000006
	MOVE	AC16,AC1			; PORT,AC1				400340' 200 16 0 00 000001
	ADDI	AC16,SNAVCB			; PORT,SNAVCB				400341' 271 16 0 00 000000*
	SETZM	0(AC16)				; 0(PORT)				400342' 402 00 0 16 000000		0746
	HRL	AC1,AC16			; AC,PORT				400343' 504 01 0 00 000016
	MOVEI	AC3,1(AC16)			; AC3,1(PORT)				400344' 201 03 0 16 000001
	HRR	AC1,AC3				; AC,AC3				400345' 540 01 0 00 000003
	BLT	AC1,5(AC16)			; AC,5(PORT)				400346' 251 01 0 16 000005
	MOVE	AC1,-7(SP)			; AC1,JFN				400347' 200 01 0 17 777771		0748
	DPB	AC1,C.10			; AC1,[POINT 9,0(PORT),35]  <0,9>	400350' 137 01 0 00 400527'
	MOVEI	AC1,1				; AC1,1					400351' 201 01 0 00 000001		0749
	DPB	AC1,C.11			; AC1,[POINT 9,0(PORT),26]  <9,9>	400352' 137 01 0 00 400530'
	HRRZS	1(AC16)				; 1(PORT)				400353' 553 00 0 16 000001		0750
	MOVSI	AC1,1				; AC1,1					400354' 205 01 0 00 000001		0751
	ANDCAM	AC1,0(AC16)			; AC1,0(PORT)				400355' 412 01 0 16 000000
	HLLZS	2(AC16)				; 2(PORT)				400356' 513 00 0 16 000002		0752
	MOVSI	AC1,-1000			; AC1,-1000				400357' 205 01 0 00 777000		0753
	ANDCAM	AC1,0(AC16)			; AC1,0(PORT)				400360' 412 01 0 16 000000
	HLLZS	1(AC16)				; 1(PORT)				400361' 513 00 0 16 000001		0754
	HRLM	AC13,2(AC16)			; DATA_BASE,2(PORT)			400362' 506 13 0 16 000002		0755
	MOVE	AC1,AC2				; AC1,PORT_NUMBER			400363' 200 01 0 00 000002		0756
	IMULI	AC1,3330			; AC1,3330				400364' 221 01 0 00 003330
	MOVEI	AC3,SNAIOB(AC1)			; AC3,SNAIOB(AC1)			400365' 201 03 0 01 000000*
	HRRM	AC3,3(AC16)			; AC3,3(PORT)				400366' 542 03 0 16 000003
	MOVEI	AC3,SNAIOB+1554(AC1)		; AC3,SNAIOB+1554(AC1)			400367' 201 03 0 01 001554*		0757
	HRLM	AC3,3(AC16)			; AC3,3(PORT)				400370' 506 03 0 16 000003
	MOVE	AC1,AC2				; AC1,PORT_NUMBER			400371' 200 01 0 00 000002		0759
	IMULI	AC1,43				; AC1,43				400372' 221 01 0 00 000043
	MOVE	AC4,AC1				; RING,AC1				400373' 200 04 0 00 000001
	ADDI	AC4,SNAEIB			; RING,SNAEIB				400374' 271 04 0 00 000000*
	SETZM	0(AC4)				; 0(RING)				400375' 402 00 0 04 000000		0760
	HRL	AC1,AC4				; AC,RING				400376' 504 01 0 00 000004
	MOVEI	AC3,1(AC4)			; AC3,1(RING)				400377' 201 03 0 04 000001
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  23
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

	HRR	AC1,AC3				; AC,AC3				400400' 540 01 0 00 000003
	BLT	AC1,42(AC4)			; AC,42(RING)				400401' 251 01 0 04 000042
	SETZ	AC1,				; I,					400402' 400 01 0 00 000000		0762
L.20:	MOVE	AC5,AC1				; AC5,I					400403' 200 05 0 00 000001		0764
	IMULI	AC5,7				; AC5,7					400404' 221 05 0 00 000007
	MOVE	AC3,AC5				; ENTRY,AC5				400405' 200 03 0 00 000005
	ADD	AC3,AC4				; ENTRY,RING				400406' 270 03 0 00 000004
	MOVE	AC5,AC1				; AC5,I					400407' 200 05 0 00 000001		0765
	IMULI	AC5,7				; AC5,7					400410' 221 05 0 00 000007
	ADD	AC5,AC4				; AC5,RING				400411' 270 05 0 00 000004
	ADDI	AC5,7				; AC5,7					400412' 271 05 0 00 000007
	MOVEM	AC5,6(AC3)			; AC5,6(ENTRY)				400413' 202 05 0 03 000006
	MOVE	AC3,AC5				; ENTRY,AC5				400414' 200 03 0 00 000005		0766
	ADDI	AC1,1				; I,1					400415' 271 01 0 00 000001		0762
	CAIG	AC1,3				; I,3					400416' 307 01 0 00 000003
	JRST	L.20				; L.20					400417' 254 00 0 00 400403'
	MOVEM	AC4,6(AC3)			; RING,6(ENTRY)				400420' 202 04 0 03 000006		0769
	MOVE	AC5,AC4				; RING0,RING				400421' 200 05 0 00 000004
	HRRM	AC5,4(AC16)			; RING0,4(PORT)				400422' 542 05 0 16 000004		0771
	HRRM	AC5,5(AC16)			; RING0,5(PORT)				400423' 542 05 0 16 000005		0772
	IMULI	AC2,43				; PORT_NUMBER,43			400424' 221 02 0 00 000043		0775
	MOVE	AC4,AC2				; RING,AC2				400425' 200 04 0 00 000002
	ADDI	AC4,SNAEOB			; RING,SNAEOB				400426' 271 04 0 00 000000*
	SETZM	0(AC4)				; 0(RING)				400427' 402 00 0 04 000000		0776
	HRL	AC1,AC4				; AC,RING				400430' 504 01 0 00 000004
	MOVEI	AC2,1(AC4)			; AC2,1(RING)				400431' 201 02 0 04 000001
	HRR	AC1,AC2				; AC,AC2				400432' 540 01 0 00 000002
	BLT	AC1,42(AC4)			; AC,42(RING)				400433' 251 01 0 04 000042
	SETZ	AC1,				; I,					400434' 400 01 0 00 000000		0778
L.21:	MOVE	AC2,AC1				; AC2,I					400435' 200 02 0 00 000001		0780
	IMULI	AC2,7				; AC2,7					400436' 221 02 0 00 000007
	MOVE	AC3,AC2				; ENTRY,AC2				400437' 200 03 0 00 000002
	ADD	AC3,AC4				; ENTRY,RING				400440' 270 03 0 00 000004
	MOVE	AC2,AC1				; AC2,I					400441' 200 02 0 00 000001		0781
	IMULI	AC2,7				; AC2,7					400442' 221 02 0 00 000007
	ADD	AC2,AC4				; AC2,RING				400443' 270 02 0 00 000004
	ADDI	AC2,7				; AC2,7					400444' 271 02 0 00 000007
	MOVEM	AC2,6(AC3)			; AC2,6(ENTRY)				400445' 202 02 0 03 000006
	MOVE	AC3,AC2				; ENTRY,AC2				400446' 200 03 0 00 000002		0782
	ADDI	AC1,1				; I,1					400447' 271 01 0 00 000001		0778
	CAIG	AC1,3				; I,3					400450' 307 01 0 00 000003
	JRST	L.21				; L.21					400451' 254 00 0 00 400435'
	MOVEM	AC4,6(AC3)			; RING,6(ENTRY)				400452' 202 04 0 03 000006		0785
	MOVE	AC5,AC4				; RING0,RING				400453' 200 05 0 00 000004
	HRLM	AC5,4(AC16)			; RING0,4(PORT)				400454' 506 05 0 16 000004		0787
	HRLM	AC5,5(AC16)			; RING0,5(PORT)				400455' 506 05 0 16 000005		0788
	PUSH	SP,11(AC14)			; SP,11(ARGBLK)				400456' 261 17 0 14 000011		0790
	MOVE	AC1,10(AC14)			; AC1,10(ARGBLK)			400457' 200 01 0 14 000010		0791
	MOVEI	AC1,-1(AC1)			; AC1,-1(AC1)				400460' 201 01 0 01 777777
	HRLI	AC1,41000			; AC1,41000				400461' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				400462' 261 17 0 00 000001
	MOVEI	AC1,110(AC13)			; AC1,110(DATA_BASE)			400463' 201 01 0 13 000110		0792
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  24
Version 1.0	A_CON						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (5)

	HRLI	AC1,41000			; AC1,41000				400464' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				400465' 261 17 0 00 000001
	PUSHJ	SP,GAMASC			; SP,GAMASC				400466' 260 17 0 00 000000V		0790
	ADDI	AC14,1				; ARGBLK,1				400467' 271 14 0 00 000001		0796
	PUSH	SP,-12(SP)			; SP,JFN				400470' 261 17 0 17 777766		0795
	PUSH	SP,AC12				; SP,INTERRUPT_CHANNEL			400471' 261 17 0 00 000012
	PUSHJ	SP,GADPSI			; SP,GADPSI				400472' 260 17 0 00 000000*
	ADJSP	SP,-2				; SP,-2					400473' 105 17 0 00 777776
	TRNN	AC1,1				; AC1,1					400474' 606 01 0 00 000001
	JRST	L.22				; L.22					400475' 254 00 0 00 400500'
	SETZM	0(AC14)				; 0(AC14)				400476' 402 00 0 14 000000		0796
	JRST	L.23				; L.23					400477' 254 00 0 00 400506'		0795
L.22:	PUSH	SP,-12(SP)			; SP,JFN				400500' 261 17 0 17 777766		0798
	PUSHJ	SP,GADABT			; SP,GADABT				400501' 260 17 0 00 000000*
	MOVEI	AC1,4				; AC1,4					400502' 201 01 0 00 000004		0799
	IORM	AC1,0(AC14)			; AC1,0(AC14)				400503' 436 01 0 14 000000
	ADJSP	SP,-13				; SP,-13				400504' 105 17 0 00 777765		0800
	JRST	L.26				; L.26					400505' 254 00 0 00 400514'		0797
L.23:	HRRZ	AC1,2(AC16)			; AC1,2(PORT)				400506' 550 01 0 16 000002		0804
	JUMPG	AC1,L.24			; AC1,L.24				400507' 327 01 0 00 400512'
	MOVEI	AC1,2000			; AC1,2000				400510' 201 01 0 00 002000		0805
	HRRM	AC1,2(AC16)			; AC1,2(PORT)				400511' 542 01 0 16 000002
L.24:	ADJSP	SP,-2				; SP,-2					400512' 105 17 0 00 777776		0731
L.25:	ADJSP	SP,-10				; SP,-10				400513' 105 17 0 00 777770		0808
L.26:	ADJSP	SP,-131				; SP,-131				400514' 105 17 0 00 777647		0628
	POP	SP,AC16				; SP,AC16				400515' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				400516' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				400517' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				400520' 262 17 0 00 000012
	POP	SP,AC5				; SP,AC5				400521' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				400522' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				400523' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				400524' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				400525' 262 17 0 00 000001
	POPJ	SP,				; SP,					400526' 263 17 0 00 000000
C.10:	POINT	9,0(AC16),35			; 9,0(PORT),35				400527' 00 11 0 16 000000
C.11:	POINT	9,0(AC16),26			; 9,0(PORT),26				400530' 11 11 0 16 000000
C.12:	POINT	7,P.AAA-1,34			; 7,P.AAA-1,34				400531' 01 07 0 00 400201'
C.13:	EXP	-1				; -1					400532' 777777	777777
C.14:	EXP	-2				; -2					400533' 777777	777776

; Routine Size:  217 words


;   0810  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  25
Version 1.0	A_REC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (6)

;   0811  1	%global_routine ('A_REC', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   0812  1	
;   0813  1	!++
;   0814  1	! FUNCTIONAL DESCRIPTION:
;   0815  1	!
;   0816  1	!        A%REC          Recieve data message
;   0817  1	!
;   0818  1	! FORMAL PARAMETERS:
;   0819  1	!
;   0820  1	!	ARGBLK          Argument block address of the port in AC1.
;   0821  1	!
;   0822  1	! IMPLICIT INPUTS:
;   0823  1	!
;   0824  1	!	none
;   0825  1	!
;   0826  1	! IMPLICIT OUTPUTS:
;   0827  1	!
;   0828  1	!	none
;   0829  1	!
;   0830  1	! COMPLETION CODES:
;   0831  1	!
;   0832  1	!	none
;   0833  1	!
;   0834  1	! SIDE EFFECTS:
;   0835  1	!
;   0836  1	!	none
;   0837  1	!
;   0838  1	!--
;   0839  1	
;   0840  2	    begin
;   0841  2	
;   0842  2	    local
;   0843  2	        POINTER,
;   0844  2		LENGTH,
;   0845  2	        RCODE,
;   0846  2		PORT: ref PORT_CONTROL_BLOCK,
;   0847  2	        DATA_BASE: ref USER_DATA_BASE;
;   0848  2	
;   0849  2	    ! Verify for legal port number and port data base, then get user
;   0850  2	    ! data base address
;   0851  2	
;   0852  2	    if (PORT = GAM$SERVICE_PORT (.ARGBLK[REC_PORT_NUMBER], AF_REC)) neq 0
;   0853  2	    then DATA_BASE = .PORT[PCB_DATA_BASE]
;   0854  3	    else begin                          ! Failed to get port control block
;   0855  3	         ARGBLK[REC_RETURN_CODE] = AC_BPN;
;   0856  3	         return;                        ! Return procedure error
;   0857  2	         end;
;   0858  2	
;   0859  2	    ! Check for data availability
;   0860  2	
;   0861  2	    if not .DATA_BASE[UDB_DATA_AVAILABLE]
;   0862  3	    then begin
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  26
Version 1.0	A_REC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (6)

;   0863  3	         ARGBLK[REC_DATA_LENGTH] = 0;
;   0864  4	         ARGBLK[REC_RETURN_CODE] = (if .PORT[PCB_RESET_SEEN] lss 0 ! No data
;   0865  4	                                    then AC_RCN   ! because reconnect pending 
;   0866  3	                                    else AC_NDA); ! because none came in
;   0867  3	         return;
;   0868  2	         end;
;   0869  2	
;   0870  2	         if .PORT[PCB_STATE] eql AS_FLU            ! No data
;   0871  3	         then begin
;   0872  3	              ARGBLK[REC_RETURN_CODE] = AC_NDA;      ! because FLUSH came in
;   0873  3	              XERO (.DATA_BASE[UDB_USER_DATA], .DATA_BASE[UDB_DATA_LENGTH]);
;   0874  3	              DATA_BASE[UDB_DATA_AVAILABLE] = $FALSE;
;   0875  3	              DATA_BASE[UDB_DATA_LENGTH] = 0;
;   0876  3	              PORT[PCB_STATE] = AS_RUN;
;   0877  3	              return;
;   0878  2	              end;
;   0879  2	
;   0880  2	    ! Pull off the sequence number and the RH and
;   0881  2	    ! return them to the user
;   0882  2	
;   0883  2	    POINTER = ch$ptr (DATA_BASE[UDB_USER_DATA],,8);
;   0884  2	    ch$move (2, .POINTER, ch$ptr (ARGBLK[REC_SEQ_NUMBER],,8));
;   0885  2	    POINTER = ch$plus (.POINTER, 2);
;   0886  2	    ch$move (3, .POINTER, ch$ptr (ARGBLK[REC_RH],,8));
;   0887  2	    POINTER = ch$plus (.POINTER, 3);
;   0888  2	    DATA_BASE[UDB_DATA_LENGTH] = .DATA_BASE[UDB_DATA_LENGTH] - 5;
;   0889  2	
;   0890  3	    if (.ARGBLK[REC_DATA_LENGTH] leq 0) ! Null receiving buffer
;   0891  3	    and (.DATA_BASE[UDB_DATA_LENGTH] gtr 0)
;   0892  2	    then ARGBLK[REC_RETURN_CODE] = AC_DFT
;   0893  3	    else begin
;   0894  3	
;   0895  3	         ! The received data is larger than the receiving buffer
;   0896  3	
;   0897  3	         if .DATA_BASE[UDB_DATA_LENGTH] gtr .ARGBLK[REC_DATA_LENGTH]
;   0898  3	         then ARGBLK[REC_RETURN_CODE] = AC_DFT
;   0899  3	         else ARGBLK[REC_DATA_LENGTH] = .DATA_BASE[UDB_DATA_LENGTH];
;   0900  3	
;   0901  3	         ! THIS SECTION IS NON-TRANSPORTABLE BLISS CODE.
;   0902  3	         ! Reason: the JSYS is used instead of regular BLISS ch$wchar function
;   0903  3	         ! due to the posibility that the receiving data pointer might be a
;   0904  3	         ! file JFN, and the SOUT JSYS will update that upon return.
;   0905  3	
;   0906  3	         jsys_sout (.ARGBLK[REC_DATA_POINTER],
;   0907  3	                    .POINTER, -.ARGBLK[REC_DATA_LENGTH];
;   0908  3	                    ARGBLK[REC_DATA_POINTER]);
;   0909  2	         end;
;   0910  2	
;   0911  2	    ! Remove data from buffer and reset buffer counter
;   0912  2	
;   0913  2	    ch$fill (0, .DATA_BASE[UDB_DATA_LENGTH], .POINTER);
;   0914  2	    DATA_BASE[UDB_DATA_AVAILABLE] = $FALSE;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  27
Version 1.0	A_REC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (6)

;   0915  2	    DATA_BASE[UDB_DATA_LENGTH] = 0;
;   0916  2	
;   0917  2	    return;
;   0918  2	
;   0919  1	    end;                                ! End of A_REC


A_REC:: PUSH	SP,AC1				; SP,AC1				400534' 261 17 0 00 000001		0811
	PUSH	SP,AC2				; SP,AC2				400535' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				400536' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				400537' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				400540' 261 17 0 00 000005
	PUSH	SP,AC13				; SP,AC13				400541' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				400542' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				400543' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				400544' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				400545' 261 17 0 16 000000		0852
	PUSH	SP,C.19				; SP,[3]				400546' 261 17 0 00 400722'
	PUSHJ	SP,GAMSER			; SP,GAMSER				400547' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					400550' 105 17 0 00 777776
	JUMPE	AC1,L.27			; PORT,L.27				400551' 322 01 0 00 400554'
	HLRZ	AC14,2(AC1)			; DATA_BASE,2(PORT)			400552' 554 14 0 01 000002		0853
	JRST	L.28				; L.28					400553' 254 00 0 00 400556'		0852
L.27:	MOVEI	AC2,1000			; AC2,1000				400554' 201 02 0 00 001000		0855
	JRST	L.30				; L.30					400555' 254 00 0 00 400571'
L.28:	MOVEI	AC2,2				; AC2,2					400556' 201 02 0 00 000002		0861
	TDNE	AC2,0(AC14)			; AC2,0(DATA_BASE)			400557' 612 02 0 14 000000
	JRST	L.31				; L.31					400560' 254 00 0 00 400573'
	SETZM	2(AC16)				; 2(ARGBLK)				400561' 402 00 0 16 000002		0863
	LDB	AC2,C.15			; AC2,[POINT 9,0(PORT),8]  <27,9>	400562' 135 02 0 00 400715'		0864
	TRC	AC2,400				; AC2,400				400563' 640 02 0 00 000400
	SUBI	AC2,400				; AC2,400				400564' 275 02 0 00 000400
	JUMPGE	AC2,L.29			; AC2,L.29				400565' 325 02 0 00 400570'
	MOVEI	AC2,100				; AC2,100				400566' 201 02 0 00 000100
	JRST	L.30				; L.30					400567' 254 00 0 00 400571'
L.29:	MOVEI	AC2,10				; AC2,10				400570' 201 02 0 00 000010
L.30:	MOVEM	AC2,1(AC16)			; AC2,1(ARGBLK)				400571' 202 02 0 16 000001
	JRST	L.38				; L.38					400572' 254 00 0 00 400704'		0862
L.31:	LDB	AC2,C.16			; AC2,[POINT 9,0(PORT),26]  <9,9>	400573' 135 02 0 00 400716'		0870
	CAIE	AC2,3				; AC2,3					400574' 302 02 0 00 000003
	JRST	L.32				; L.32					400575' 254 00 0 00 400616'
	MOVEI	AC2,10				; AC2,10				400576' 201 02 0 00 000010		0872
	MOVEM	AC2,1(AC16)			; AC2,1(ARGBLK)				400577' 202 02 0 16 000001
	MOVE	AC3,111(AC14)			; AC3,111(DATA_BASE)			400600' 200 03 0 14 000111		0873
	SETZM	0(AC3)				; 0(AC3)				400601' 402 00 0 03 000000
	HRL	AC2,AC3				; AC,AC3				400602' 504 02 0 00 000003
	MOVEI	AC4,1(AC3)			; AC4,1(AC3)				400603' 201 04 0 03 000001
	HRR	AC2,AC4				; AC,AC4				400604' 540 02 0 00 000004
	HLRE	AC4,1(AC14)			; AC4,1(DATA_BASE)			400605' 574 04 0 14 000001
	ADD	AC3,AC4				; AC3,AC4				400606' 270 03 0 00 000004
	BLT	AC2,-1(AC3)			; AC,-1(AC3)				400607' 251 02 0 03 777777
	MOVEI	AC2,2				; AC2,2					400610' 201 02 0 00 000002		0874
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  28
Version 1.0	A_REC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (6)

	ANDCAM	AC2,0(AC14)			; AC2,0(DATA_BASE)			400611' 412 02 0 14 000000
	HRRZS	1(AC14)				; 1(DATA_BASE)				400612' 553 00 0 14 000001		0875
	MOVEI	AC2,4				; AC2,4					400613' 201 02 0 00 000004		0876
	DPB	AC2,C.16			; AC2,[POINT 9,0(PORT),26]  <9,9>	400614' 137 02 0 00 400716'
	JRST	L.38				; L.38					400615' 254 00 0 00 400704'		0871
L.32:	MOVEI	AC2,110(AC14)			; AC2,110(DATA_BASE)			400616' 201 02 0 14 000110		0883
	HRLI	AC2,41000			; AC2,41000				400617' 505 02 0 00 041000
	MOVE	AC13,AC2			; POINTER,AC2				400620' 200 13 0 00 000002
	MOVEI	AC5,3(AC16)			; AC5,3(ARGBLK)				400621' 201 05 0 16 000003		0884
	HRLI	AC5,41000			; AC5,41000				400622' 505 05 0 00 041000
	MOVEI	AC1,2				; AC1,2					400623' 201 01 0 00 000002
	MOVE	AC2,AC13			; AC2,POINTER				400624' 200 02 0 00 000013
	MOVEI	AC4,2				; AC4,2					400625' 201 04 0 00 000002
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				400626' 123 01 0 00 400717'
	JFCL					; 					400627' 255 00 0 00 000000
	MOVEI	AC1,2				; AC1,2					400630' 201 01 0 00 000002		0885
	ADJBP	AC1,AC13			; AC1,POINTER				400631' 133 01 0 00 000013
	MOVE	AC13,AC1			; POINTER,AC1				400632' 200 13 0 00 000001
	MOVEI	AC5,4(AC16)			; AC5,4(ARGBLK)				400633' 201 05 0 16 000004		0886
	HRLI	AC5,41000			; AC5,41000				400634' 505 05 0 00 041000
	MOVEI	AC1,3				; AC1,3					400635' 201 01 0 00 000003
	MOVE	AC2,AC13			; AC2,POINTER				400636' 200 02 0 00 000013
	MOVEI	AC4,3				; AC4,3					400637' 201 04 0 00 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				400640' 123 01 0 00 400717'
	JFCL					; 					400641' 255 00 0 00 000000
	MOVEI	AC1,3				; AC1,3					400642' 201 01 0 00 000003		0887
	ADJBP	AC1,AC13			; AC1,POINTER				400643' 133 01 0 00 000013
	MOVE	AC13,AC1			; POINTER,AC1				400644' 200 13 0 00 000001
	MOVSI	AC1,-5				; AC1,-5				400645' 205 01 0 00 777773		0888
	ADDM	AC1,1(AC14)			; AC1,1(DATA_BASE)			400646' 272 01 0 14 000001
	MOVE	AC1,2(AC16)			; AC1,2(ARGBLK)				400647' 200 01 0 16 000002		0890
	JUMPG	AC1,L.33			; AC1,L.33				400650' 327 01 0 00 400656'
	HLRE	AC2,1(AC14)			; AC2,1(DATA_BASE)			400651' 574 02 0 14 000001		0891
	JUMPLE	AC2,L.33			; AC2,L.33				400652' 323 02 0 00 400656'
	MOVEI	AC2,200				; AC2,200				400653' 201 02 0 00 000200		0892
	MOVEM	AC2,1(AC16)			; AC2,1(ARGBLK)				400654' 202 02 0 16 000001
	JRST	L.37				; L.37					400655' 254 00 0 00 400674'		0890
L.33:	HLRE	AC2,1(AC14)			; AC2,1(DATA_BASE)			400656' 574 02 0 14 000001		0897
	CAMG	AC2,AC1				; AC2,AC1				400657' 317 02 0 00 000001
	JRST	L.34				; L.34					400660' 254 00 0 00 400664'
	MOVEI	AC1,200				; AC1,200				400661' 201 01 0 00 000200		0898
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				400662' 202 01 0 16 000001
	JRST	L.35				; L.35					400663' 254 00 0 00 400666'		0897
L.34:	HLRE	AC1,1(AC14)			; AC1,1(DATA_BASE)			400664' 574 01 0 14 000001		0899
	MOVEM	AC1,2(AC16)			; AC1,2(ARGBLK)				400665' 202 01 0 16 000002
L.35:	MOVN	AC3,2(AC16)			; AC3,2(ARGBLK)				400666' 210 03 0 16 000002		0907
	MOVE	AC1,3(AC16)			; AC1,3(ARGBLK)				400667' 200 01 0 16 000003		0908
	MOVE	AC2,AC13			; AC2,POINTER				400670' 200 02 0 00 000013
	JSYS	53				; 53					400671' 104 00 0 00 000053
	JUMP	16,L.36				; 16,L.36				400672' 320 16 0 00 400673'
L.36:	MOVEM	AC1,3(AC16)			; AC1,3(ARGBLK)				400673' 202 01 0 16 000003
L.37:	SETZB	AC1,AC2				; AC1,AC2				400674' 403 01 0 00 000002		0913
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  29
Version 1.0	A_REC						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (6)

	HLRE	AC4,1(AC14)			; AC4,1(DATA_BASE)			400675' 574 04 0 14 000001
	MOVE	AC5,AC13			; AC5,POINTER				400676' 200 05 0 00 000013
	EXTEND	AC1,C.18			; AC1,C.18				400677' 123 01 0 00 400720'
	JFCL					; 					400700' 255 00 0 00 000000
	MOVEI	AC1,2				; AC1,2					400701' 201 01 0 00 000002		0914
	ANDCAM	AC1,0(AC14)			; AC1,0(DATA_BASE)			400702' 412 01 0 14 000000
	HRRZS	1(AC14)				; 1(DATA_BASE)				400703' 553 00 0 14 000001		0915
L.38:	POP	SP,AC16				; SP,AC16				400704' 262 17 0 00 000016		0811
	POP	SP,AC14				; SP,AC14				400705' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				400706' 262 17 0 00 000013
	POP	SP,AC5				; SP,AC5				400707' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				400710' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				400711' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				400712' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				400713' 262 17 0 00 000001
	POPJ	SP,				; SP,					400714' 263 17 0 00 000000
C.15:	POINT	9,0(AC1),8			; 9,0(PORT),8				400715' 33 11 0 01 000000
C.16:	POINT	9,0(AC1),26			; 9,0(PORT),26				400716' 11 11 0 01 000000
C.17:	MOVSLJ					; 					400717' 016 00 0 00 000000
C.18:	MOVSLJ					; 					400720' 016 00 0 00 000000
	EXP	0				; 0					400721' 000000	000000
C.19:	EXP	3				; 3					400722' 000000	000003

; Routine Size:  119 words


;   0920  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  30
Version 1.0	A_REM						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (7)

;   0921  1	%global_routine ('A_REM', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   0922  1	
;   0923  1	!++
;   0924  1	! FUNCTIONAL DESCRIPTION:                         
;   0925  1	!
;   0926  1	!       A%REM           Receive Expedited Message
;   0927  1	!
;   0928  1	! FORMAL PARAMETERS:
;   0929  1	!
;   0930  1	!	ARGBLK          Argument block address of the port in AC1.
;   0931  1	!
;   0932  1	! IMPLICIT INPUTS:
;   0933  1	!
;   0934  1	!	none
;   0935  1	!
;   0936  1	! IMPLICIT OUTPUTS:
;   0937  1	!
;   0938  1	!	none
;   0939  1	!
;   0940  1	! COMPLETION CODES:
;   0941  1	!
;   0942  1	!	none
;   0943  1	!
;   0944  1	! SIDE EFFECTS:
;   0945  1	!
;   0946  1	!	none
;   0947  1	!
;   0948  1	!--
;   0949  1	
;   0950  2	    begin
;   0951  2	
;   0952  2	    local
;   0953  2	        POINTER,
;   0954  2	        TAIL: ref RING_ENTRY,
;   0955  2		PORT: ref PORT_CONTROL_BLOCK,
;   0956  2	        DATA_BASE: ref USER_DATA_BASE;
;   0957  2	
;   0958  2	    ! Verify for legal port number and port data base
;   0959  2	
;   0960  2	    if (PORT = GAM$SERVICE_PORT (.ARGBLK[REM_PORT_NUMBER], AF_REM)) neq 0
;   0961  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   0962  3	    else begin                          ! Failed to get port control block
;   0963  3	         ARGBLK[REM_RETURN_CODE] = AC_BPN;
;   0964  3	         return;
;   0965  2	         end;
;   0966  2	
;   0967  2	
;   0968  2	    ! Check for data availability
;   0969  2	
;   0970  2	    if not .DATA_BASE[UDB_INTERRUPT_AVAILABLE]
;   0971  3	    then begin
;   0972  3	         ARGBLK[REM_DATA_LENGTH] = 0;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  31
Version 1.0	A_REM						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (7)

;   0973  4	         ARGBLK[REM_RETURN_CODE] = (if .PORT[PCB_RESET_SEEN] lss 0 ! No data
;   0974  4	                                    then AC_RCN   ! because reconnect pending 
;   0975  3	                                    else AC_NDA); ! because none came in
;   0976  3	         return;
;   0977  2	         end;
;   0978  2	
;   0979  2	
;   0980  2	    TAIL = .PORT[PCB_INTAIL_BUFFER];
;   0981  2	    if .TAIL[IN_USE_FLAG] eql 0
;   0982  3	    then begin
;   0983  3	         ARGBLK[REM_RETURN_CODE] = AC_NDA;
;   0984  3	         return;
;   0985  2	         end;
;   0986  2	    
;   0987  2	    ! Pull off the sequence number and the RH and
;   0988  2	    ! return them to the user
;   0989  2	
;   0990  2	    POINTER = ch$ptr (TAIL[DATA_BUFFER],,8);
;   0991  2	    ch$move (2, .POINTER, ch$ptr (ARGBLK[REM_SEQ_NUMBER],,8));
;   0992  2	    POINTER = ch$plus (.POINTER, 2);
;   0993  2	    ch$move (3, .POINTER, ch$ptr (ARGBLK[REM_RH],,8));
;   0994  2	    POINTER = ch$plus (.POINTER, 3);
;   0995  2	    TAIL[DATA_LENGTH] = .TAIL[DATA_LENGTH] - 5;
;   0996  2	
;   0997  3	    if (.ARGBLK[REM_DATA_LENGTH] leq 0)           ! Null receiving buffer
;   0998  3	    and (.TAIL[DATA_LENGTH] gtr 0)
;   0999  2	    then ARGBLK[REM_RETURN_CODE] = AC_DFT
;   1000  3	    else begin
;   1001  3	
;   1002  3	         ! The received data is larger than the receiving buffer
;   1003  3	
;   1004  3	         if .TAIL[DATA_LENGTH] gtr .ARGBLK[REM_DATA_LENGTH]
;   1005  3	         then ARGBLK[REM_RETURN_CODE] = AC_DFT ! 
;   1006  3	         else ARGBLK[REM_DATA_LENGTH] = .TAIL[DATA_LENGTH];
;   1007  3	
;   1008  3	         ! THIS SECTION IS NON-TRANSPORTABLE BLISS CODE.
;   1009  3	         ! Reason: the JSYS is used instead of regular BLISS ch$wchar function
;   1010  3	         ! due to the posibility that the receiving data pointer might be a
;   1011  3	         ! file JFN, and the SOUT JSYS will update that upon return.
;   1012  3	
;   1013  3	         jsys_sout (.ARGBLK[REM_DATA],
;   1014  3	                    .POINTER, -.ARGBLK[REM_DATA_LENGTH];
;   1015  3	                    ARGBLK[REM_DATA]);
;   1016  2	         end;
;   1017  2	
;   1018  2	    ! Remove data from buffer and reset buffer counter
;   1019  2	
;   1020  2	    PORT[PCB_INTAIL_BUFFER] = .TAIL[NEXT_RING_PTR];
;   1021  2	    XERO (TAIL[DATA_BUFFER], INT_BUFFER_SIZE);
;   1022  2	    TAIL[IN_USE_FLAG] = 0;
;   1023  2	    PORT[PCB_INTCNT] = .PORT[PCB_INTCNT] - 1;
;   1024  2	    if .PORT[PCB_INTCNT] eql 0
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  32
Version 1.0	A_REM						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (7)

;   1025  2	    then DATA_BASE[UDB_INTERRUPT_AVAILABLE] = $FALSE;
;   1026  2	    TAIL[DATA_LENGTH] = 0;
;   1027  2	    return;
;   1028  1	    end;                                ! End of A_REM


A_REM:: PUSH	SP,AC1				; SP,AC1				400723' 261 17 0 00 000001		0921
	PUSH	SP,AC2				; SP,AC2				400724' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				400725' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				400726' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				400727' 261 17 0 00 000005
	PUSH	SP,AC11				; SP,AC11				400730' 261 17 0 00 000011
	PUSH	SP,AC12				; SP,AC12				400731' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				400732' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				400733' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				400734' 261 17 0 00 000016
	MOVE	AC14,AC1			; ARGBLK,AC1				400735' 200 14 0 00 000001
	PUSH	SP,0(AC14)			; SP,0(ARGBLK)				400736' 261 17 0 14 000000		0960
	PUSH	SP,C.21				; SP,[4]				400737' 261 17 0 00 401102'
	PUSHJ	SP,GAMSER			; SP,GAMSER				400740' 260 17 0 00 000000V
	MOVE	AC13,AC1			; PORT,AC1				400741' 200 13 0 00 000001
	ADJSP	SP,-2				; SP,-2					400742' 105 17 0 00 777776
	JUMPE	AC13,L.39			; PORT,L.39				400743' 322 13 0 00 400746'
	HLRZ	AC11,2(AC13)			; DATA_BASE,2(PORT)			400744' 554 11 0 13 000002		0961
	JRST	L.40				; L.40					400745' 254 00 0 00 400750'		0960
L.39:	MOVEI	AC1,1000			; AC1,1000				400746' 201 01 0 00 001000		0963
	JRST	L.43				; L.43					400747' 254 00 0 00 400766'
L.40:	MOVEI	AC1,10				; AC1,10				400750' 201 01 0 00 000010		0970
	TDNE	AC1,0(AC11)			; AC1,0(DATA_BASE)			400751' 612 01 0 11 000000
	JRST	L.41				; L.41					400752' 254 00 0 00 400762'
	HLLZS	2(AC14)				; 2(ARGBLK)				400753' 513 00 0 14 000002		0972
	LDB	AC1,C.20			; AC1,[POINT 9,0(PORT),8]  <27,9>	400754' 135 01 0 00 401101'		0973
	TRC	AC1,400				; AC1,400				400755' 640 01 0 00 000400
	SUBI	AC1,400				; AC1,400				400756' 275 01 0 00 000400
	JUMPGE	AC1,L.42			; AC1,L.42				400757' 325 01 0 00 400765'
	MOVEI	AC1,100				; AC1,100				400760' 201 01 0 00 000100
	JRST	L.43				; L.43					400761' 254 00 0 00 400766'
L.41:	HRRZ	AC16,5(AC13)			; TAIL,5(PORT)				400762' 550 16 0 13 000005		0980
	SKIPE	4(AC16)				; 4(TAIL)				400763' 332 00 0 16 000004		0981
	JRST	L.44				; L.44					400764' 254 00 0 00 400770'
L.42:	MOVEI	AC1,10				; AC1,10				400765' 201 01 0 00 000010		0983
L.43:	MOVEM	AC1,1(AC14)			; AC1,1(ARGBLK)				400766' 202 01 0 14 000001
	JRST	L.51				; L.51					400767' 254 00 0 00 401066'		0982
L.44:	MOVEI	AC2,-1(AC16)			; AC2,-1(TAIL)				400770' 201 02 0 16 777777		0990
	HRLI	AC2,41000			; AC2,41000				400771' 505 02 0 00 041000
	MOVE	AC12,AC2			; POINTER,AC2				400772' 200 12 0 00 000002
	MOVEI	AC5,3(AC14)			; AC5,3(ARGBLK)				400773' 201 05 0 14 000003		0991
	HRLI	AC5,41000			; AC5,41000				400774' 505 05 0 00 041000
	MOVEI	AC1,2				; AC1,2					400775' 201 01 0 00 000002
	MOVE	AC2,AC12			; AC2,POINTER				400776' 200 02 0 00 000012
	MOVEI	AC4,2				; AC4,2					400777' 201 04 0 00 000002
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401000' 123 01 0 00 400717'
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  33
Version 1.0	A_REM						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (7)

	JFCL					; 					401001' 255 00 0 00 000000
	MOVEI	AC1,2				; AC1,2					401002' 201 01 0 00 000002		0992
	ADJBP	AC1,AC12			; AC1,POINTER				401003' 133 01 0 00 000012
	MOVE	AC12,AC1			; POINTER,AC1				401004' 200 12 0 00 000001
	MOVEI	AC5,4(AC14)			; AC5,4(ARGBLK)				401005' 201 05 0 14 000004		0993
	HRLI	AC5,41000			; AC5,41000				401006' 505 05 0 00 041000
	MOVEI	AC1,3				; AC1,3					401007' 201 01 0 00 000003
	MOVE	AC2,AC12			; AC2,POINTER				401010' 200 02 0 00 000012
	MOVEI	AC4,3				; AC4,3					401011' 201 04 0 00 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401012' 123 01 0 00 400717'
	JFCL					; 					401013' 255 00 0 00 000000
	MOVEI	AC1,3				; AC1,3					401014' 201 01 0 00 000003		0994
	ADJBP	AC1,AC12			; AC1,POINTER				401015' 133 01 0 00 000012
	MOVE	AC12,AC1			; POINTER,AC1				401016' 200 12 0 00 000001
	HRROI	AC1,-5				; AC1,-5				401017' 561 01 0 00 777773		0995
	ADDM	AC1,5(AC16)			; AC1,5(TAIL)				401020' 272 01 0 16 000005
	HRRE	AC1,2(AC14)			; AC1,2(ARGBLK)				401021' 570 01 0 14 000002		0997
	JUMPG	AC1,L.45			; AC1,L.45				401022' 327 01 0 00 401030'
	SKIPG	5(AC16)				; 5(TAIL)				401023' 337 00 0 16 000005		0998
	JRST	L.45				; L.45					401024' 254 00 0 00 401030'
	MOVEI	AC2,200				; AC2,200				401025' 201 02 0 00 000200		0999
	MOVEM	AC2,1(AC14)			; AC2,1(ARGBLK)				401026' 202 02 0 14 000001
	JRST	L.49				; L.49					401027' 254 00 0 00 401046'		0997
L.45:	CAML	AC1,5(AC16)			; AC1,5(TAIL)				401030' 311 01 0 16 000005		1004
	JRST	L.46				; L.46					401031' 254 00 0 00 401035'
	MOVEI	AC1,200				; AC1,200				401032' 201 01 0 00 000200		1005
	MOVEM	AC1,1(AC14)			; AC1,1(ARGBLK)				401033' 202 01 0 14 000001
	JRST	L.47				; L.47					401034' 254 00 0 00 401037'		1004
L.46:	MOVE	AC1,5(AC16)			; AC1,5(TAIL)				401035' 200 01 0 16 000005		1006
	HRRM	AC1,2(AC14)			; AC1,2(ARGBLK)				401036' 542 01 0 14 000002
L.47:	HRRE	AC1,2(AC14)			; AC1,2(ARGBLK)				401037' 570 01 0 14 000002		1014
	MOVN	AC3,AC1				; AC3,AC1				401040' 210 03 0 00 000001
	MOVE	AC1,3(AC14)			; AC1,3(ARGBLK)				401041' 200 01 0 14 000003		1015
	MOVE	AC2,AC12			; AC2,POINTER				401042' 200 02 0 00 000012
	JSYS	53				; 53					401043' 104 00 0 00 000053
	JUMP	16,L.48				; 16,L.48				401044' 320 16 0 00 401045'
L.48:	MOVEM	AC1,3(AC14)			; AC1,3(ARGBLK)				401045' 202 01 0 14 000003
L.49:	MOVE	AC1,6(AC16)			; AC1,6(TAIL)				401046' 200 01 0 16 000006		1020
	HRRM	AC1,5(AC13)			; AC1,5(PORT)				401047' 542 01 0 13 000005
	SETZM	0(AC16)				; 0(TAIL)				401050' 402 00 0 16 000000		1021
	HRL	AC1,AC16			; AC,TAIL				401051' 504 01 0 00 000016
	MOVEI	AC2,1(AC16)			; AC2,1(TAIL)				401052' 201 02 0 16 000001
	HRR	AC1,AC2				; AC,AC2				401053' 540 01 0 00 000002
	BLT	AC1,17(AC16)			; AC,17(TAIL)				401054' 251 01 0 16 000017
	SETZM	4(AC16)				; 4(TAIL)				401055' 402 00 0 16 000004		1022
	HRRE	AC1,1(AC13)			; AC1,1(PORT)				401056' 570 01 0 13 000001		1023
	SUBI	AC1,1				; AC1,1					401057' 275 01 0 00 000001
	HRRM	AC1,1(AC13)			; AC1,1(PORT)				401060' 542 01 0 13 000001
	HRRE	AC1,1(AC13)			; AC1,1(PORT)				401061' 570 01 0 13 000001		1024
	JUMPN	AC1,L.50			; AC1,L.50				401062' 326 01 0 00 401065'
	MOVEI	AC1,10				; AC1,10				401063' 201 01 0 00 000010		1025
	ANDCAM	AC1,0(AC11)			; AC1,0(DATA_BASE)			401064' 412 01 0 11 000000
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  34
Version 1.0	A_REM						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (7)

L.50:	SETZM	5(AC16)				; 5(TAIL)				401065' 402 00 0 16 000005		1026
L.51:	POP	SP,AC16				; SP,AC16				401066' 262 17 0 00 000016		0921
	POP	SP,AC14				; SP,AC14				401067' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				401070' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				401071' 262 17 0 00 000012
	POP	SP,AC11				; SP,AC11				401072' 262 17 0 00 000011
	POP	SP,AC5				; SP,AC5				401073' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401074' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401075' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401076' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401077' 262 17 0 00 000001
	POPJ	SP,				; SP,					401100' 263 17 0 00 000000
C.20:	POINT	9,0(AC13),8			; 9,0(PORT),8				401101' 33 11 0 13 000000
C.21:	EXP	4				; 4					401102' 000000	000004

; Routine Size:  112 words


;   1029  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  35
Version 1.0	A_RDE						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (8)

;   1030  1	%global_routine ('A_RDE', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1031  1	
;   1032  1	!++
;   1033  1	! FUNCTIONAL DESCRIPTION:
;   1034  1	!
;   1035  1	!       A%RDE           Read Event Data
;   1036  1	!
;   1037  1	! FORMAL PARAMETERS:
;   1038  1	!
;   1039  1	!	ARGBLK          Argument block address of the port in AC1.
;   1040  1	!
;   1041  1	! IMPLICIT INPUTS:
;   1042  1	!
;   1043  1	!	none
;   1044  1	!
;   1045  1	! IMPLICIT OUTPUTS:
;   1046  1	!
;   1047  1	!	none
;   1048  1	!
;   1049  1	! COMPLETION CODES:
;   1050  1	!
;   1051  1	!	none
;   1052  1	!
;   1053  1	! SIDE EFFECTS:
;   1054  1	!
;   1055  1	!	none
;   1056  1	!
;   1057  1	!--
;   1058  1	
;   1059  2	    begin
;   1060  2	
;   1061  2	    local
;   1062  2		PORT: ref PORT_CONTROL_BLOCK,
;   1063  2	        DATA_BASE: ref USER_DATA_BASE;
;   1064  2	
;   1065  2	    ! Verify for legal port number and port data base
;   1066  2	
;   1067  2	    if (PORT = GAM$SERVICE_PORT (.ARGBLK[RDE_PORT_NUMBER], AF_RDE)) neq 0
;   1068  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   1069  3	    else begin                          ! Failed to get port control block
;   1070  3	         ARGBLK[RDE_STATE] = AS_UND;
;   1071  3	         ARGBLK[RDE_RETURN_CODE] = AC_BPN;
;   1072  3	         return;
;   1073  2	         end;
;   1074  2	
;   1075  2	    ARGBLK[RDE_STATE] = .PORT[PCB_STATE];
;   1076  2	    ARGBLK[RDE_ERROR] = .PORT[PCB_ERROR];
;   1077  2	    ARGBLK[RDE_DATA_AVAILABLE] = .DATA_BASE[UDB_DATA_AVAILABLE];
;   1078  2	    ARGBLK[RDE_INTERRUPT_AVAILABLE] = .DATA_BASE[UDB_INTERRUPT_AVAILABLE];
;   1079  2	    ARGBLK[RDE_RETURN_CODE] = AC_SUC;
;   1080  2	
;   1081  2	    return;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  36
Version 1.0	A_RDE						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (8)

;   1082  1	    end;                                ! End of A_RDE


A_RDE:: PUSH	SP,AC1				; SP,AC1				401103' 261 17 0 00 000001		1030
	PUSH	SP,AC2				; SP,AC2				401104' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401105' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401106' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401107' 261 17 0 00 000005
	PUSH	SP,AC16				; SP,AC16				401110' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				401111' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401112' 261 17 0 16 000000		1067
	PUSH	SP,C.26				; SP,[7]				401113' 261 17 0 00 401151'
	PUSHJ	SP,GAMSER			; SP,GAMSER				401114' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					401115' 105 17 0 00 777776
	JUMPE	AC1,L.52			; PORT,L.52				401116' 322 01 0 00 401121'
	HLRZ	AC2,2(AC1)			; DATA_BASE,2(PORT)			401117' 554 02 0 01 000002		1068
	JRST	L.53				; L.53					401120' 254 00 0 00 401125'		1067
L.52:	SETZM	3(AC16)				; 3(ARGBLK)				401121' 402 00 0 16 000003		1070
	MOVEI	AC3,1000			; AC3,1000				401122' 201 03 0 00 001000		1071
	MOVEM	AC3,1(AC16)			; AC3,1(ARGBLK)				401123' 202 03 0 16 000001
	JRST	L.54				; L.54					401124' 254 00 0 00 401136'		1069
L.53:	LDB	AC3,C.16			; AC3,[POINT 9,0(AC1),26]  <9,9>	401125' 135 03 0 00 400716'		1075
	MOVEM	AC3,3(AC16)			; AC3,3(ARGBLK)				401126' 202 03 0 16 000003
	HLRZ	AC3,1(AC1)			; AC3,1(PORT)				401127' 554 03 0 01 000001		1076
	MOVEM	AC3,4(AC16)			; AC3,4(ARGBLK)				401130' 202 03 0 16 000004
	LDB	AC1,C.22			; AC1,[POINT 1,0(DATA_BASE),34]  <1,1>	401131' 135 01 0 00 401145'		1077
	DPB	AC1,C.23			; AC1,[POINT 1,2(ARGBLK),0]  <35,1>	401132' 137 01 0 00 401146'
	LDB	AC1,C.24			; AC1,[POINT 1,0(DATA_BASE),32]  <3,1>	401133' 135 01 0 00 401147'		1078
	DPB	AC1,C.25			; AC1,[POINT 1,2(ARGBLK),1]  <34,1>	401134' 137 01 0 00 401150'
	SETZM	1(AC16)				; 1(ARGBLK)				401135' 402 00 0 16 000001		1079
L.54:	POP	SP,AC16				; SP,AC16				401136' 262 17 0 00 000016		1030
	POP	SP,AC5				; SP,AC5				401137' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401140' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401141' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401142' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401143' 262 17 0 00 000001
	POPJ	SP,				; SP,					401144' 263 17 0 00 000000
C.22:	POINT	1,0(AC2),34			; 1,0(DATA_BASE),34			401145' 01 01 0 02 000000
C.23:	POINT	1,2(AC16),0			; 1,2(ARGBLK),0				401146' 43 01 0 16 000002
C.24:	POINT	1,0(AC2),32			; 1,0(DATA_BASE),32			401147' 03 01 0 02 000000
C.25:	POINT	1,2(AC16),1			; 1,2(ARGBLK),1				401150' 42 01 0 16 000002
C.26:	EXP	7				; 7					401151' 000000	000007

; Routine Size:  39 words


;   1083  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  37
Version 1.0	A_RAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (9)

;   1084  1	%global_routine ('A_RAD', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1085  1	
;   1086  1	!++
;   1087  1	! FUNCTIONAL DESCRIPTION:
;   1088  1	!
;   1089  1	!       A%RAD           Read Abort Data
;   1090  1	!
;   1091  1	! FORMAL PARAMETERS:
;   1092  1	!
;   1093  1	!	ARGBLK          Argument block address of the port in AC1.
;   1094  1	!
;   1095  1	! IMPLICIT INPUTS:
;   1096  1	!
;   1097  1	!	none
;   1098  1	!
;   1099  1	! IMPLICIT OUTPUTS:
;   1100  1	!
;   1101  1	!	none
;   1102  1	!
;   1103  1	! COMPLETION CODES:
;   1104  1	!
;   1105  1	!	none
;   1106  1	!
;   1107  1	! SIDE EFFECTS:
;   1108  1	!
;   1109  1	!	none
;   1110  1	!
;   1111  1	!--
;   1112  1	
;   1113  2	    begin
;   1114  2	
;   1115  2	    local
;   1116  2		PORT: ref PORT_CONTROL_BLOCK,
;   1117  2	        DATA_BASE: ref USER_DATA_BASE;
;   1118  2	
;   1119  2	    ! Verify for legal port number and port data base
;   1120  2	
;   1121  2	    if (PORT = GAM$SERVICE_PORT (.ARGBLK[RAD_PORT_NUMBER], AF_RAD)) neq 0
;   1122  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   1123  3	    else begin                          ! Failed to get port control block
;   1124  3	         ARGBLK[RAD_STATE] = AS_UND;
;   1125  3	         ARGBLK[RAD_RETURN_CODE] = AC_BPN;
;   1126  3	         return;
;   1127  2	         end;
;   1128  2	    
;   1129  2	    if .DATA_BASE[UDB_ABORT_LENGTH] eql 0 
;   1130  2	    then ARGBLK[RAD_RETURN_CODE] = AC_NDA
;   1131  3	    else begin
;   1132  3	         local PTR;
;   1133  3	         ARGBLK[RAD_RETURN_CODE] = AC_SUC;
;   1134  3	         ARGBLK[RAD_ABORT_STATUS] = .DATA_BASE[UDB_ABORT_STATUS];
;   1135  3	         ARGBLK[RAD_STATE] = .PORT[PCB_STATE];
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  38
Version 1.0	A_RAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (9)

;   1136  3	         ARGBLK[RAD_LENGTH] = .DATA_BASE[UDB_ABORT_LENGTH] - 5;
;   1137  3	         PTR =  ch$ptr (DATA_BASE[UDB_ABORT_DATA],,8);
;   1138  3	         ARGBLK[RAD_ABORT_REASON] = ch$rchar_a (PTR);
;   1139  3	         ch$move (4, .PTR, ch$ptr (ARGBLK[RAD_SENSE_CODE],,8));
;   1140  3	         PTR = ch$plus (.PTR, 4);
;   1141  3	         ch$move (.ARGBLK[RAD_LENGTH], .PTR, .ARGBLK[RAD_DATA]);
;   1142  2	         end;
;   1143  2	
;   1144  2	    return;
;   1145  1	    end;                                ! End of A_RAD


A_RAD:: PUSH	SP,AC1				; SP,AC1				401152' 261 17 0 00 000001		1084
	PUSH	SP,AC2				; SP,AC2				401153' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401154' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401155' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401156' 261 17 0 00 000005
	PUSH	SP,AC16				; SP,AC16				401157' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				401160' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401161' 261 17 0 16 000000		1121
	PUSH	SP,C.27				; SP,[10]				401162' 261 17 0 00 401246'
	PUSHJ	SP,GAMSER			; SP,GAMSER				401163' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					401164' 105 17 0 00 777776
	JUMPE	AC1,L.55			; PORT,L.55				401165' 322 01 0 00 401170'
	HLRZ	AC2,2(AC1)			; DATA_BASE,2(PORT)			401166' 554 02 0 01 000002		1122
	JRST	L.56				; L.56					401167' 254 00 0 00 401174'		1121
L.55:	HLLZS	5(AC16)				; 5(ARGBLK)				401170' 513 00 0 16 000005		1124
	MOVEI	AC3,1000			; AC3,1000				401171' 201 03 0 00 001000		1125
	MOVEM	AC3,1(AC16)			; AC3,1(ARGBLK)				401172' 202 03 0 16 000001
	JRST	L.58				; L.58					401173' 254 00 0 00 401237'		1123
L.56:	MOVE	AC3,AC16			; AC3,ARGBLK				401174' 200 03 0 00 000016		1130
	ADDI	AC3,1				; AC3,1					401175' 271 03 0 00 000001
	HRRE	AC4,3(AC2)			; AC4,3(DATA_BASE)			401176' 570 04 0 02 000003		1129
	JUMPN	AC4,L.57			; AC4,L.57				401177' 326 04 0 00 401203'
	MOVEI	AC5,10				; AC5,10				401200' 201 05 0 00 000010		1130
	MOVEM	AC5,0(AC3)			; AC5,0(AC3)				401201' 202 05 0 03 000000
	JRST	L.58				; L.58					401202' 254 00 0 00 401237'		1129
L.57:	SETZM	0(AC3)				; 0(AC3)				401203' 402 00 0 03 000000		1133
	MOVE	AC3,4(AC2)			; AC3,4(DATA_BASE)			401204' 200 03 0 02 000004		1134
	MOVEM	AC3,2(AC16)			; AC3,2(ARGBLK)				401205' 202 03 0 16 000002
	LDB	AC3,C.16			; AC3,[POINT 9,0(AC1),26]  <9,9>	401206' 135 03 0 00 400716'		1135
	HRRM	AC3,5(AC16)			; AC3,5(ARGBLK)				401207' 542 03 0 16 000005
	SUBI	AC4,5				; AC4,5					401210' 275 04 0 00 000005		1136
	HRLM	AC4,5(AC16)			; AC4,5(ARGBLK)				401211' 506 04 0 16 000005
	MOVEI	AC2,47(AC2)			; AC2,47(DATA_BASE)			401212' 201 02 0 02 000047		1137
	HRLI	AC2,41000			; AC2,41000				401213' 505 02 0 00 041000
	MOVE	AC3,AC2				; PTR,AC2				401214' 200 03 0 00 000002
	ILDB	AC1,AC3				; AC1,PTR				401215' 134 01 0 00 000003		1138
	MOVEM	AC1,3(AC16)			; AC1,3(ARGBLK)				401216' 202 01 0 16 000003
	MOVEI	AC5,3(AC16)			; AC5,3(ARGBLK)				401217' 201 05 0 16 000003		1139
	HRLI	AC5,41000			; AC5,41000				401220' 505 05 0 00 041000
	MOVEI	AC1,4				; AC1,4					401221' 201 01 0 00 000004
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  39
Version 1.0	A_RAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (9)

	MOVE	AC2,AC3				; AC2,PTR				401222' 200 02 0 00 000003
	MOVEI	AC4,4				; AC4,4					401223' 201 04 0 00 000004
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401224' 123 01 0 00 400717'
	JFCL					; 					401225' 255 00 0 00 000000
	MOVEI	AC1,4				; AC1,4					401226' 201 01 0 00 000004		1140
	ADJBP	AC1,AC3				; AC1,PTR				401227' 133 01 0 00 000003
	MOVE	AC3,AC1				; PTR,AC1				401230' 200 03 0 00 000001
	HLRZ	AC1,5(AC16)			; AC1,5(ARGBLK)				401231' 554 01 0 16 000005		1141
	MOVE	AC2,AC3				; AC2,PTR				401232' 200 02 0 00 000003
	HLRZ	AC4,5(AC16)			; AC4,5(ARGBLK)				401233' 554 04 0 16 000005
	MOVE	AC5,6(AC16)			; AC5,6(ARGBLK)				401234' 200 05 0 16 000006
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401235' 123 01 0 00 400717'
	JFCL					; 					401236' 255 00 0 00 000000
L.58:	POP	SP,AC16				; SP,AC16				401237' 262 17 0 00 000016		1084
	POP	SP,AC5				; SP,AC5				401240' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401241' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401242' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401243' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401244' 262 17 0 00 000001
	POPJ	SP,				; SP,					401245' 263 17 0 00 000000
C.27:	EXP	10				; 10					401246' 000000	000010

; Routine Size:  61 words


;   1146  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  40
Version 1.0	A_RBD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (10)

;   1147  1	%global_routine ('A_RBD', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1148  1	
;   1149  1	!++
;   1150  1	! FUNCTIONAL DESCRIPTION:
;   1151  1	!
;   1152  1	!       A%RBD           Read BIND Data
;   1153  1	!
;   1154  1	! FORMAL PARAMETERS:
;   1155  1	!
;   1156  1	!	ARGBLK          Argument block address of the port in AC1.
;   1157  1	!
;   1158  1	! IMPLICIT INPUTS:
;   1159  1	!
;   1160  1	!	none
;   1161  1	!
;   1162  1	! IMPLICIT OUTPUTS:
;   1163  1	!
;   1164  1	!	none
;   1165  1	!
;   1166  1	! COMPLETION CODES:
;   1167  1	!
;   1168  1	!	none
;   1169  1	!
;   1170  1	! SIDE EFFECTS:
;   1171  1	!
;   1172  1	!	none
;   1173  1	!
;   1174  1	!--
;   1175  1	
;   1176  2	    begin
;   1177  2	
;   1178  2	    local
;   1179  2		PORT: ref PORT_CONTROL_BLOCK,
;   1180  2	        DATA_BASE: ref USER_DATA_BASE;
;   1181  2	
;   1182  2	    ! Verify for legal port number and port data base
;   1183  2	
;   1184  2	    if (PORT = GAM$SERVICE_PORT (.ARGBLK[RBD_PORT_NUMBER], AF_RBD)) neq 0
;   1185  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   1186  3	    else begin                          ! Failed to get port control block
;   1187  3	         ARGBLK[RBD_RETURN_CODE] = AC_BPN;
;   1188  3	         return;
;   1189  2	         end;
;   1190  2	    
;   1191  2	    if .DATA_BASE[UDB_BIND_LENGTH] eql 0 
;   1192  2	    then ARGBLK[RBD_RETURN_CODE] = AC_NDA
;   1193  3	    else begin
;   1194  3	         ARGBLK[RBD_RETURN_CODE] = AC_SUC;
;   1195  3	         ARGBLK[RBD_BIND_LENGTH] = .DATA_BASE[UDB_BIND_LENGTH];
;   1196  3	         ch$move (.ARGBLK[RBD_BIND_LENGTH], ch$ptr (DATA_BASE[UDB_BIND_DATA],,8), .ARGBLK[RBD_BIND_DATA]);
;   1197  2	         end;
;   1198  2	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  41
Version 1.0	A_RBD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (10)

;   1199  2	    return;
;   1200  1	    end;                                ! End of A_RBD


A_RBD:: PUSH	SP,AC1				; SP,AC1				401247' 261 17 0 00 000001		1147
	PUSH	SP,AC2				; SP,AC2				401250' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401251' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401252' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401253' 261 17 0 00 000005
	PUSH	SP,AC16				; SP,AC16				401254' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				401255' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401256' 261 17 0 16 000000		1184
	PUSH	SP,C.28				; SP,[6]				401257' 261 17 0 00 401317'
	PUSHJ	SP,GAMSER			; SP,GAMSER				401260' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					401261' 105 17 0 00 777776
	JUMPE	AC1,L.59			; PORT,L.59				401262' 322 01 0 00 401265'
	HLRZ	AC2,2(AC1)			; DATA_BASE,2(PORT)			401263' 554 02 0 01 000002		1185
	JRST	L.60				; L.60					401264' 254 00 0 00 401270'		1184
L.59:	MOVEI	AC1,1000			; AC1,1000				401265' 201 01 0 00 001000		1187
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401266' 202 01 0 16 000001
	JRST	L.62				; L.62					401267' 254 00 0 00 401310'		1186
L.60:	MOVE	AC1,AC16			; AC1,ARGBLK				401270' 200 01 0 00 000016		1192
	ADDI	AC1,1				; AC1,1					401271' 271 01 0 00 000001
	HLRE	AC3,2(AC2)			; AC3,2(DATA_BASE)			401272' 574 03 0 02 000002		1191
	JUMPN	AC3,L.61			; AC3,L.61				401273' 326 03 0 00 401277'
	MOVEI	AC4,10				; AC4,10				401274' 201 04 0 00 000010		1192
	MOVEM	AC4,0(AC1)			; AC4,0(AC1)				401275' 202 04 0 01 000000
	JRST	L.62				; L.62					401276' 254 00 0 00 401310'		1191
L.61:	SETZM	0(AC1)				; 0(AC1)				401277' 402 00 0 01 000000		1194
	MOVEM	AC3,2(AC16)			; AC3,2(ARGBLK)				401300' 202 03 0 16 000002		1195
	MOVEI	AC2,6(AC2)			; AC2,6(DATA_BASE)			401301' 201 02 0 02 000006		1196
	HRLI	AC2,41000			; AC2,41000				401302' 505 02 0 00 041000
	MOVE	AC1,2(AC16)			; AC1,2(ARGBLK)				401303' 200 01 0 16 000002
	MOVE	AC4,2(AC16)			; AC4,2(ARGBLK)				401304' 200 04 0 16 000002
	MOVE	AC5,3(AC16)			; AC5,3(ARGBLK)				401305' 200 05 0 16 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401306' 123 01 0 00 400717'
	JFCL					; 					401307' 255 00 0 00 000000
L.62:	POP	SP,AC16				; SP,AC16				401310' 262 17 0 00 000016		1147
	POP	SP,AC5				; SP,AC5				401311' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401312' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401313' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401314' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401315' 262 17 0 00 000001
	POPJ	SP,				; SP,					401316' 263 17 0 00 000000
C.28:	EXP	6				; 6					401317' 000000	000006

; Routine Size:  41 words


;   1201  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  42
Version 1.0	A_RCN						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (11)

;   1202  1	%global_routine ('A_RCN', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1203  1	
;   1204  1	!++
;   1205  1	! FUNCTIONAL DESCRIPTION:
;   1206  1	!
;   1207  1	!       A%RCN         Reconnect to IBM application
;   1208  1	!
;   1209  1	! FORMAL PARAMETERS:
;   1210  1	!
;   1211  1	!	ARGBLK          Argument block address of the port in AC1.
;   1212  1	!
;   1213  1	! IMPLICIT INPUTS:
;   1214  1	!
;   1215  1	!	none
;   1216  1	!
;   1217  1	! IMPLICIT OUTPUTS:
;   1218  1	!
;   1219  1	!	none
;   1220  1	!
;   1221  1	! COMPLETION CODES:
;   1222  1	!
;   1223  1	!	none
;   1224  1	!
;   1225  1	! SIDE EFFECTS:
;   1226  1	!
;   1227  1	!	none
;   1228  1	!
;   1229  1	!--
;   1230  1	
;   1231  2	    begin
;   1232  2	
;   1233  2	    local
;   1234  2	        POINTER,
;   1235  2	        LENGTH,
;   1236  2		PORT: ref PORT_CONTROL_BLOCK,
;   1237  2		DATA_BASE: ref USER_DATA_BASE;
;   1238  2	
;   1239  2	    ! Verify for legal port number and port data base
;   1240  2	
;   1241  2	    if (PORT = GAM$VERIFY_PORT (.ARGBLK[RCN_PORT_NUMBER], AF_RCN)) neq 0
;   1242  2	    then DATA_BASE = .PORT[PCB_DATA_BASE] ! Get user data base address
;   1243  3	    else begin                          ! Failed to get port control block
;   1244  3	         ARGBLK[RCN_RETURN_CODE] = AC_BPN;
;   1245  3	         return;
;   1246  2	         end;
;   1247  2	
;   1248  2	    if .PORT[PCB_STATE] eql AS_RCN
;   1249  2	            then 
;   1250  2	            GAP$O_RECONNECT (.ARGBLK, .PORT[PCB_OUTPUT_BUFFER], LENGTH)
;   1251  3	            else begin
;   1252  3	                 ARGBLK[RCN_RETURN_CODE] = AC_RCE;
;   1253  3	                 return;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  43
Version 1.0	A_RCN						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (11)

;   1254  2	                 end;
;   1255  2	
;   1256  2	
;   1257  2	    POINTER = ch$ptr (.PORT[PCB_OUTPUT_BUFFER],,8); ! Pointer to message buffer
;   1258  2	
;   1259  2	    if GAD$SEND_DATA (.PORT[PCB_JFN], .POINTER, .LENGTH)
;   1260  3	      then begin                               ! Send Reconnect request
;   1261  3	           PORT[PCB_STATE] = AS_BNW;           ! Update port state
;   1262  3	           ch$fill (0, .DATA_BASE[UDB_DATA_LENGTH], ch$ptr (DATA_BASE[UDB_USER_DATA],,8));
;   1263  3	           DATA_BASE[UDB_DATA_LENGTH] = 0;
;   1264  3	           end
;   1265  3	      else begin
;   1266  3	           ARGBLK[RCN_RETURN_CODE] = AC_SER;
;   1267  3	           return;
;   1268  2	           end;
;   1269  2	
;   1270  2	    ARGBLK[RCN_RETURN_CODE] = AC_SUC;
;   1271  2	
;   1272  2	    return;
;   1273  1	    end;                                ! End of A_RCN


A_RCN:: PUSH	SP,AC1				; SP,AC1				401320' 261 17 0 00 000001		1202
	PUSH	SP,AC2				; SP,AC2				401321' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401322' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401323' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401324' 261 17 0 00 000005
	PUSH	SP,AC13				; SP,AC13				401325' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				401326' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				401327' 261 17 0 00 000016
	ADJSP	SP,1				; SP,1					401330' 105 17 0 00 000001
	MOVE	AC16,AC1			; ARGBLK,AC1				401331' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401332' 261 17 0 16 000000		1241
	PUSH	SP,C.29				; SP,[11]				401333' 261 17 0 00 401424'
	PUSHJ	SP,GAMVFY			; SP,GAMVFY				401334' 260 17 0 00 000000V
	MOVE	AC14,AC1			; PORT,AC1				401335' 200 14 0 00 000001
	ADJSP	SP,-2				; SP,-2					401336' 105 17 0 00 777776
	JUMPE	AC14,L.63			; PORT,L.63				401337' 322 14 0 00 401342'
	HLRZ	AC13,2(AC14)			; DATA_BASE,2(PORT)			401340' 554 13 0 14 000002		1242
	JRST	L.64				; L.64					401341' 254 00 0 00 401344'		1241
L.63:	MOVEI	AC1,1000			; AC1,1000				401342' 201 01 0 00 001000		1244
	JRST	L.68				; L.68					401343' 254 00 0 00 401407'
L.64:	LDB	AC1,C.6				; AC1,[POINT 9,0(AC14),26]  <9,9>	401344' 135 01 0 00 400176'		1248
	CAIE	AC1,5				; AC1,5					401345' 302 01 0 00 000005
	JRST	L.65				; L.65					401346' 254 00 0 00 401357'
	PUSH	SP,AC16				; SP,ARGBLK				401347' 261 17 0 00 000016		1250
	HLRZ	AC1,3(AC14)			; AC1,3(PORT)				401350' 554 01 0 14 000003
	PUSH	SP,AC1				; SP,AC1				401351' 261 17 0 00 000001
	MOVEI	AC1,-2(SP)			; AC1,LENGTH				401352' 201 01 0 17 777776
	PUSH	SP,AC1				; SP,AC1				401353' 261 17 0 00 000001
	PUSHJ	SP,GPORCN			; SP,GPORCN				401354' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					401355' 105 17 0 00 777775
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  44
Version 1.0	A_RCN						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (11)

	JRST	L.66				; L.66					401356' 254 00 0 00 401361'		1248
L.65:	MOVEI	AC1,40000			; AC1,40000				401357' 201 01 0 00 040000		1252
	JRST	L.68				; L.68					401360' 254 00 0 00 401407'
L.66:	HLRZ	AC1,3(AC14)			; AC1,3(PORT)				401361' 554 01 0 14 000003		1257
	MOVEI	AC1,-1(AC1)			; AC1,-1(AC1)				401362' 201 01 0 01 777777
	HRLI	AC1,41000			; AC1,41000				401363' 505 01 0 00 041000
	LDB	AC2,C.7				; AC2,[POINT 9,0(AC14),35]  <0,9>	401364' 135 02 0 00 400177'		1259
	PUSH	SP,AC2				; SP,AC2				401365' 261 17 0 00 000002
	PUSH	SP,AC1				; SP,POINTER				401366' 261 17 0 00 000001
	PUSH	SP,-2(SP)			; SP,LENGTH				401367' 261 17 0 17 777776
	PUSHJ	SP,GADSEN			; SP,GADSEN				401370' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					401371' 105 17 0 00 777775
	TRNN	AC1,1				; AC1,1					401372' 606 01 0 00 000001
	JRST	L.67				; L.67					401373' 254 00 0 00 401406'
	MOVEI	AC1,1				; AC1,1					401374' 201 01 0 00 000001		1261
	DPB	AC1,C.6				; AC1,[POINT 9,0(AC14),26]  <9,9>	401375' 137 01 0 00 400176'
	MOVEI	AC5,110(AC13)			; AC5,110(DATA_BASE)			401376' 201 05 0 13 000110		1262
	HRLI	AC5,41000			; AC5,41000				401377' 505 05 0 00 041000
	SETZB	AC1,AC2				; AC1,AC2				401400' 403 01 0 00 000002
	HLRE	AC4,1(AC13)			; AC4,1(DATA_BASE)			401401' 574 04 0 13 000001
	EXTEND	AC1,C.18			; AC1,C.18				401402' 123 01 0 00 400720'
	JFCL					; 					401403' 255 00 0 00 000000
	HRRZS	1(AC13)				; 1(DATA_BASE)				401404' 553 00 0 13 000001		1263
	JRST	L.69				; L.69					401405' 254 00 0 00 401411'		1259
L.67:	MOVEI	AC1,20000			; AC1,20000				401406' 201 01 0 00 020000		1266
L.68:	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401407' 202 01 0 16 000001
	JRST	L.70				; L.70					401410' 254 00 0 00 401412'		1265
L.69:	SETZM	1(AC16)				; 1(ARGBLK)				401411' 402 00 0 16 000001		1270
L.70:	ADJSP	SP,-1				; SP,-1					401412' 105 17 0 00 777777		1202
	POP	SP,AC16				; SP,AC16				401413' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				401414' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				401415' 262 17 0 00 000013
	POP	SP,AC5				; SP,AC5				401416' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401417' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401420' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401421' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401422' 262 17 0 00 000001
	POPJ	SP,				; SP,					401423' 263 17 0 00 000000
C.29:	EXP	11				; 11					401424' 000000	000011

; Routine Size:  69 words


;   1274  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  45
Version 1.0	A_TRA						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (12)

;   1275  1	%global_routine ('A_TRA', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1276  1	
;   1277  1	!++
;   1278  1	! FUNCTIONAL DESCRIPTION:
;   1279  1	!
;   1280  1	!       A%TRA          Transmit data to an IBM appliction
;   1281  1	!
;   1282  1	! FORMAL PARAMETERS:
;   1283  1	!
;   1284  1	!	ARGBLK          Argument block address of the port in AC1.
;   1285  1	!
;   1286  1	! IMPLICIT INPUTS:
;   1287  1	!
;   1288  1	!	none
;   1289  1	!
;   1290  1	! IMPLICIT OUTPUTS:
;   1291  1	!
;   1292  1	!	none
;   1293  1	!
;   1294  1	! COMPLETION CODES:
;   1295  1	!
;   1296  1	!	none
;   1297  1	!
;   1298  1	! SIDE EFFECTS:
;   1299  1	!
;   1300  1	!	none
;   1301  1	!
;   1302  1	!--
;   1303  1	
;   1304  2	    begin
;   1305  2	
;   1306  2	    local
;   1307  2		LENGTH,
;   1308  2		PTR,
;   1309  2		PORT: ref PORT_CONTROL_BLOCK;
;   1310  2	
;   1311  2	    ! Verify for legal port number and port data base
;   1312  2	
;   1313  2	    if (PORT = GAM$VERIFY_PORT (.ARGBLK[TRA_PORT_NUMBER], AF_TRA)) eql 0
;   1314  3	    then begin
;   1315  3	         ARGBLK[TRA_RETURN_CODE] = AC_BPN;
;   1316  3	         return;
;   1317  2	         end;
;   1318  2	
;   1319  2	    ! Check data length with current packet size of the port. If
;   1320  2	    ! length exceeds packet size then return without sending any data.
;   1321  2	
;   1322  2	    if .ARGBLK[TRA_DATA_LENGTH] gtr .PORT[PCB_PACKET_SIZE]
;   1323  3	    then begin
;   1324  3	         ARGBLK[TRA_RETURN_CODE] = AC_BTL;
;   1325  3	         return;
;   1326  2	         end;
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  46
Version 1.0	A_TRA						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (12)

;   1327  2	
;   1328  2	    ! Assemble protocol DATA message
;   1329  2	
;   1330  2	    if .ARGBLK[TRA_DATA_TYPE]
;   1331  3	    then begin 
;   1332  3	         local COUNT,
;   1333  3	                     TMPBUF: block [6];
;   1334  3	
;   1335  3	         ! Assemble protocol SEND INTERRUPT message
;   1336  3	
;   1337  3	              XERO (TMPBUF, 6);
;   1338  3	              PTR = ch$ptr (TMPBUF,,8);
;   1339  3	              PTR = ch$move (2, ch$ptr (ARGBLK[TRA_SEQ_NUMBER],,8), .PTR);
;   1340  3	              PTR = ch$move (3, ch$ptr (ARGBLK[TRA_RH],,8), .PTR);
;   1341  3	              ch$move (.ARGBLK[TRA_DATA_LENGTH], .ARGBLK[TRA_DATA_POINTER], .PTR);
;   1342  3	              PTR = ch$ptr (TMPBUF,,8);
;   1343  3	              COUNT = .ARGBLK[TRA_DATA_LENGTH] + 5;
;   1344  3	
;   1345  3	         if not GAD$SEND_INTERRUPT (.PORT[PCB_JFN], .PTR, .COUNT)
;   1346  3	            then ARGBLK[TRA_RETURN_CODE] = AC_SIE
;   1347  4	            else begin
;   1348  4	                 ARGBLK[TRA_RETURN_CODE] = AC_SUC;
;   1349  4	                 ARGBLK[TRA_DATA_LENGTH] = .COUNT - 5;
;   1350  3	                 end;
;   1351  3	         end
;   1352  3	
;   1353  3	    else begin
;   1354  3	         GAP$O_DATA (.ARGBLK, .PORT[PCB_OUTPUT_BUFFER], LENGTH);
;   1355  3	
;   1356  4	         if (.PORT[PCB_STATE] eql AS_RUN)
;   1357  3	         and GAD$SEND_DATA (.PORT[PCB_JFN], ch$ptr (.PORT[PCB_OUTPUT_BUFFER],,8), .LENGTH)
;   1358  3	             then ARGBLK[TRA_RETURN_CODE] = AC_SUC
;   1359  3	             else ARGBLK[TRA_RETURN_CODE] = AC_SER;
;   1360  2	         end;
;   1361  2	
;   1362  2	    return;
;   1363  1	    end;                                ! End of A_TRA


A_TRA:: PUSH	SP,AC1				; SP,AC1				401425' 261 17 0 00 000001		1275
	PUSH	SP,AC2				; SP,AC2				401426' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401427' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401430' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401431' 261 17 0 00 000005
	PUSH	SP,AC12				; SP,AC12				401432' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				401433' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				401434' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				401435' 261 17 0 00 000016
	ADJSP	SP,7				; SP,7					401436' 105 17 0 00 000007
	MOVE	AC16,AC1			; ARGBLK,AC1				401437' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401440' 261 17 0 16 000000		1313
	PUSH	SP,C.30				; SP,[12]				401441' 261 17 0 00 401612'
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  47
Version 1.0	A_TRA						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (12)

	PUSHJ	SP,GAMVFY			; SP,GAMVFY				401442' 260 17 0 00 000000V
	MOVE	AC13,AC1			; PORT,AC1				401443' 200 13 0 00 000001
	ADJSP	SP,-2				; SP,-2					401444' 105 17 0 00 777776
	JUMPN	AC13,L.71			; PORT,L.71				401445' 326 13 0 00 401450'
	MOVEI	AC1,1000			; AC1,1000				401446' 201 01 0 00 001000		1315
	JRST	L.72				; L.72					401447' 254 00 0 00 401455'
L.71:	HRRE	AC1,2(AC16)			; AC1,2(ARGBLK)				401450' 570 01 0 16 000002		1322
	HRRZ	AC2,2(AC13)			; AC2,2(PORT)				401451' 550 02 0 13 000002
	CAMG	AC1,AC2				; AC1,AC2				401452' 317 01 0 00 000002
	JRST	L.73				; L.73					401453' 254 00 0 00 401457'
	MOVEI	AC1,2000			; AC1,2000				401454' 201 01 0 00 002000		1324
L.72:	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401455' 202 01 0 16 000001
	JRST	L.78				; L.78					401456' 254 00 0 00 401577'		1323
L.73:	SKIPL	2(AC16)				; 2(ARGBLK)				401457' 331 00 0 16 000002		1330
	JRST	L.75				; L.75					401460' 254 00 0 00 401546'
	SETZM	-6(SP)				; TMPBUF				401461' 402 00 0 17 777772		1337
	MOVEI	AC2,-6(SP)			; AC2,TMPBUF				401462' 201 02 0 17 777772
	HRL	AC1,AC2				; AC,AC2				401463' 504 01 0 00 000002
	MOVEI	AC2,-5(SP)			; AC2,TMPBUF+1				401464' 201 02 0 17 777773
	HRR	AC1,AC2				; AC,AC2				401465' 540 01 0 00 000002
	BLT	AC1,-1(SP)			; AC,TMPBUF+5				401466' 251 01 0 17 777777
	MOVEI	AC5,-7(SP)			; AC5,TMPBUF-1				401467' 201 05 0 17 777771		1338
	HRLI	AC5,41000			; AC5,41000				401470' 505 05 0 00 041000
	MOVE	AC3,AC5				; PTR,AC5				401471' 200 03 0 00 000005
	MOVEI	AC2,3(AC16)			; AC2,3(ARGBLK)				401472' 201 02 0 16 000003		1339
	HRLI	AC2,41000			; AC2,41000				401473' 505 02 0 00 041000
	MOVEI	AC1,2				; AC1,2					401474' 201 01 0 00 000002
	MOVEI	AC4,2				; AC4,2					401475' 201 04 0 00 000002
	MOVE	AC5,AC3				; AC5,PTR				401476' 200 05 0 00 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401477' 123 01 0 00 400717'
	JFCL					; 					401500' 255 00 0 00 000000
	MOVE	AC3,AC5				; PTR,AC5				401501' 200 03 0 00 000005
	MOVEI	AC2,4(AC16)			; AC2,4(ARGBLK)				401502' 201 02 0 16 000004		1340
	HRLI	AC2,41000			; AC2,41000				401503' 505 02 0 00 041000
	MOVEI	AC1,3				; AC1,3					401504' 201 01 0 00 000003
	MOVEI	AC4,3				; AC4,3					401505' 201 04 0 00 000003
	MOVE	AC5,AC3				; AC5,PTR				401506' 200 05 0 00 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401507' 123 01 0 00 400717'
	JFCL					; 					401510' 255 00 0 00 000000
	MOVE	AC3,AC5				; PTR,AC5				401511' 200 03 0 00 000005
	HRRE	AC1,2(AC16)			; AC1,2(ARGBLK)				401512' 570 01 0 16 000002		1341
	MOVE	AC2,3(AC16)			; AC2,3(ARGBLK)				401513' 200 02 0 16 000003
	HRRE	AC4,2(AC16)			; AC4,2(ARGBLK)				401514' 570 04 0 16 000002
	MOVE	AC5,AC3				; AC5,PTR				401515' 200 05 0 00 000003
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				401516' 123 01 0 00 400717'
	JFCL					; 					401517' 255 00 0 00 000000
	MOVEI	AC5,-7(SP)			; AC5,TMPBUF-1				401520' 201 05 0 17 777771		1342
	HRLI	AC5,41000			; AC5,41000				401521' 505 05 0 00 041000
	MOVE	AC3,AC5				; PTR,AC5				401522' 200 03 0 00 000005
	HRRE	AC14,2(AC16)			; COUNT,2(ARGBLK)			401523' 570 14 0 16 000002		1343
	ADDI	AC14,5				; COUNT,5				401524' 271 14 0 00 000005
	MOVE	AC12,AC16			; AC12,ARGBLK				401525' 200 12 0 00 000016		1346
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  48
Version 1.0	A_TRA						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (12)

	ADDI	AC12,1				; AC12,1				401526' 271 12 0 00 000001
	LDB	AC1,C.1				; AC1,[POINT 9,0(AC13),35]  <0,9>	401527' 135 01 0 00 400120'		1345
	PUSH	SP,AC1				; SP,AC1				401530' 261 17 0 00 000001
	PUSH	SP,AC3				; SP,PTR				401531' 261 17 0 00 000003
	PUSH	SP,AC14				; SP,COUNT				401532' 261 17 0 00 000014
	PUSHJ	SP,GADSNI			; SP,GADSNI				401533' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					401534' 105 17 0 00 777775
	TRNE	AC1,1				; AC1,1					401535' 602 01 0 00 000001
	JRST	L.74				; L.74					401536' 254 00 0 00 401542'
	MOVEI	AC1,100000			; AC1,100000				401537' 201 01 0 00 100000		1346
	MOVEM	AC1,0(AC12)			; AC1,0(AC12)				401540' 202 01 0 12 000000
	JRST	L.78				; L.78					401541' 254 00 0 00 401577'		1345
L.74:	SETZM	0(AC12)				; 0(AC12)				401542' 402 00 0 12 000000		1348
	SUBI	AC14,5				; COUNT,5				401543' 275 14 0 00 000005		1349
	HRRM	AC14,2(AC16)			; COUNT,2(ARGBLK)			401544' 542 14 0 16 000002
	JRST	L.78				; L.78					401545' 254 00 0 00 401577'		1330
L.75:	PUSH	SP,AC16				; SP,ARGBLK				401546' 261 17 0 00 000016		1354
	HLRZ	AC14,3(AC13)			; AC14,3(PORT)				401547' 554 14 0 13 000003
	PUSH	SP,AC14				; SP,AC14				401550' 261 17 0 00 000014
	MOVEI	AC1,-2(SP)			; AC1,LENGTH				401551' 201 01 0 17 777776
	PUSH	SP,AC1				; SP,AC1				401552' 261 17 0 00 000001
	PUSHJ	SP,GPODAT			; SP,GPODAT				401553' 260 17 0 00 000000*
	ADDI	AC16,1				; ARGBLK,1				401554' 271 16 0 00 000001		1358
	LDB	AC1,C.2				; AC1,[POINT 9,0(AC13),26]  <9,9>	401555' 135 01 0 00 400121'		1356
	CAIE	AC1,4				; AC1,4					401556' 302 01 0 00 000004
	JRST	L.76				; L.76					401557' 254 00 0 00 401574'
	LDB	AC1,C.1				; AC1,[POINT 9,0(AC13),35]  <0,9>	401560' 135 01 0 00 400120'		1357
	PUSH	SP,AC1				; SP,AC1				401561' 261 17 0 00 000001
	MOVEI	AC1,-1(AC14)			; AC1,-1(AC14)				401562' 201 01 0 14 777777
	HRLI	AC1,41000			; AC1,41000				401563' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				401564' 261 17 0 00 000001
	PUSH	SP,-5(SP)			; SP,LENGTH				401565' 261 17 0 17 777773
	PUSHJ	SP,GADSEN			; SP,GADSEN				401566' 260 17 0 00 000000*
	ADJSP	SP,-3				; SP,-3					401567' 105 17 0 00 777775
	TRNN	AC1,1				; AC1,1					401570' 606 01 0 00 000001
	JRST	L.76				; L.76					401571' 254 00 0 00 401574'
	SETZM	0(AC16)				; 0(AC16)				401572' 402 00 0 16 000000		1358
	JRST	L.77				; L.77					401573' 254 00 0 00 401576'		1356
L.76:	MOVEI	AC1,20000			; AC1,20000				401574' 201 01 0 00 020000		1359
	MOVEM	AC1,0(AC16)			; AC1,0(AC16)				401575' 202 01 0 16 000000
L.77:	ADJSP	SP,-3				; SP,-3					401576' 105 17 0 00 777775		1353
L.78:	ADJSP	SP,-7				; SP,-7					401577' 105 17 0 00 777771		1275
	POP	SP,AC16				; SP,AC16				401600' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				401601' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				401602' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				401603' 262 17 0 00 000012
	POP	SP,AC5				; SP,AC5				401604' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401605' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401606' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401607' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401610' 262 17 0 00 000001
	POPJ	SP,				; SP,					401611' 263 17 0 00 000000
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  49
Version 1.0	A_TRA						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (12)

C.30:	EXP	12				; 12					401612' 000000	000012

; Routine Size:  118 words


;   1364  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  50
Version 1.0	A_TER						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (13)

;   1365  1	%global_routine ('A_TER', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1366  1	
;   1367  1	!++
;   1368  1	! FUNCTIONAL DESCRIPTION:
;   1369  1	!
;   1370  1	!       A%TER           Terminate Port Access
;   1371  1	!
;   1372  1	! FORMAL PARAMETERS:
;   1373  1	!
;   1374  1	!	ARGBLK          Argument block address of the port in AC1.
;   1375  1	!
;   1376  1	! IMPLICIT INPUTS:
;   1377  1	!
;   1378  1	!	none
;   1379  1	!
;   1380  1	! IMPLICIT OUTPUTS:
;   1381  1	!
;   1382  1	!	none
;   1383  1	!
;   1384  1	! COMPLETION CODES:
;   1385  1	!
;   1386  1	!	none
;   1387  1	!
;   1388  1	! SIDE EFFECTS:
;   1389  1	!
;   1390  1	!	none
;   1391  1	!
;   1392  1	!--
;   1393  1	
;   1394  2	    begin
;   1395  2	
;   1396  2	    local
;   1397  2		PORT: ref PORT_CONTROL_BLOCK;
;   1398  2	    
;   1399  2	    ! Verify for legal port number and port data base
;   1400  2	
;   1401  2	    if (PORT = GAM$VERIFY_PORT (.ARGBLK[TER_PORT_NUMBER], AF_TER)) eql 0
;   1402  3	    then begin
;   1403  3	         ARGBLK[TER_RETURN_CODE] = AC_BPN;
;   1404  3	         return;
;   1405  2	         end;
;   1406  2	    
;   1407  2	    PORT[PCB_STATE] = AS_ABG;                ! Port state aborting
;   1408  2	
;   1409  2	    ! Send TERMINATE message
;   1410  2	
;   1411  2	    GAL$TERMINATE (.PORT[PCB_JFN], .ARGBLK[TER_SENSE_CODE], AR_UAB);
;   1412  2	
;   1413  2	    ! Disconnect logical link 
;   1414  2	
;   1415  2	    if not GAD$DISCONNECT_LINK (.PORT[PCB_JFN])
;   1416  2	    then GAD$ABORT_LINK (.PORT[PCB_JFN]);
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  51
Version 1.0	A_TER						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (13)

;   1417  2	    ARGBLK[TER_RETURN_CODE] = AC_SUC;
;   1418  2	
;   1419  2	    PORT[PCB_STATE] = AS_ABD;
;   1420  2	
;   1421  2	    ! Erase port data base
;   1422  2	
;   1423  2	    FREECI = .FREECI - 1;
;   1424  2	    FREECP[.FREECI] = .ARGBLK[TER_PORT_NUMBER];
;   1425  2	
;   1426  2	    return;
;   1427  1	    end;                                ! End of A_TER


A_TER:: PUSH	SP,AC1				; SP,AC1				401613' 261 17 0 00 000001		1365
	PUSH	SP,AC2				; SP,AC2				401614' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401615' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401616' 261 17 0 00 000004
	PUSH	SP,AC5				; SP,AC5				401617' 261 17 0 00 000005
	PUSH	SP,AC14				; SP,AC14				401620' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				401621' 261 17 0 00 000016
	MOVE	AC16,AC1			; ARGBLK,AC1				401622' 200 16 0 00 000001
	PUSH	SP,0(AC16)			; SP,0(ARGBLK)				401623' 261 17 0 16 000000		1401
	PUSH	SP,C.31				; SP,[13]				401624' 261 17 0 00 401674'
	PUSHJ	SP,GAMVFY			; SP,GAMVFY				401625' 260 17 0 00 000000V
	MOVE	AC14,AC1			; PORT,AC1				401626' 200 14 0 00 000001
	ADJSP	SP,-2				; SP,-2					401627' 105 17 0 00 777776
	JUMPN	AC14,L.79			; PORT,L.79				401630' 326 14 0 00 401634'
	MOVEI	AC1,1000			; AC1,1000				401631' 201 01 0 00 001000		1403
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401632' 202 01 0 16 000001
	JRST	L.81				; L.81					401633' 254 00 0 00 401664'		1402
L.79:	MOVEI	AC1,6				; AC1,6					401634' 201 01 0 00 000006		1407
	DPB	AC1,C.6				; AC1,[POINT 9,0(AC14),26]  <9,9>	401635' 137 01 0 00 400176'
	LDB	AC1,C.7				; AC1,[POINT 9,0(AC14),35]  <0,9>	401636' 135 01 0 00 400177'		1411
	PUSH	SP,AC1				; SP,AC1				401637' 261 17 0 00 000001
	PUSH	SP,2(AC16)			; SP,2(ARGBLK)				401640' 261 17 0 16 000002
	PUSH	SP,C.32				; SP,[144]				401641' 261 17 0 00 401675'
	PUSHJ	SP,GALTER			; SP,GALTER				401642' 260 17 0 00 000000*
	LDB	AC1,C.7				; AC1,[POINT 9,0(AC14),35]  <0,9>	401643' 135 01 0 00 400177'		1415
	PUSH	SP,AC1				; SP,AC1				401644' 261 17 0 00 000001
	PUSHJ	SP,GADDIS			; SP,GADDIS				401645' 260 17 0 00 000000*
	ADJSP	SP,-1				; SP,-1					401646' 105 17 0 00 777777
	TRNE	AC1,1				; AC1,1					401647' 602 01 0 00 000001
	JRST	L.80				; L.80					401650' 254 00 0 00 401655'
	LDB	AC1,C.7				; AC1,[POINT 9,0(AC14),35]  <0,9>	401651' 135 01 0 00 400177'		1416
	PUSH	SP,AC1				; SP,AC1				401652' 261 17 0 00 000001
	PUSHJ	SP,GADABT			; SP,GADABT				401653' 260 17 0 00 000000*
	ADJSP	SP,-1				; SP,-1					401654' 105 17 0 00 777777
L.80:	SETZM	1(AC16)				; 1(ARGBLK)				401655' 402 00 0 16 000001		1417
	MOVEI	AC1,7				; AC1,7					401656' 201 01 0 00 000007		1419
	DPB	AC1,C.6				; AC1,[POINT 9,0(AC14),26]  <9,9>	401657' 137 01 0 00 400176'
	SOS	AC1,FREECI			; AC1,FREECI				401660' 370 01 0 00 000000*		1424
	MOVE	AC2,0(AC16)			; AC2,0(ARGBLK)				401661' 200 02 0 16 000000
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  52
Version 1.0	A_TER						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (13)

	MOVEM	AC2,FREECP(AC1)			; AC2,FREECP(AC1)			401662' 202 02 0 01 000000*
	ADJSP	SP,-3				; SP,-3					401663' 105 17 0 00 777775		1426
L.81:	POP	SP,AC16				; SP,AC16				401664' 262 17 0 00 000016		1365
	POP	SP,AC14				; SP,AC14				401665' 262 17 0 00 000014
	POP	SP,AC5				; SP,AC5				401666' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				401667' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				401670' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				401671' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				401672' 262 17 0 00 000001
	POPJ	SP,				; SP,					401673' 263 17 0 00 000000
C.31:	EXP	13				; 13					401674' 000000	000013
C.32:	EXP	144				; 144					401675' 000000	000144

; Routine Size:  51 words


;   1428  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  53
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

;   1429  1	%global_routine ('A_LIS', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1430  1	
;   1431  1	!++
;   1432  1	! FUNCTIONAL DESCRIPTION:
;   1433  1	!
;   1434  1	!       A%LIS           Listen for IBM BIND connect
;   1435  1	!
;   1436  1	! FORMAL PARAMETERS:
;   1437  1	!
;   1438  1	!	ARGBLK          Argument block address of the port in AC1.
;   1439  1	!
;   1440  1	! IMPLICIT INPUTS:
;   1441  1	!
;   1442  1	!	none
;   1443  1	!
;   1444  1	! IMPLICIT OUTPUTS:
;   1445  1	!
;   1446  1	!	none
;   1447  1	!
;   1448  1	! COMPLETION CODES:
;   1449  1	!
;   1450  1	!	none
;   1451  1	!
;   1452  1	! SIDE EFFECTS:
;   1453  1	!
;   1454  1	!	none
;   1455  1	!
;   1456  1	!--
;   1457  1	
;   1458  2	    begin
;   1459  2	
;   1460  2	    own
;   1461  2	        DESCRIPTOR: CH$SEQUENCE (80);
;   1462  2	
;   1463  2	    local
;   1464  2	        SNABUF: CH$SEQUENCE (280, 8);
;   1465  2	
;   1466  2	    local
;   1467  2		JFN,
;   1468  2	        PTR,
;   1469  2	        LENGTH,
;   1470  2	        SNA_GATEWAY,
;   1471  2	        STATUS,
;   1472  2	        BUF: block [2],
;   1473  2	        POINTER,
;   1474  2	        OBJECT,
;   1475  2	        SYSERR,
;   1476  2	  	PORT: ref PORT_CONTROL_BLOCK,
;   1477  2	        DATA_BASE: ref USER_DATA_BASE;
;   1478  2	
;   1479  2	    if .FREECI geq MAXIMUM_SUPPORTED_PORTS
;   1480  3	    then begin                          ! Run out of ports to allocate
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  54
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

;   1481  3	         ARGBLK[LIS_RETURN_CODE] = AC_IAR;
;   1482  3	         return;
;   1483  2	         end;
;   1484  2	
;   1485  2	    DATA_BASE = .ARGBLK[WORKING_AREA];  ! Get port data base
;   1486  2	
;   1487  2	    ! Get the target task name
;   1488  2	
;   1489  2	    POINTER = ch$ptr (DESCRIPTOR);
;   1490  2	    OBJECT = ch$ptr (uplit ('-10'));
;   1491  2	
;   1492  2	    STATUS = GAD$NETWORK_DESCRIPTOR (.POINTER, .ARGBLK[LIS_NODE_NAME], .OBJECT);   
;   1493  2	
;   1494  2	    if .STATUS neq $TRUE
;   1495  3	        then begin                         ! Failed to build the DCN: filespec
;   1496  4	             ARGBLK[LIS_RETURN_CODE] = (selectone .STATUS of
;   1497  4	                                        set
;   1498  4	                                        [-1]: AC_NLN;
;   1499  4	                                        [otherwise]: AC_PER;
;   1500  3	                                        tes);
;   1501  3	                                        return;
;   1502  2	              end;
;   1503  2	
;   1504  2	    STATUS = GAD$OPEN_LINK (.POINTER, JFN, SYSERR); 
;   1505  2	
;   1506  2	    if .STATUS neq $TRUE
;   1507  3	    then begin                          ! Failed to connect to the Gateway
;   1508  4	         ARGBLK[LIS_RETURN_CODE] = (selectone .STATUS of
;   1509  4	                                        set
;   1510  4	                                        [$FALSE]: AC_DCE;
;   1511  4	                                        [-1]: AC_DCE;
;   1512  4	                                        [otherwise]: AC_PER;
;   1513  3	                                        tes);
;   1514  3	         ARGBLK[LIS_NODE_NAME] = .SYSERR;
;   1515  3	
;   1516  3	         return;
;   1517  2	         end;
;   1518  2	
;   1519  2	    ! Assemble protocol message
;   1520  2	
;   1521  2	    GAP$O_LISTEN (.ARGBLK, SNABUF, LENGTH);
;   1522  2	
;   1523  2	    ! Send LISTEN for BIND message to Gateway node
;   1524  2	
;   1525  2	    if not GAD$EC_SEND_DATA (.JFN, ch$ptr (SNABUF,,8), .LENGTH, SYSERR)
;   1526  3	    then begin
;   1527  3	         GAD$ABORT_LINK (.JFN);
;   1528  3	         ARGBLK[LIS_RETURN_CODE] = .ARGBLK[LIS_RETURN_CODE] or AC_DCE;
;   1529  3	         ARGBLK[LIS_NODE_NAME] = .SYSERR
;   1530  3	         end
;   1531  3	    else begin
;   1532  3	         local 	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  55
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

;   1533  3			INTERRUPT_CHANNEL,
;   1534  3			PORT_NUMBER,
;   1535  3			LEN, 
;   1536  3			PTR;
;   1537  3	
;   1538  3		 INTERRUPT_CHANNEL = .ARGBLK[LIS_PORT_NUMBER];
;   1539  3		 ARGBLK[LIS_PORT_NUMBER] = PORT_NUMBER = .FREECP[.FREECI];
;   1540  3	         FREECI = .FREECI + 1;          ! Push down on stack
;   1541  3	
;   1542  3	         PORT = SNAVCB[.PORT_NUMBER,PCB_BLOCK_FIELD]; ! Get control block
;   1543  3	         ch$fill (0, PORT_CONTROL_BLOCK_SIZE, ch$ptr (.PORT,,36));
;   1544  3	
;   1545  3	         PORT[PCB_JFN] = .JFN;          ! Save DECnet logical link JFN
;   1546  3	         PORT[PCB_STATE] = AS_BNW;      ! Set port state to BINDWAIT
;   1547  3	         PORT[PCB_ERROR] = 0;           ! No error
;   1548  3	         PORT[PCB_RCV_INTERRUPT] = $FALSE;
;   1549  3	         PORT[PCB_PACKET_SIZE] = 0;
;   1550  3	         PORT[PCB_RESET_SEEN] = 0;      ! No reset seen yet
;   1551  3	         PORT[PCB_DATA_BASE] = .DATA_BASE; ! Save user data base address
;   1552  3	         PORT[PCB_INPUT_BUFFER] = SNAIOB[.PORT_NUMBER,IOB_INPUT_BUFFER];
;   1553  3	         PORT[PCB_OUTPUT_BUFFER] = SNAIOB[.PORT_NUMBER,IOB_OUTPUT_BUFFER];
;   1554  3	
;   1555  3	         if GAD$PSI_CHANNELS (.JFN, .INTERRUPT_CHANNEL)
;   1556  3	         then ARGBLK[LIS_RETURN_CODE] = AC_SUC
;   1557  4	         else begin                     ! Failed to set up PSI channel
;   1558  4	              GAD$ABORT_LINK (.JFN);
;   1559  4	              ARGBLK[LIS_RETURN_CODE] = .ARGBLK[LIS_RETURN_CODE] or AC_PSE;
;   1560  4	              return;
;   1561  3	              end;
;   1562  3	
;   1563  3	
;   1564  3	         if .PORT[PCB_PACKET_SIZE] leq 0
;   1565  3	         then PORT[PCB_PACKET_SIZE] = 1 ^ AF_STANDARD_PACKET_SIZE;
;   1566  2	         end;
;   1567  2	
;   1568  2	    return;
;   1569  1	    end;                                ! End of A_LIS


P.AAB:	BYTE	(7)"-","1","0",000,000		; -10					401676' 055 061 060 000 000


	RELOC	0				;					000000'
DESCRIPTOR:
	BLOCK	20				;					000000'


	RELOC	401677				;					401677'
A_LIS:: PUSH	SP,AC1				; SP,AC1				401677' 261 17 0 00 000001		1429
	PUSH	SP,AC2				; SP,AC2				401700' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				401701' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				401702' 261 17 0 00 000004
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  56
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

	PUSH	SP,AC5				; SP,AC5				401703' 261 17 0 00 000005
	PUSH	SP,AC11				; SP,AC11				401704' 261 17 0 00 000011
	PUSH	SP,AC12				; SP,AC12				401705' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				401706' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				401707' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				401710' 261 17 0 00 000016
	ADJSP	SP,113				; SP,113				401711' 105 17 0 00 000113
	MOVE	AC16,AC1			; ARGBLK,AC1				401712' 200 16 0 00 000001
	MOVEI	AC1,24				; AC1,24				401713' 201 01 0 00 000024		1479
	CAMLE	AC1,FREECI			; AC1,FREECI				401714' 313 01 0 00 000000*
	JRST	L.82				; L.82					401715' 254 00 0 00 401721'
	MOVEI	AC1,2				; AC1,2					401716' 201 01 0 00 000002		1481
	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401717' 202 01 0 16 000001
	JRST	L.94				; L.94					401720' 254 00 0 00 402077'		1480
L.82:	HRRZ	AC11,0(AC16)			; DATA_BASE,0(ARGBLK)			401721' 550 11 0 16 000000		1485
	MOVE	AC14,C.33			; POINTER,[POINT 7,DESCRIPTOR-1,34]  <1,7>
						;					401722' 200 14 0 00 402113'		1489
	MOVE	AC1,C.34			; OBJECT,[POINT 7,P.AAB-1,34]  <1,7>	401723' 200 01 0 00 402114'		1490
	PUSH	SP,AC14				; SP,POINTER				401724' 261 17 0 00 000014		1492
	PUSH	SP,2(AC16)			; SP,2(ARGBLK)				401725' 261 17 0 16 000002
	PUSH	SP,AC1				; SP,OBJECT				401726' 261 17 0 00 000001
	PUSHJ	SP,GADNET			; SP,GADNET				401727' 260 17 0 00 000000*
	CAIN	AC1,1				; STATUS,1				401730' 306 01 0 00 000001		1494
	JRST	L.85				; L.85					401731' 254 00 0 00 401742'
	CAME	AC1,C.13			; STATUS,[-1]				401732' 312 01 0 00 400532'		1498
	JRST	L.83				; L.83					401733' 254 00 0 00 401736'
	MOVEI	AC2,20				; AC2,20				401734' 201 02 0 00 000020		1496
	JRST	L.84				; L.84					401735' 254 00 0 00 401737'
L.83:	MOVEI	AC2,4				; AC2,4					401736' 201 02 0 00 000004
L.84:	MOVEM	AC2,1(AC16)			; AC2,1(ARGBLK)				401737' 202 02 0 16 000001
	ADJSP	SP,-3				; SP,-3					401740' 105 17 0 00 777775		1501
	JRST	L.94				; L.94					401741' 254 00 0 00 402077'		1495
L.85:	MOVEM	AC14,0(SP)			; POINTER,0(SP)				401742' 202 14 0 17 000000		1504
	MOVEI	AC2,-3(SP)			; AC2,JFN				401743' 201 02 0 17 777775
	PUSH	SP,AC2				; SP,AC2				401744' 261 17 0 00 000002
	MOVEI	AC2,-6(SP)			; AC2,SYSERR				401745' 201 02 0 17 777772
	PUSH	SP,AC2				; SP,AC2				401746' 261 17 0 00 000002
	PUSHJ	SP,GADOPN			; SP,GADOPN				401747' 260 17 0 00 000000*
	CAIN	AC1,1				; STATUS,1				401750' 306 01 0 00 000001		1506
	JRST	L.89				; L.89					401751' 254 00 0 00 401765'
	JUMPE	AC1,L.86			; STATUS,L.86				401752' 322 01 0 00 401755'		1510
	CAME	AC1,C.13			; STATUS,[-1]				401753' 312 01 0 00 400532'		1511
	JRST	L.87				; L.87					401754' 254 00 0 00 401757'
L.86:	MOVEI	AC1,1				; AC1,1					401755' 201 01 0 00 000001		1508
	JRST	L.88				; L.88					401756' 254 00 0 00 401760'
L.87:	MOVEI	AC1,4				; AC1,4					401757' 201 01 0 00 000004
L.88:	MOVEM	AC1,1(AC16)			; AC1,1(ARGBLK)				401760' 202 01 0 16 000001
	MOVE	AC1,-7(SP)			; AC1,SYSERR				401761' 200 01 0 17 777771		1514
	MOVEM	AC1,2(AC16)			; AC1,2(ARGBLK)				401762' 202 01 0 16 000002
	ADJSP	SP,-5				; SP,-5					401763' 105 17 0 00 777773		1516
	JRST	L.94				; L.94					401764' 254 00 0 00 402077'		1507
L.89:	MOVEM	AC16,0(SP)			; ARGBLK,0(SP)				401765' 202 16 0 17 000000		1521
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  57
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

	MOVEI	AC1,-117(SP)			; AC1,SNABUF				401766' 201 01 0 17 777661
	PUSH	SP,AC1				; SP,AC1				401767' 261 17 0 00 000001
	MOVEI	AC1,-7(SP)			; AC1,LENGTH				401770' 201 01 0 17 777771
	PUSH	SP,AC1				; SP,AC1				401771' 261 17 0 00 000001
	PUSHJ	SP,GPOLIS			; SP,GPOLIS				401772' 260 17 0 00 000000*
	MOVE	AC14,AC16			; AC14,ARGBLK				401773' 200 14 0 00 000016		1528
	ADDI	AC14,1				; AC14,1				401774' 271 14 0 00 000001
	MOVE	AC13,-7(SP)			; AC13,JFN				401775' 200 13 0 17 777771		1525
	PUSH	SP,AC13				; SP,AC13				401776' 261 17 0 00 000013
	MOVEI	AC1,-123(SP)			; AC1,SNABUF-1				401777' 201 01 0 17 777655
	HRLI	AC1,41000			; AC1,41000				402000' 505 01 0 00 041000
	PUSH	SP,AC1				; SP,AC1				402001' 261 17 0 00 000001
	PUSH	SP,-12(SP)			; SP,LENGTH				402002' 261 17 0 17 777766
	MOVEI	AC1,-14(SP)			; AC1,SYSERR				402003' 201 01 0 17 777764
	PUSH	SP,AC1				; SP,AC1				402004' 261 17 0 00 000001
	PUSHJ	SP,GADSEC			; SP,GADSEC				402005' 260 17 0 00 000000*
	ADJSP	SP,-4				; SP,-4					402006' 105 17 0 00 777774
	TRNE	AC1,1				; AC1,1					402007' 602 01 0 00 000001
	JRST	L.90				; L.90					402010' 254 00 0 00 402020'
	MOVEM	AC13,0(SP)			; AC13,0(SP)				402011' 202 13 0 17 000000		1527
	PUSHJ	SP,GADABT			; SP,GADABT				402012' 260 17 0 00 000000*
	MOVEI	AC1,1				; AC1,1					402013' 201 01 0 00 000001		1528
	IORM	AC1,0(AC14)			; AC1,0(AC14)				402014' 436 01 0 14 000000
	MOVE	AC1,-11(SP)			; AC1,SYSERR				402015' 200 01 0 17 777767		1529
	MOVEM	AC1,2(AC16)			; AC1,2(ARGBLK)				402016' 202 01 0 16 000002
	JRST	L.93				; L.93					402017' 254 00 0 00 402076'		1525
L.90:	MOVE	AC12,0(AC16)			; INTERRUPT_CHANNEL,0(ARGBLK)		402020' 200 12 0 16 000000		1538
	MOVE	AC1,FREECI			; AC1,FREECI				402021' 200 01 0 00 000000*		1539
	MOVE	AC3,FREECP(AC1)			; PORT_NUMBER,FREECP(AC1)		402022' 200 03 0 01 000000*
	MOVEM	AC3,0(AC16)			; PORT_NUMBER,0(ARGBLK)			402023' 202 03 0 16 000000
	AOS	FREECI				; FREECI				402024' 350 00 0 00 000000*		1540
	MOVE	AC1,AC3				; AC1,PORT_NUMBER			402025' 200 01 0 00 000003		1542
	IMULI	AC1,6				; AC1,6					402026' 221 01 0 00 000006
	MOVE	AC16,AC1			; PORT,AC1				402027' 200 16 0 00 000001
	ADDI	AC16,SNAVCB			; PORT,SNAVCB				402030' 271 16 0 00 000000*
	MOVEI	AC5,-1(AC16)			; AC5,-1(PORT)				402031' 201 05 0 16 777777		1543
	HRLI	AC5,4400			; AC5,4400				402032' 505 05 0 00 004400
	SETZB	AC1,AC2				; AC1,AC2				402033' 403 01 0 00 000002
	MOVEI	AC4,6				; AC4,6					402034' 201 04 0 00 000006
	EXTEND	AC1,C.18			; AC1,C.18				402035' 123 01 0 00 400720'
	JFCL					; 					402036' 255 00 0 00 000000
	DPB	AC13,C.10			; AC13,[POINT 9,0(AC16),35]  <0,9>	402037' 137 13 0 00 400527'		1545
	MOVEI	AC1,1				; AC1,1					402040' 201 01 0 00 000001		1546
	DPB	AC1,C.11			; AC1,[POINT 9,0(AC16),26]  <9,9>	402041' 137 01 0 00 400530'
	HRRZS	1(AC16)				; 1(PORT)				402042' 553 00 0 16 000001		1547
	MOVSI	AC1,1				; AC1,1					402043' 205 01 0 00 000001		1548
	ANDCAM	AC1,0(AC16)			; AC1,0(PORT)				402044' 412 01 0 16 000000
	HLLZS	2(AC16)				; 2(PORT)				402045' 513 00 0 16 000002		1549
	MOVSI	AC1,-1000			; AC1,-1000				402046' 205 01 0 00 777000		1550
	ANDCAM	AC1,0(AC16)			; AC1,0(PORT)				402047' 412 01 0 16 000000
	HRLM	AC11,2(AC16)			; DATA_BASE,2(PORT)			402050' 506 11 0 16 000002		1551
	IMULI	AC3,3330			; PORT_NUMBER,3330			402051' 221 03 0 00 003330		1552
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  58
Version 1.0	A_LIS						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (14)

	MOVEI	AC1,SNAIOB(AC3)			; AC1,SNAIOB(AC3)			402052' 201 01 0 03 000000*
	HRRM	AC1,3(AC16)			; AC1,3(PORT)				402053' 542 01 0 16 000003
	MOVEI	AC1,SNAIOB+1554(AC3)		; AC1,SNAIOB+1554(AC3)			402054' 201 01 0 03 001554*		1553
	HRLM	AC1,3(AC16)			; AC1,3(PORT)				402055' 506 01 0 16 000003
	MOVEM	AC13,-1(SP)			; AC13,-1(SP)				402056' 202 13 0 17 777777		1555
	MOVEM	AC12,0(SP)			; INTERRUPT_CHANNEL,0(SP)		402057' 202 12 0 17 000000
	PUSHJ	SP,GADPSI			; SP,GADPSI				402060' 260 17 0 00 000000*
	TRNN	AC1,1				; AC1,1					402061' 606 01 0 00 000001
	JRST	L.91				; L.91					402062' 254 00 0 00 402065'
	SETZM	0(AC14)				; 0(AC14)				402063' 402 00 0 14 000000		1556
	JRST	L.92				; L.92					402064' 254 00 0 00 402072'		1555
L.91:	MOVEM	AC13,0(SP)			; AC13,0(SP)				402065' 202 13 0 17 000000		1558
	PUSHJ	SP,GADABT			; SP,GADABT				402066' 260 17 0 00 000000*
	MOVEI	AC1,200000			; AC1,200000				402067' 201 01 0 00 200000		1559
	IORM	AC1,0(AC14)			; AC1,0(AC14)				402070' 436 01 0 14 000000
	JRST	L.93				; L.93					402071' 254 00 0 00 402076'
L.92:	HRRZ	AC1,2(AC16)			; AC1,2(PORT)				402072' 550 01 0 16 000002		1564
	JUMPG	AC1,L.93			; AC1,L.93				402073' 327 01 0 00 402076'
	MOVEI	AC1,2000			; AC1,2000				402074' 201 01 0 00 002000		1565
	HRRM	AC1,2(AC16)			; AC1,2(PORT)				402075' 542 01 0 16 000002
L.93:	ADJSP	SP,-7				; SP,-7					402076' 105 17 0 00 777771		1568
L.94:	ADJSP	SP,-113				; SP,-113				402077' 105 17 0 00 777665		1429
	POP	SP,AC16				; SP,AC16				402100' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				402101' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				402102' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				402103' 262 17 0 00 000012
	POP	SP,AC11				; SP,AC11				402104' 262 17 0 00 000011
	POP	SP,AC5				; SP,AC5				402105' 262 17 0 00 000005
	POP	SP,AC4				; SP,AC4				402106' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				402107' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				402110' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				402111' 262 17 0 00 000001
	POPJ	SP,				; SP,					402112' 263 17 0 00 000000
C.33:	POINT	7,DESCRIPTOR-1,34		; 7,DESCRIPTOR-1,34			402113' 01 07 0 00 777777'
C.34:	POINT	7,P.AAB-1,34			; 7,P.AAB-1,34				402114' 01 07 0 00 401675'

; Routine Size:  142 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  59
Version 1.0	GAM$VERIFY_PORT   (GAMVFY)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (15)

;   1570  1	%routine ('GAM$VERIFY_PORT', PORT_NUMBER, FUNCTION) =
;   1571  1	
;   1572  1	!++
;   1573  1	! FUNCTIONAL DESCRIPTION:
;   1574  1	!
;   1575  1	!       Function to verify the validity of the port for a particular
;   1576  1	!       network function.
;   1577  1	!
;   1578  1	! FORMAL PARAMETERS:
;   1579  1	!
;   1580  1	!       PORT_NUMBER     Port number of the verified port data base.
;   1581  1	!       FUNCTION        The gateway access protocol function to be performed
;   1582  1	!                       for the port.
;   1583  1	!
;   1584  1	! IMPLICIT INPUTS:
;   1585  1	!
;   1586  1	!	none
;   1587  1	!
;   1588  1	! IMPLICIT OUTPUTS:
;   1589  1	!
;   1590  1	!	none
;   1591  1	!
;   1592  1	! ROUTINE VALUE:
;   1593  1	!
;   1594  1	!	>0      Successful verification.  Port control block address
;   1595  1	!               is returned.
;   1596  1	!       0       Failed.
;   1597  1	!
;   1598  1	! SIDE EFFECTS:
;   1599  1	!
;   1600  1	!	none
;   1601  1	!
;   1602  1	!--
;   1603  1	
;   1604  2	    begin
;   1605  2	
;   1606  2	    local
;   1607  2	        PORT: ref PORT_CONTROL_BLOCK;
;   1608  2	
;   1609  2	    PORT = SNAVCB[.PORT_NUMBER,PCB_BLOCK_FIELD]; ! Get port address
;   1610  2	
;   1611  2	    if .PORT[PCB_JFN] leq 0             ! Check port JFN
;   1612  2	    then return 0;
;   1613  2	
;   1614  2	    if not GAM$PORT_STATE (.FUNCTION, .PORT[PCB_STATE]) ! Check port state
;   1615  2	    then return 0;
;   1616  2	
;   1617  2	    return .PORT;                       ! Return port address
;   1618  1	    end;                                ! End of GAM$VERIFY_PORT


GAMVFY: PUSH	SP,AC16				; SP,AC16				402115' 261 17 0 00 000016		1570
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  60
Version 1.0	GAM$VERIFY_PORT   (GAMVFY)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (15)

	MOVE	AC1,-3(SP)			; AC1,PORT_NUMBER			402116' 200 01 0 17 777775		1609
	IMULI	AC1,6				; AC1,6					402117' 221 01 0 00 000006
	MOVE	AC16,AC1			; PORT,AC1				402120' 200 16 0 00 000001
	ADDI	AC16,SNAVCB			; PORT,SNAVCB				402121' 271 16 0 00 000000*
	LDB	AC1,C.10			; AC1,[POINT 9,0(AC16),35]  <0,9>	402122' 135 01 0 00 400527'		1611
	JUMPLE	AC1,L.95			; AC1,L.95				402123' 323 01 0 00 402132'
	PUSH	SP,-2(SP)			; SP,FUNCTION				402124' 261 17 0 17 777776		1614
	LDB	AC1,C.11			; AC1,[POINT 9,0(AC16),26]  <9,9>	402125' 135 01 0 00 400530'
	PUSH	SP,AC1				; SP,AC1				402126' 261 17 0 00 000001
	PUSHJ	SP,GAMSTA			; SP,GAMSTA				402127' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					402130' 105 17 0 00 777776
	TRNN	AC1,1				; AC1,1					402131' 606 01 0 00 000001
L.95:	TDZA	AC1,AC1				; AC1,AC1				402132' 634 01 0 00 000001		1615
	MOVE	AC1,AC16			; AC1,PORT				402133' 200 01 0 00 000016		1604
	POP	SP,AC16				; SP,AC16				402134' 262 17 0 00 000016		1570
	POPJ	SP,				; SP,					402135' 263 17 0 00 000000

; Routine Size:  17 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  61
Version 1.0	GAM$SERVICE_PORT   (GAMSER)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (16)

;   1619  1	%routine ('GAM$SERVICE_PORT', PORT_NUMBER, FUNCTION) =
;   1620  1	
;   1621  1	!++
;   1622  1	! FUNCTIONAL DESCRIPTION:
;   1623  1	!
;   1624  1	!       Function to verify the validity of the port for a particular
;   1625  1	!       network function, then service it at the logical link level.
;   1626  1	!
;   1627  1	! FORMAL PARAMETERS:
;   1628  1	!
;   1629  1	!       PORT_NUMBER     Port number of the verified port data base.
;   1630  1	!       FUNCTION        The gateway access protocol function to be performed
;   1631  1	!                       for the port.
;   1632  1	!
;   1633  1	! IMPLICIT INPUTS:
;   1634  1	!
;   1635  1	!	none
;   1636  1	!
;   1637  1	! IMPLICIT OUTPUTS:
;   1638  1	!
;   1639  1	!	none
;   1640  1	!
;   1641  1	! ROUTINE VALUE:
;   1642  1	!
;   1643  1	!	>0      Successful verification.  Port control block address
;   1644  1	!               is returned.
;   1645  1	!       0       Failed.
;   1646  1	!
;   1647  1	! SIDE EFFECTS:
;   1648  1	!
;   1649  1	!	none
;   1650  1	!
;   1651  1	!--
;   1652  1	
;   1653  2	    begin
;   1654  2	
;   1655  2	    local
;   1656  2	        PORT: ref PORT_CONTROL_BLOCK;
;   1657  2	
;   1658  2	    PORT = SNAVCB[.PORT_NUMBER,PCB_BLOCK_FIELD]; ! Get port address
;   1659  2	
;   1660  2	    if .PORT[PCB_JFN] leq 0             ! Check port JFN
;   1661  2	    then return 0;
;   1662  2	
;   1663  2	    if not GAM$PORT_STATE (.FUNCTION, .PORT[PCB_STATE]) ! Check port state
;   1664  2	    then return 0;
;   1665  2	
;   1666  2	    GAL$LINK_SERVICE (.PORT);           ! Service port at logical link level
;   1667  2	
;   1668  2	    return .PORT;                       ! Return port address
;   1669  1	    end;                                ! End of GAM$SERVICE_PORT
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  62
Version 1.0	GAM$SERVICE_PORT   (GAMSER)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (16)


GAMSER: PUSH	SP,AC16				; SP,AC16				402136' 261 17 0 00 000016		1619
	MOVE	AC1,-3(SP)			; AC1,PORT_NUMBER			402137' 200 01 0 17 777775		1658
	IMULI	AC1,6				; AC1,6					402140' 221 01 0 00 000006
	MOVE	AC16,AC1			; PORT,AC1				402141' 200 16 0 00 000001
	ADDI	AC16,SNAVCB			; PORT,SNAVCB				402142' 271 16 0 00 000000*
	LDB	AC1,C.10			; AC1,[POINT 9,0(AC16),35]  <0,9>	402143' 135 01 0 00 400527'		1660
	JUMPLE	AC1,L.96			; AC1,L.96				402144' 323 01 0 00 402154'
	PUSH	SP,-2(SP)			; SP,FUNCTION				402145' 261 17 0 17 777776		1663
	LDB	AC1,C.11			; AC1,[POINT 9,0(AC16),26]  <9,9>	402146' 135 01 0 00 400530'
	PUSH	SP,AC1				; SP,AC1				402147' 261 17 0 00 000001
	PUSHJ	SP,GAMSTA			; SP,GAMSTA				402150' 260 17 0 00 000000V
	ADJSP	SP,-2				; SP,-2					402151' 105 17 0 00 777776
	TRNE	AC1,1				; AC1,1					402152' 602 01 0 00 000001
	JRST	L.97				; L.97					402153' 254 00 0 00 402156'
L.96:	SETZ	AC1,				; AC1,					402154' 400 01 0 00 000000		1664
	JRST	L.98				; L.98					402155' 254 00 0 00 402162'
L.97:	PUSH	SP,AC16				; SP,PORT				402156' 261 17 0 00 000016		1666
	PUSHJ	SP,GALSRV			; SP,GALSRV				402157' 260 17 0 00 000000*
	ADJSP	SP,-1				; SP,-1					402160' 105 17 0 00 777777		1668
	MOVE	AC1,AC16			; AC1,PORT				402161' 200 01 0 00 000016		1653
L.98:	POP	SP,AC16				; SP,AC16				402162' 262 17 0 00 000016		1619
	POPJ	SP,				; SP,					402163' 263 17 0 00 000000

; Routine Size:  22 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  63
Version 1.0	GAM$PORT_STATE   (GAMSTA)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (17)

;   1670  1	%routine ('GAM$PORT_STATE', FUNCTION, STATE) =
;   1671  1	
;   1672  1	!++
;   1673  1	! FUNCTIONAL DESCRIPTION:
;   1674  1	!
;   1675  1	!       Function to verify the validity of the port state upon performing
;   1676  1	!       a network function.
;   1677  1	!
;   1678  1	! FORMAL PARAMETERS:
;   1679  1	!
;   1680  1	!       FUNCTION        The gateway access protocol function to be performed
;   1681  1	!                       for the port.
;   1682  1	!       STATE           Current port state.
;   1683  1	!
;   1684  1	! IMPLICIT INPUTS:
;   1685  1	!
;   1686  1	!	none
;   1687  1	!
;   1688  1	! IMPLICIT OUTPUTS:
;   1689  1	!
;   1690  1	!	none
;   1691  1	!
;   1692  1	! ROUTINE VALUE:
;   1693  1	!
;   1694  1	!	$TRUE   Successful verification.
;   1695  1	!       $FALSE  Failed.
;   1696  1	!
;   1697  1	! SIDE EFFECTS:
;   1698  1	!
;   1699  1	!	none
;   1700  1	!
;   1701  1	!--
;   1702  1	
;   1703  2	    begin
;   1704  2	
;   1705  2	    selectone .FUNCTION of              ! Check port state
;   1706  2	        set
;   1707  2	        [AF_ACC,                       ! A%ACC (Accept Incoming BIND)
;   1708  2	         AF_REJ,                       ! A%REJ (Reject Incoming BIND)
;   1709  2	         AF_RBD]:                      ! A%RBD (Read Bind Data)
;   1710  3	            if PORT_STATE (.STATE, AS_BNR)
;   1711  2	            then return $TRUE;
;   1712  2	
;   1713  2	        [AF_REC]:                       ! A%REC (Recieve Data Message)
;   1714  3	            if PORT_STATE (.STATE, AS_RUN, AS_ABG, AS_FLU)
;   1715  2	            then return $TRUE;
;   1716  2	
;   1717  2	        [AF_REM]:                       ! A%REM (Read Interrupt Message)
;   1718  3	            if PORT_STATE (.STATE, AS_RUN, AS_ABG, AS_FLU)
;   1719  2	            then return $TRUE;
;   1720  2	
;   1721  2	        [AF_RCN]:                       ! A%RCN (Re-Connect)
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  64
Version 1.0	GAM$PORT_STATE   (GAMSTA)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (17)

;   1722  3	            if PORT_STATE (.STATE, AS_RUN, AS_RCN, AS_FLU)
;   1723  2	            then return $TRUE;
;   1724  2	
;   1725  2	        [AF_TRA]:                       ! A%TRA (Transmit Data Message)
;   1726  3	            if PORT_STATE (.STATE, AS_RUN, AS_ABG, AS_FLU)
;   1727  2	            then return $TRUE;
;   1728  2	
;   1729  2	        [AF_CON,                        ! A%CON (Connect to IBM)
;   1730  2	         AF_LIS]:                       ! A%LIS (Listen Incoming Connect)
;   1731  3	            if PORT_STATE (.STATE, AS_UND)
;   1732  2	            then return $TRUE;
;   1733  2	
;   1734  2	        [AF_RAD]:                       ! A%RAD (Read Abort Data)
;   1735  3	            if PORT_STATE (.STATE, AS_ABD, AS_ABG, AS_FLU)
;   1736  2	            then return $TRUE;
;   1737  2	
;   1738  2	        [AF_TER,                        ! A%TER (Terminate Port Access)
;   1739  2	         AF_RDE]:                       ! A%RDE (Read Event data)
;   1740  2	            return $TRUE;
;   1741  2	        tes;
;   1742  2	
;   1743  2	    return $FALSE;
;   1744  1	    end;                                ! End of GAM$PORT_STATE


GAMSTA: MOVE	AC1,-2(SP)			; AC1,FUNCTION				402164' 200 01 0 17 777776		1705
	CAIN	AC1,1				; AC1,1					402165' 306 01 0 00 000001		1707
	JRST	L.99				; L.99					402166' 254 00 0 00 402172'
	CAIL	AC1,5				; AC1,5					402167' 301 01 0 00 000005
	CAILE	AC1,6				; AC1,6					402170' 303 01 0 00 000006
	JRST	L.100				; L.100					402171' 254 00 0 00 402176'
L.99:	MOVE	AC2,-1(SP)			; AC2,STATE				402172' 200 02 0 17 777777		1710
	CAIE	AC2,2				; AC2,2					402173' 302 02 0 00 000002
	JRST	L.109				; L.109					402174' 254 00 0 00 402250'
	JRST	L.108				; L.108					402175' 254 00 0 00 402246'		1711
L.100:	CAIE	AC1,3				; AC1,3					402176' 302 01 0 00 000003		1713
	CAIN	AC1,4				; AC1,4					402177' 306 01 0 00 000004		1717
	JRST	L.102				; L.102					402200' 254 00 0 00 402212'
	CAIE	AC1,11				; AC1,11				402201' 302 01 0 00 000011		1721
	JRST	L.101				; L.101					402202' 254 00 0 00 402210'
	MOVE	AC2,-1(SP)			; AC2,STATE				402203' 200 02 0 17 777777		1722
	CAIL	AC2,3				; AC2,3					402204' 301 02 0 00 000003
	CAILE	AC2,5				; AC2,5					402205' 303 02 0 00 000005
	JRST	L.109				; L.109					402206' 254 00 0 00 402250'
	JRST	L.108				; L.108					402207' 254 00 0 00 402246'		1723
L.101:	CAIE	AC1,12				; AC1,12				402210' 302 01 0 00 000012		1725
	JRST	L.104				; L.104					402211' 254 00 0 00 402222'
L.102:	MOVE	AC2,-1(SP)			; AC2,STATE				402212' 200 02 0 17 777777		1726
	CAIGE	AC2,3				; AC2,3					402213' 305 02 0 00 000003
	JRST	L.103				; L.103					402214' 254 00 0 00 402217'
	CAIG	AC2,4				; AC2,4					402215' 307 02 0 00 000004
	JRST	L.108				; L.108					402216' 254 00 0 00 402246'
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  65
Version 1.0	GAM$PORT_STATE   (GAMSTA)			13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (17)

L.103:	CAIE	AC2,6				; AC2,6					402217' 302 02 0 00 000006
	JRST	L.109				; L.109					402220' 254 00 0 00 402250'
	JRST	L.108				; L.108					402221' 254 00 0 00 402246'		1727
L.104:	CAIE	AC1,2				; AC1,2					402222' 302 01 0 00 000002		1729
	CAIN	AC1,14				; AC1,14				402223' 306 01 0 00 000014
	JRST	L.105				; L.105					402224' 254 00 0 00 402226'
	JRST	L.106				; L.106					402225' 254 00 0 00 402231'
L.105:	MOVE	AC2,-1(SP)			; AC2,STATE				402226' 200 02 0 17 777777		1731
	JUMPN	AC2,L.109			; AC2,L.109				402227' 326 02 0 00 402250'
	JRST	L.108				; L.108					402230' 254 00 0 00 402246'		1732
L.106:	CAIE	AC1,10				; AC1,10				402231' 302 01 0 00 000010		1734
	JRST	L.107				; L.107					402232' 254 00 0 00 402242'
	MOVE	AC2,-1(SP)			; AC2,STATE				402233' 200 02 0 17 777777		1735
	CAIN	AC2,3				; AC2,3					402234' 306 02 0 00 000003
	JRST	L.108				; L.108					402235' 254 00 0 00 402246'
	CAIL	AC2,6				; AC2,6					402236' 301 02 0 00 000006
	CAILE	AC2,7				; AC2,7					402237' 303 02 0 00 000007
	JRST	L.109				; L.109					402240' 254 00 0 00 402250'
	JRST	L.108				; L.108					402241' 254 00 0 00 402246'		1736
L.107:	CAIE	AC1,7				; AC1,7					402242' 302 01 0 00 000007		1738
	CAIN	AC1,13				; AC1,13				402243' 306 01 0 00 000013
	JRST	L.108				; L.108					402244' 254 00 0 00 402246'
	JRST	L.109				; L.109					402245' 254 00 0 00 402250'
L.108:	MOVEI	AC1,1				; AC1,1					402246' 201 01 0 00 000001		1740
	POPJ	SP,				; SP,					402247' 263 17 0 00 000000
L.109:	SETZ	AC1,				; AC1,					402250' 400 01 0 00 000000		1703
	POPJ	SP,				; SP,					402251' 263 17 0 00 000000		1670

; Routine Size:  54 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  66
Version 1.0	GAM$ASCIZ   (GAMASZ)				13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (18)

;   1745  1	%routine ('GAM$ASCIZ', SOURCE, DESTINATION) : novalue =
;   1746  1	
;   1747  1	!++
;   1748  1	! FUNCTIONAL DESCRIPTION:
;   1749  1	!
;   1750  1	!       Function to copy ASCIZ string to a counted ASCII string buffer.
;   1751  1	!
;   1752  1	! FORMAL PARAMETERS:
;   1753  1	!
;   1754  1	!       SOURCE          Pointer to the source string.
;   1755  1	!       DESTINATION     Pointer to the destination location.
;   1756  1	!
;   1757  1	! IMPLICIT INPUTS:
;   1758  1	!
;   1759  1	!	none
;   1760  1	!
;   1761  1	! IMPLICIT OUTPUTS:
;   1762  1	!
;   1763  1	!	none
;   1764  1	!
;   1765  1	! ROUTINE VALUE:
;   1766  1	!
;   1767  1	!       none
;   1768  1	!
;   1769  1	! SIDE EFFECTS:
;   1770  1	!
;   1771  1	!	none
;   1772  1	!
;   1773  1	!--
;   1774  1	
;   1775  2	    begin
;   1776  2	
;   1777  2	    local
;   1778  2	        LENGTH;
;   1779  2	
;   1780  4	    LENGTH = (if (.SOURCE neq 0) and (ch$size (.SOURCE) gtr 0)
;   1781  3	              then CH$LEN (.SOURCE)     ! Get length of the source string
;   1782  2	              else 0);
;   1783  2	
;   1784  2	    if .LENGTH leq 0
;   1785  2	    then ch$wchar (%O'0', .DESTINATION) ! Null source string
;   1786  3	    else begin
;   1787  3	         local POINTER;
;   1788  3	
;   1789  3	         POINTER = .DESTINATION;
;   1790  3	         ch$wchar_a (.LENGTH, POINTER);
;   1791  3	         ch$move (.LENGTH, .SOURCE, .POINTER);
;   1792  2	         end;
;   1793  2	
;   1794  2	    return;
;   1795  1	    end;                                ! End of GAM$ASCIZ
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  67
Version 1.0	GAM$ASCIZ   (GAMASZ)				13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (18)


GAMASZ: PUSH	SP,AC16				; SP,AC16				402252' 261 17 0 00 000016		1745
	MOVE	AC16,-3(SP)			; AC16,SOURCE				402253' 200 16 0 17 777775		1780
	JUMPE	AC16,L.110			; AC16,L.110				402254' 322 16 0 00 402272'
	MOVE	AC1,AC16			; AC1,AC16				402255' 200 01 0 00 000016
	ASH	AC1,-30				; AC1,-30				402256' 240 01 0 00 777750
	LDB	AC2,C.35			; AC2,[POINT 6,AC1,35]  <0,6>		402257' 135 02 0 00 402310'
	JUMPLE	AC2,L.110			; AC2,L.110				402260' 323 02 0 00 402272'
	PUSH	SP,C.36				; SP,[4000]				402261' 261 17 0 00 402311'		1781
	PUSH	SP,AC16				; SP,AC16				402262' 261 17 0 00 000016
	PUSH	SP,C.37				; SP,[0]				402263' 261 17 0 00 402312'
	PUSHJ	SP,CHFCH%			; SP,CHFCH%				402264' 260 17 0 00 000000*
	PUSH	SP,AC1				; SP,AC1				402265' 261 17 0 00 000001
	PUSH	SP,AC16				; SP,AC16				402266' 261 17 0 00 000016
	PUSHJ	SP,CHDIF%			; SP,CHDIF%				402267' 260 17 0 00 000000*
	ADJSP	SP,-5				; SP,-5					402270' 105 17 0 00 777773
	JRST	L.111				; L.111					402271' 254 00 0 00 402273'		1780
L.110:	SETZ	AC1,				; LENGTH,				402272' 400 01 0 00 000000
L.111:	JUMPG	AC1,L.112			; LENGTH,L.112				402273' 327 01 0 00 402300'		1784
	SETZ	AC3,				; AC3,					402274' 400 03 0 00 000000		1785
	MOVE	AC2,-2(SP)			; AC2,DESTINATION			402275' 200 02 0 17 777776
	IDPB	AC3,AC2				; AC3,AC2				402276' 136 03 0 00 000002
	JRST	L.113				; L.113					402277' 254 00 0 00 402306'		1784
L.112:	MOVE	AC5,-2(SP)			; POINTER,DESTINATION			402300' 200 05 0 17 777776		1789
	IDPB	AC1,AC5				; LENGTH,POINTER			402301' 136 01 0 00 000005		1790
	MOVE	AC2,-3(SP)			; AC2,SOURCE				402302' 200 02 0 17 777775		1791
	MOVE	AC4,AC1				; AC4,LENGTH				402303' 200 04 0 00 000001
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				402304' 123 01 0 00 400717'
	JFCL					; 					402305' 255 00 0 00 000000
L.113:	POP	SP,AC16				; SP,AC16				402306' 262 17 0 00 000016		1745
	POPJ	SP,				; SP,					402307' 263 17 0 00 000000
C.35:	POINT	6,AC1,35			; 6,AC1,35				402310' 00 06 0 00 000001
C.36:	EXP	4000				; 4000					402311' 000000	004000
C.37:	EXP	0				; 0					402312' 000000	000000

; Routine Size:  33 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  68
Version 1.0	GAM$ASCIC   (GAMASC)				13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (19)

;   1796  1	%routine ('GAM$ASCIC', LENGTH, SOURCE, DESTINATION) : novalue =
;   1797  1	
;   1798  1	!++
;   1799  1	! FUNCTIONAL DESCRIPTION:
;   1800  1	!
;   1801  1	!       Function to copy string from user argument block to user data base.
;   1802  1	!       If the source string empty, then zero out the destination location.
;   1803  1	!
;   1804  1	! FORMAL PARAMETERS:
;   1805  1	!
;   1806  1	!       LENGTH          Length of the source string.
;   1807  1	!       SOURCE          Pointer to the source string.
;   1808  1	!       DESTINATION     Pointer to the destination location.
;   1809  1	!
;   1810  1	! IMPLICIT INPUTS:
;   1811  1	!
;   1812  1	!	none
;   1813  1	!
;   1814  1	! IMPLICIT OUTPUTS:
;   1815  1	!
;   1816  1	!	none
;   1817  1	!
;   1818  1	! ROUTINE VALUE:
;   1819  1	!
;   1820  1	!       none
;   1821  1	!
;   1822  1	! SIDE EFFECTS:
;   1823  1	!
;   1824  1	!	none
;   1825  1	!
;   1826  1	!--
;   1827  1	
;   1828  2	    begin
;   1829  2	
;   1830  2	    if .LENGTH leq 0
;   1831  2	    then ch$wchar (%O'0', .DESTINATION)
;   1832  3	    else begin
;   1833  3	         local POINTER;
;   1834  3	
;   1835  3	         POINTER = .DESTINATION;
;   1836  3	         ch$wchar_a (.LENGTH, POINTER);
;   1837  3	         ch$move (.LENGTH, .SOURCE, .POINTER);
;   1838  2	         end;
;   1839  2	
;   1840  2	    return;
;   1841  1	    end;                                ! End of GAM$ASCIC


GAMASC: MOVE	AC3,-3(SP)			; AC3,LENGTH				402313' 200 03 0 17 777775		1830
	JUMPG	AC3,L.114			; AC3,L.114				402314' 327 03 0 00 402321'
	SETZ	AC2,				; AC2,					402315' 400 02 0 00 000000		1831
	MOVE	AC1,-1(SP)			; AC1,DESTINATION			402316' 200 01 0 17 777777
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  69
Version 1.0	GAM$ASCIC   (GAMASC)				13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (19)

	IDPB	AC2,AC1				; AC2,AC1				402317' 136 02 0 00 000001
	POPJ	SP,				; SP,					402320' 263 17 0 00 000000		1830
L.114:	MOVE	AC5,-1(SP)			; POINTER,DESTINATION			402321' 200 05 0 17 777777		1835
	IDPB	AC3,AC5				; AC3,POINTER				402322' 136 03 0 00 000005		1836
	MOVE	AC1,-3(SP)			; AC1,LENGTH				402323' 200 01 0 17 777775		1837
	MOVE	AC2,-2(SP)			; AC2,SOURCE				402324' 200 02 0 17 777776
	MOVE	AC4,-3(SP)			; AC4,LENGTH				402325' 200 04 0 17 777775
	EXTEND	AC1,C.17			; AC1,[MOVSLJ ]				402326' 123 01 0 00 400717'
	JFCL					; 					402327' 255 00 0 00 000000
	POPJ	SP,				; SP,					402330' 263 17 0 00 000000		1796

; Routine Size:  14 words


;   1842  1	
;   1843  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  70
Version 1.0	A_OUT						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (20)

;   1844  1	%global_routine ('A_OUT', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1845  1	
;   1846  1	!++
;   1847  1	! FUNCTIONAL DESCRIPTION:
;   1848  1	!
;   1849  1	!       A%OUT           Outputs in decimal the binddata or any data
;   1850  1	!                       pointed to.
;   1851  1	!
;   1852  1	! FORMAL PARAMETERS:
;   1853  1	!
;   1854  1	!	ARGBLK          Argument block address of the port in AC1.
;   1855  1	!
;   1856  1	! IMPLICIT INPUTS:
;   1857  1	!
;   1858  1	!	none
;   1859  1	!
;   1860  1	! IMPLICIT OUTPUTS:
;   1861  1	!
;   1862  1	!	none
;   1863  1	!
;   1864  1	! COMPLETION CODES:
;   1865  1	!
;   1866  1	!	none
;   1867  1	!
;   1868  1	! SIDE EFFECTS:
;   1869  1	!
;   1870  1	!	none
;   1871  1	!
;   1872  1	!--
;   1873  1	
;   1874  2	    begin
;   1875  2	
;   1876  2	       local
;   1877  2	         PTR,
;   1878  2	         NUM,
;   1879  2	         FLAG,
;   1880  2	         FILL,
;   1881  2	         LEN;
;   1882  2	
;   1883  2	    PTR = .ARGBLK[RBD_BIND_DATA];
;   1884  2	    LEN = .ARGBLK[RBD_BIND_LENGTH];
;   1885  2	
;   1886  2	    FILL = ch$ptr (uplit (' ,'));
;   1887  2	
;   1888  2	    FLAG = 16;
;   1889  2	    
;   1890  2	    if .ARGBLK[RBD_BIND_LENGTH] eql 0 
;   1891  2	    then ARGBLK[RBD_RETURN_CODE] = AC_PER
;   1892  3	    else begin
;   1893  3	         ARGBLK[RBD_RETURN_CODE] = AC_SUC;
;   1894  3	           while .LEN gtr 0 do
;   1895  4	                 begin
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  71
Version 1.0	A_OUT						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (20)

;   1896  4	                 NUM = ch$rchar_a (PTR);
;   1897  4	                 jsys_nout  ($priou, .NUM, .FLAG);
;   1898  4	                 jsys_psout (.FILL);
;   1899  4	                 LEN = .LEN - 1;
;   1900  3	                 end;
;   1901  2	         end;
;   1902  2	
;   1903  2	    return;
;   1904  1	    end;                                ! End of A_OUT


P.AAC:	BYTE	(7)" ",",",000,000,000		;  ,					402331' 040 054 000 000 000


A_OUT:: PUSH	SP,AC1				; SP,AC1				402332' 261 17 0 00 000001		1844
	PUSH	SP,AC2				; SP,AC2				402333' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				402334' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				402335' 261 17 0 00 000004
	PUSH	SP,AC11				; SP,AC11				402336' 261 17 0 00 000011
	PUSH	SP,AC12				; SP,AC12				402337' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				402340' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				402341' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				402342' 261 17 0 00 000016
	MOVE	AC14,3(AC1)			; PTR,3(ARGBLK)				402343' 200 14 0 01 000003		1883
	MOVE	AC2,2(AC1)			; AC2,2(ARGBLK)				402344' 200 02 0 01 000002		1884
	MOVE	AC16,AC2			; LEN,AC2				402345' 200 16 0 00 000002
	MOVE	AC11,C.38			; FILL,[POINT 7,P.AAC-1,34]  <1,7>	402346' 200 11 0 00 402404'		1886
	MOVEI	AC12,20				; FLAG,20				402347' 201 12 0 00 000020		1888
	ADDI	AC1,1				; ARGBLK,1				402350' 271 01 0 00 000001		1891
	JUMPN	AC2,L.115			; AC2,L.115				402351' 326 02 0 00 402355'		1890
	MOVEI	AC2,4				; AC2,4					402352' 201 02 0 00 000004		1891
	MOVEM	AC2,0(AC1)			; AC2,0(AC1)				402353' 202 02 0 01 000000
	JRST	L.119				; L.119					402354' 254 00 0 00 402372'		1890
L.115:	SETZM	0(AC1)				; 0(AC1)				402355' 402 00 0 01 000000		1893
	JRST	L.118				; L.118					402356' 254 00 0 00 402371'		1894
L.116:	ILDB	AC13,AC14			; NUM,PTR				402357' 134 13 0 00 000014		1896
	MOVEI	AC1,101				; AC1,101				402360' 201 01 0 00 000101		1897
	MOVE	AC2,AC13			; AC2,NUM				402361' 200 02 0 00 000013
	MOVE	AC3,AC12			; AC3,FLAG				402362' 200 03 0 00 000012
	JSYS	224				; 224					402363' 104 00 0 00 000224
	JFCL					; 					402364' 255 00 0 00 000000
	MOVE	AC1,AC11			; AC1,FILL				402365' 200 01 0 00 000011		1898
	JSYS	76				; 76					402366' 104 00 0 00 000076
	JUMP	16,L.117			; 16,L.117				402367' 320 16 0 00 402370'
L.117:	SUBI	AC16,1				; LEN,1					402370' 275 16 0 00 000001		1899
L.118:	JUMPG	AC16,L.116			; LEN,L.116				402371' 327 16 0 00 402357'		1894
L.119:	POP	SP,AC16				; SP,AC16				402372' 262 17 0 00 000016		1844
	POP	SP,AC14				; SP,AC14				402373' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				402374' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				402375' 262 17 0 00 000012
	POP	SP,AC11				; SP,AC11				402376' 262 17 0 00 000011
	POP	SP,AC4				; SP,AC4				402377' 262 17 0 00 000004
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  72
Version 1.0	A_OUT						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (20)

	POP	SP,AC3				; SP,AC3				402400' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				402401' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				402402' 262 17 0 00 000001
	POPJ	SP,				; SP,					402403' 263 17 0 00 000000
C.38:	POINT	7,P.AAC-1,34			; 7,P.AAC-1,34				402404' 01 07 0 00 402330'

; Routine Size:  43 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  73
Version 1.0	A_OUT						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (21)

;   1905  1	
;   1906  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  74
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (22)

;   1907  1	%global_routine ('A_OAD', ARGBLK: ref ARGUMENT_BLOCK) : MAC novalue =
;   1908  1	
;   1909  1	!++
;   1910  1	! FUNCTIONAL DESCRIPTION:
;   1911  1	!
;   1912  1	!       A%OAD           Output Abort Data
;   1913  1	!
;   1914  1	! FORMAL PARAMETERS:
;   1915  1	!
;   1916  1	!	ARGBLK          Argument block address of the port in AC1.
;   1917  1	!
;   1918  1	! IMPLICIT INPUTS:
;   1919  1	!
;   1920  1	!	none
;   1921  1	!
;   1922  1	! IMPLICIT OUTPUTS:
;   1923  1	!
;   1924  1	!	none
;   1925  1	!
;   1926  1	! COMPLETION CODES:
;   1927  1	!
;   1928  1	!	none
;   1929  1	!
;   1930  1	! SIDE EFFECTS:
;   1931  1	!
;   1932  1	!	none
;   1933  1	!
;   1934  1	!--
;   1935  1	
;   1936  2	    begin
;   1937  2	
;   1938  2	       local
;   1939  2	         PTR,
;   1940  2	         NUM,
;   1941  2	         FILL,
;   1942  2	         FLAG,
;   1943  2	         CRLFX,
;   1944  2	         PTRX,
;   1945  2	         MESPTR,
;   1946  2	         MESPTRX,
;   1947  2	         BUFFX,
;   1948  2	         LEN;
;   1949  2	
;   1950  2	    CRLFX = PTRX = ch$ptr (BUFFX);
;   1951  2	    PTRX = ch$wchar_a (%O'15', PTRX);
;   1952  2	    PTRX = ch$wchar_a (%O'12', PTRX);
;   1953  2	    ch$wchar_a (0, PTRX);
;   1954  2	
;   1955  2	    PTR = .ARGBLK[RAD_DATA];
;   1956  2	    LEN = .ARGBLK[RAD_LENGTH];
;   1957  2	
;   1958  2	    FILL = ch$ptr (uplit (' ,'));
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  75
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (22)

;   1959  2	
;   1960  2	    FLAG = 10;
;   1961  2	    
;   1962  2	    if .ARGBLK[RAD_LENGTH] eql 0 
;   1963  2	    then ARGBLK[RAD_RETURN_CODE] = AC_PER
;   1964  3	    else begin
;   1965  3	         ARGBLK[RAD_RETURN_CODE] = AC_SUC;
;   1966  3	           while .LEN gtr 0 do
;   1967  4	                 begin
;   1968  4	                 NUM = ch$rchar_a (PTR);
;   1969  4	                 jsys_nout  ($priou, .NUM, .FLAG);
;   1970  4	                 jsys_psout (.FILL);
;   1971  4	                 LEN = .LEN - 1;
;   1972  3	                 end;
;   1973  2	         end;
;   1974  2	
;   1975  2	    CRLF (3);
;   1976  2	    MESPTR = ch$ptr (uplit ('ABORT REASON Code: '));
;   1977  2	    jsys_psout (.MESPTR);
;   1978  2	
;   1979  2	    jsys_nout  ($priou, .ARGBLK[RAD_ABORT_REASON], .FLAG);
;   1980  2	
;   1981  2	    CRLF (2);
;   1982  2	    MESPTRX = ch$ptr (uplit ('IBM SENSE Code:  '));
;   1983  2	    jsys_psout (.MESPTRX);
;   1984  2	    
;   1985  2	    LEN = 4;
;   1986  2	    FLAG = 16;
;   1987  2	    PTR = ch$ptr (ARGBLK[RAD_SENSE_CODE],,8);
;   1988  2	           while .LEN gtr 0 do
;   1989  3	                 begin
;   1990  3	                 NUM = ch$rchar_a (PTR);
;   1991  3	                 jsys_nout  ($priou, .NUM, .FLAG);
;   1992  3	                 jsys_psout (.FILL);
;   1993  3	                 LEN = .LEN - 1;
;   1994  2	                 end;
;   1995  2	
;   1996  2	
;   1997  2	    return;
;   1998  1	    end;                                ! End of A_OAD


P.AAD:	BYTE	(7)" ",",",000,000,000		;  ,					402405' 040 054 000 000 000
P.AAE:	BYTE	(7)"A","B","O","R","T"		; ABORT					402406' 101 102 117 122 124
	BYTE	(7)" ","R","E","A","S"		;  REAS					402407' 040 122 105 101 123
	BYTE	(7)"O","N"," ","C","o"		; ON Co					402410' 117 116 040 103 157
	BYTE	(7)"d","e",":"," ",000		; de:					402411' 144 145 072 040 000
P.AAF:	BYTE	(7)"I","B","M"," ","S"		; IBM S					402412' 111 102 115 040 123
	BYTE	(7)"E","N","S","E"," "		; ENSE					402413' 105 116 123 105 040
	BYTE	(7)"C","o","d","e",":"		; Code:					402414' 103 157 144 145 072
	BYTE	(7)" "," ",000,000,000		;					402415' 040 040 000 000 000
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  76
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (22)


A_OAD:: PUSH	SP,AC0				; SP,AC0				402416' 261 17 0 00 000000		1907
	PUSH	SP,AC1				; SP,AC1				402417' 261 17 0 00 000001
	PUSH	SP,AC2				; SP,AC2				402420' 261 17 0 00 000002
	PUSH	SP,AC3				; SP,AC3				402421' 261 17 0 00 000003
	PUSH	SP,AC4				; SP,AC4				402422' 261 17 0 00 000004
	PUSH	SP,AC7				; SP,AC7				402423' 261 17 0 00 000007
	PUSH	SP,AC10				; SP,AC10				402424' 261 17 0 00 000010
	PUSH	SP,AC11				; SP,AC11				402425' 261 17 0 00 000011
	PUSH	SP,AC12				; SP,AC12				402426' 261 17 0 00 000012
	PUSH	SP,AC13				; SP,AC13				402427' 261 17 0 00 000013
	PUSH	SP,AC14				; SP,AC14				402430' 261 17 0 00 000014
	PUSH	SP,AC16				; SP,AC16				402431' 261 17 0 00 000016
	ADJSP	SP,1				; SP,1					402432' 105 17 0 00 000001
	MOVE	AC14,AC1			; ARGBLK,AC1				402433' 200 14 0 00 000001
	MOVEI	AC1,-1(SP)			; AC1,BUFFX-1				402434' 201 01 0 17 777777		1950
	HRLI	AC1,10700			; AC1,10700				402435' 505 01 0 00 010700
	MOVE	AC0,AC1				; CRLFX,PTRX				402436' 200 00 0 00 000001
	MOVEI	AC2,15				; AC2,15				402437' 201 02 0 00 000015		1951
	IDPB	AC2,AC1				; AC2,PTRX				402440' 136 02 0 00 000001
	MOVEI	AC2,12				; AC2,12				402441' 201 02 0 00 000012		1952
	IDPB	AC2,AC1				; AC2,PTRX				402442' 136 02 0 00 000001
	SETZ	AC2,				; AC2,					402443' 400 02 0 00 000000		1953
	IDPB	AC2,AC1				; AC2,PTRX				402444' 136 02 0 00 000001
	MOVE	AC16,6(AC14)			; PTR,6(ARGBLK)				402445' 200 16 0 14 000006		1955
	HLRZ	AC2,5(AC14)			; AC2,5(ARGBLK)				402446' 554 02 0 14 000005		1956
	MOVE	AC12,AC2			; LEN,AC2				402447' 200 12 0 00 000002
	MOVE	AC7,C.39			; FILL,[POINT 7,P.AAD-1,34]  <1,7>	402450' 200 07 0 00 402565'		1958
	MOVEI	AC10,12				; FLAG,12				402451' 201 10 0 00 000012		1960
	MOVE	AC1,AC14			; AC1,ARGBLK				402452' 200 01 0 00 000014		1963
	ADDI	AC1,1				; AC1,1					402453' 271 01 0 00 000001
	JUMPN	AC2,L.120			; AC2,L.120				402454' 326 02 0 00 402460'		1962
	MOVEI	AC2,4				; AC2,4					402455' 201 02 0 00 000004		1963
	MOVEM	AC2,0(AC1)			; AC2,0(AC1)				402456' 202 02 0 01 000000
	JRST	L.124				; L.124					402457' 254 00 0 00 402475'		1962
L.120:	SETZM	0(AC1)				; 0(AC1)				402460' 402 00 0 01 000000		1965
	JRST	L.123				; L.123					402461' 254 00 0 00 402474'		1966
L.121:	ILDB	AC11,AC16			; NUM,PTR				402462' 134 11 0 00 000016		1968
	MOVEI	AC1,101				; AC1,101				402463' 201 01 0 00 000101		1969
	MOVE	AC2,AC11			; AC2,NUM				402464' 200 02 0 00 000011
	MOVE	AC3,AC10			; AC3,FLAG				402465' 200 03 0 00 000010
	JSYS	224				; 224					402466' 104 00 0 00 000224
	JFCL					; 					402467' 255 00 0 00 000000
	MOVE	AC1,AC7				; AC1,FILL				402470' 200 01 0 00 000007		1970
	JSYS	76				; 76					402471' 104 00 0 00 000076
	JUMP	16,L.122			; 16,L.122				402472' 320 16 0 00 402473'
L.122:	SUBI	AC12,1				; LEN,1					402473' 275 12 0 00 000001		1971
L.123:	JUMPG	AC12,L.121			; LEN,L.121				402474' 327 12 0 00 402462'		1966
L.124:	MOVEI	AC13,3				; TMPCNT,3				402475' 201 13 0 00 000003		1975
	JRST	L.127				; L.127					402476' 254 00 0 00 402503'
L.125:	MOVE	AC1,AC0				; AC1,CRLFX				402477' 200 01 0 00 000000
	JSYS	76				; 76					402500' 104 00 0 00 000076
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  77
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (22)

	JUMP	16,L.126			; 16,L.126				402501' 320 16 0 00 402502'
L.126:	SUBI	AC13,1				; TMPCNT,1				402502' 275 13 0 00 000001
L.127:	JUMPG	AC13,L.125			; TMPCNT,L.125				402503' 327 13 0 00 402477'
	MOVE	AC1,C.40			; MESPTR,[POINT 7,P.AAE-1,34]  <1,7>	402504' 200 01 0 00 402566'		1976
	JSYS	76				; 76					402505' 104 00 0 00 000076		1977
	JUMP	16,L.128			; 16,L.128				402506' 320 16 0 00 402507'
L.128:	MOVEI	AC1,101				; AC1,101				402507' 201 01 0 00 000101		1979
	MOVE	AC2,3(AC14)			; AC2,3(ARGBLK)				402510' 200 02 0 14 000003
	MOVE	AC3,AC10			; AC3,FLAG				402511' 200 03 0 00 000010
	JSYS	224				; 224					402512' 104 00 0 00 000224
	JFCL					; 					402513' 255 00 0 00 000000
	MOVEI	AC13,2				; TMPCNT,2				402514' 201 13 0 00 000002		1981
	JRST	L.131				; L.131					402515' 254 00 0 00 402522'
L.129:	MOVE	AC1,AC0				; AC1,CRLFX				402516' 200 01 0 00 000000
	JSYS	76				; 76					402517' 104 00 0 00 000076
	JUMP	16,L.130			; 16,L.130				402520' 320 16 0 00 402521'
L.130:	SUBI	AC13,1				; TMPCNT,1				402521' 275 13 0 00 000001
L.131:	JUMPG	AC13,L.129			; TMPCNT,L.129				402522' 327 13 0 00 402516'
	MOVE	AC1,C.41			; MESPTRX,[POINT 7,P.AAF-1,34]  <1,7>	402523' 200 01 0 00 402567'		1982
	JSYS	76				; 76					402524' 104 00 0 00 000076		1983
	JUMP	16,L.132			; 16,L.132				402525' 320 16 0 00 402526'
L.132:	MOVEI	AC12,4				; LEN,4					402526' 201 12 0 00 000004		1985
	MOVEI	AC10,20				; FLAG,20				402527' 201 10 0 00 000020		1986
	MOVEI	AC1,3(AC14)			; AC1,3(ARGBLK)				402530' 201 01 0 14 000003		1987
	HRLI	AC1,41000			; AC1,41000				402531' 505 01 0 00 041000
	MOVE	AC16,AC1			; PTR,AC1				402532' 200 16 0 00 000001
	JRST	L.135				; L.135					402533' 254 00 0 00 402546'		1988
L.133:	ILDB	AC11,AC16			; NUM,PTR				402534' 134 11 0 00 000016		1990
	MOVEI	AC1,101				; AC1,101				402535' 201 01 0 00 000101		1991
	MOVE	AC2,AC11			; AC2,NUM				402536' 200 02 0 00 000011
	MOVE	AC3,AC10			; AC3,FLAG				402537' 200 03 0 00 000010
	JSYS	224				; 224					402540' 104 00 0 00 000224
	JFCL					; 					402541' 255 00 0 00 000000
	MOVE	AC1,AC7				; AC1,FILL				402542' 200 01 0 00 000007		1992
	JSYS	76				; 76					402543' 104 00 0 00 000076
	JUMP	16,L.134			; 16,L.134				402544' 320 16 0 00 402545'
L.134:	SUBI	AC12,1				; LEN,1					402545' 275 12 0 00 000001		1993
L.135:	JUMPG	AC12,L.133			; LEN,L.133				402546' 327 12 0 00 402534'		1988
	ADJSP	SP,-1				; SP,-1					402547' 105 17 0 00 777777		1907
	POP	SP,AC16				; SP,AC16				402550' 262 17 0 00 000016
	POP	SP,AC14				; SP,AC14				402551' 262 17 0 00 000014
	POP	SP,AC13				; SP,AC13				402552' 262 17 0 00 000013
	POP	SP,AC12				; SP,AC12				402553' 262 17 0 00 000012
	POP	SP,AC11				; SP,AC11				402554' 262 17 0 00 000011
	POP	SP,AC10				; SP,AC10				402555' 262 17 0 00 000010
	POP	SP,AC7				; SP,AC7				402556' 262 17 0 00 000007
	POP	SP,AC4				; SP,AC4				402557' 262 17 0 00 000004
	POP	SP,AC3				; SP,AC3				402560' 262 17 0 00 000003
	POP	SP,AC2				; SP,AC2				402561' 262 17 0 00 000002
	POP	SP,AC1				; SP,AC1				402562' 262 17 0 00 000001
	POP	SP,AC0				; SP,AC0				402563' 262 17 0 00 000000
	POPJ	SP,				; SP,					402564' 263 17 0 00 000000
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  78
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (22)

C.39:	POINT	7,P.AAD-1,34			; 7,P.AAD-1,34				402565' 01 07 0 00 402404'
C.40:	POINT	7,P.AAE-1,34			; 7,P.AAE-1,34				402566' 01 07 0 00 402405'
C.41:	POINT	7,P.AAF-1,34			; 7,P.AAF-1,34				402567' 01 07 0 00 402411'

; Routine Size:  106 words
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  79
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (23)

;   1999  1	
;   2000  1	
;   2001  1	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  80
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (24)

;   2002  1	end                                     ! End of SAIMAC
;   2003  1	
;   2004  0	eludom




; Low  segment length:      16 words
; High segment length:    1400 words




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks          Processing
;	File				     Total    Loaded   Percent      Read           Time
;
;  KL2102:<BRELEASE.XPORT>MONSYM.L36.1	      3863       251         6        94	     00:00.5
;  STAR:<SNA.TAPE2.AI.SOURCE>SNACOM.L36.2
;					       337       214        63        22	     00:00.3





;   2005  0	
SAIMAC		SNA GATEWAY ACCESS MACRO-20 INTERFACE		13-Feb-1985 13:37:50	TOPS-20 Bliss-36 4A(225)	    Page  81
Version 1.0	A_OAD						13-Feb-1985 13:28:03	STAR:<SNA.TAPE2.AI.SOURCE>SAIMAC.B36.2 (25)

;   2006  0	
;   2007  0	! Local Modes:
;   2008  0	! Mode:BLISS
;   2009  0	! Auto Save Mode:2
;   2010  0	! Comment Column:40
;   2011  0	! Comment Rounding:+1
;   2012  0	! End:

;			COMPILER INTERNAL TIMING

;	Phase	     Faults	  Cpu-time	Elapsed-time
;	LEXSYN	        208	   00:30.9	   03:41.8
;	FLOWAN	         10	   00:02.0	   00:10.3
;	DELAY	         15	   00:02.1	   00:14.1
;	TNBIND	         18	   00:02.6	   00:08.2
;	CODE	         30	   00:01.8	   00:19.1
;	FINAL	         68	   00:08.5	   01:01.9
;	Total	        349	   00:48.0	   05:35.5

; Size:		1388 code + 28 data words
; Run Time:	   00:48.2
; Elapsed Time:	   05:36.0
; Lines/CPU Min:    2507
; Lexemes/CPU-Min:105613
; Memory Used:	92 pages
; Compilation Complete