! ! TOPS-10 I/O Control Blocks ! $FIELD OPEN$ARGS = SET OPEN$H_STATUS = [$BYTES(2)] , ! I/O status flags (defined in UUOSYM.R36) OPEN$H_FLAGS = [$BYTES(2)] , ! Open option flags (defined in UUOSYM.R36) OPEN$T_DEVICE = [$SIXBIT(6)] , ! Device name (6-bit ASCII) OPEN$A_IN_BCB = [$ADDRESS] , ! Address of input buffer control block OPEN$A_OUT_BCB = [$ADDRESS] ! Address of output buffer control block TES; LITERAL OPEN$K_ARG_LEN = $FIELD_SET_SIZE ; ! Length of open argument list MACRO $T10_OPEN_ARGS = BLOCK[ OPEN$K_ARG_LEN ] FIELD( OPEN$ARGS ) %; $FIELD LOOK$ARGS = SET LOOK$T_NAME = [$SIXBIT(6)] , ! File name (6-bit ASCII) LOOK$H_STATUS = [$BYTES(2)] , ! error completion code $OVERLAY( LOOK$H_STATUS ) LOOK$V_AC_DATE = [$BITS(15)] , ! date of last file access LOOK$V_CR_DATE1 = [$BITS(3)] , ! high 3 bits of file creation date $CONTINUE LOOK$T_EXT = [$SIXBIT(3)] , ! File extension (6-bit ASCII) LOOK$V_CR_DATE2 = [$BITS(12)] , ! low 12 bits of file creation date LOOK$V_CR_TIME = [$BITS(11)] , ! file creation time (minutes past midnight) LOOK$V_MODE = [$BITS(4)] , ! file data mode LOOK$B_PROTECT = [$BITS(9)] , ! file protection code LOOK$H_PGMR = [$SHORT_INTEGER] , ! Programmer number (binary) LOOK$H_PROJ = [$SHORT_INTEGER] , ! Project number (binary) $OVERLAY( LOOK$H_PROJ ) LOOK$H_FILESIZE = [$SHORT_INTEGER] , ! File size (neg = words, pos = blocks) $CONTINUE LOOK$Z_PATH = [$SUB_BLOCK(10)] , ! Directory path $OVERLAY( LOOK$Z_PATH ) LOOK$G_FUNCT = [$INTEGER], ! Function code LOOK$G_SWITCHES = [$INTEGER], ! Switches and flags LOOK$H_PTH_PGMR = [$SHORT_INTEGER], ! Programmer field in path block LOOK$H_PTH_PROJ = [$SHORT_INTEGER], ! Project field in path block LOOK$Z_SFDS = [$SUB_BLOCK(7)] ! Beginning of SFD's $CONTINUE TES; LITERAL LOOK$K_ARG_LEN = $FIELD_SET_SIZE ; ! Length of lookup argument list MACRO $T10_LOOK_ARGS = BLOCK[ LOOK$K_ARG_LEN ] FIELD( LOOK$ARGS ) %; $FIELD XT10$BLK_FIELDS = SET XT10$Z_CB = [$SUB_BLOCK(3)], ! Tops10 control block XT10$Z_XTRA_CB = [$SUB_BLOCK(3)], ! Additional control block XT10$A_BUFFER1 = [$POINTER], ! Address of monitor buffer (first) XT10$A_BUFFER2 = [$POINTER] ! Address of monitor buffer (second) TES; LITERAL XT10$K_BLK_LEN = $FIELD_SET_SIZE; MACRO $XT10_BLOCK = BLOCK[XT10$K_BLK_LEN] FIELD(XT10$BLK_FIELDS) %; $FIELD XT10$HDR_FIELDS = SET ! TOPS10 buffer header block: XT10$G_STATUS = [$BYTES(4)], ! file status word XT10$Z_BFHDR = [$BYTES(4)], ! buffer header word $OVERLAY( XT10$Z_BFHDR ) ! XT10$A_NXT_BUFF = [$ADDRESS], ! address of the next buffer XT10$V_SIZE = [$BITS(17)], ! buffer size (+1) XT10$V_USE_BIT = [$BIT], ! use bit $CONTINUE ! XT10$H_WORD_CNT = [$BYTES(2)], ! word count XT10$H_BKP_WORD = [$BYTES(2)] ! bookeeping word TES; LITERAL XT10$K_HDR_LEN = $FIELD_SET_SIZE; MACRO $XT10_HEADER_BLK = BLOCK[XT10$K_HDR_LEN] FIELD(XT10$HDR_FIELDS) %; ! ! TOPS-10 I/O Interface Macros ! LITERAL X10$K_BUFFER_SZ = 128, X10$K_HEADER_SZ = 3, X10$K_USE_BIT = %O'400000000000', X10$K_MAX_SFD = 6, x10$k_right_hlf = %O'000000777777', x10$k_left_hlf = %O'777777000000'; MACRO $T10_CORE( address, physical ) = BEGIN BUILTIN UUO; REGISTER $t10$ac1 = 1; $t10$ac1 = address; UUO( 1, %O'47', $t10$ac1, %IF %NULL(physical) %THEN %O'11' ) %ELSE %O'200011' ) %FI END %, $T10_CLOSE( channel, options ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'70', channel, %IF %NULL(options) %THEN 0 ) %ELSE options ) %FI END %, $T10_ENTER( channel, argument_list ) = BEGIN BUILTIN UUO; UUO( 1, %O'77', channel, argument_list ) END %, $T10_GETPPN( proj_numb, pgmr_numb ) = BEGIN BUILTIN UUO; REGISTER ppn; UUO( 1, %O'47', ppn, %O'24' ); proj_numb = .ppn <18,18>; pgmr_numb = .ppn <0,18>; END %, $T10_GETSTS( channel ) = BEGIN BUILTIN UUO; LOCAL return_status; UUO( 0, %O'62', channel, return_status ); .return_status END %, $T10_IN( channel, argument_list ) = BEGIN BUILTIN UUO; NOT UUO( 1, %O'56', channel, %IF %NULL(argument_list) %THEN 0 ) %ELSE argument_list ) %FI END %, $T10_INCHRS( addr_of_char ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'2', addr_of_char ) END %, $T10_INCHRW( addr_of_char ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'0', addr_of_char ) END %, $T10_INCHSL( addr_of_char ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'5', addr_of_char ) END %, $T10_INCHWL( addr_of_char ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'4', addr_of_char ) END %, $T10_LOOKUP( channel, argument_list ) = BEGIN BUILTIN UUO; UUO( 1, %O'76', channel, argument_list ) END %, $T10_MONRT = BEGIN BUILTIN UUO; UUO( 0, %O'47', %O'1', %O'12' ) END %, $T10_OPEN( channel, argument_list ) = BEGIN BUILTIN UUO; UUO( 1, %O'50', channel, argument_list ) END %, $T10_OUT( channel, argument_list ) = BEGIN BUILTIN UUO; NOT UUO( 1, %O'57', channel, %IF %NULL(argument_list) %THEN 0 ) %ELSE argument_list ) %FI END %, $T10_OUTCHR( addr_of_char ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'1', addr_of_char ) END %, $T10_OUTSTR( addr_of_string ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'51', %O'3', addr_of_string ) END %, $T10_PATH( length, addr ) = BEGIN BUILTIN UUO; REGISTER $t10$ac; $t10$ac <0,18> = addr; $t10$ac <18,18> = length; UUO( 1, %O'47', $t10$ac, %O'110' ) END %, $T10_PJOB = BEGIN BUILTIN UUO; REGISTER job_number; UUO( 0, %O'47', job_number, %O'30' ); .job_number END %, $T10_RELEASE( channel ) = BEGIN BUILTIN UUO; NOT UUO( 0, %O'71', channel, 0 ) END %, $T10_RENAME( channel, argument_list ) = BEGIN BUILTIN UUO; UUO( 1, %O'55', channel, argument_list ) END %, $T10_RESET = BEGIN BUILTIN UUO; UUO( 0, %O'47', 0, 0, ) END %, $T10_USETI( channel, block_number ) = BEGIN BUILTIN UUO; UUO( 0, %O'74', channel, block_number ) END %, $T10_USETO( channel, block_number ) = BEGIN BUILTIN UUO; UUO( 0, %O'75', channel, block_number ) END %, $T10_ERROR( error_code, default ) = CASE error_code FROM 0 TO ERNLI_ OF SET [ ERFNF_ ] : $XPO_QUIT( NO_FILE ); [ ERIPP_ ] : $XPO_QUIT( NO_DIRECT ); [ ERPRT_ ] : $XPO_QUIT( PROTECTED ); [ ERFBM_ ] : $XPO_QUIT( IN_USE ); [ ERAEF_ ] : $XPO_QUIT( EXISTS ); [ ERNRM_ ] : $XPO_QUIT( NO_SPACE ); [ ERWLK_, ERFCU_ ] : $XPO_QUIT( NO_WRITE ); [ ERNET_ ] : $XPO_QUIT( NO_MEMORY ); [ ERDNE_ ] : $XPO_QUIT( NO_DELETE ); [ ERSNF_ ] : $XPO_QUIT( NO_SUBDIR ); ! [ ERENQ_ ] : $XPO_QUIT( LOCKED ); [ INRANGE ] : $XPO_QUIT( default ); [ OUTRANGE ] : $XPO_QUIT( BAD_LOGIC ); TES %; ! ! The following literal definitions were extracted from UUOSYM.R36 which ! cannot be used directly due to numerous symbol name conflicts. ! LITERAL $BFADR = %O'000000000000'; LITERAL $BFCNT = %O'000000000002'; LITERAL $BFCTR = %O'000000000002'; LITERAL $BFHDR = %O'000000000001'; LITERAL $BFPTR = %O'000000000001'; LITERAL $BFSTS = %O'000000000000'; LITERAL $BFUDX = %O'000000000003'; LITERAL $IOASC = %O'000000000000'; LITERAL $IOASL = %O'000000000001'; LITERAL $IOBIN = %O'000000000014'; LITERAL $IODMP = %O'000000000017'; LITERAL $IODPR = %O'000000000016'; LITERAL $IOIBN = %O'000000000013'; LITERAL $IOIDP = %O'000000000015'; LITERAL $IOIMG = %O'000000000010'; LITERAL $IOPIM = %O'000000000002'; LITERAL CL$ACS = %O'000000000010'; LITERAL CL$DAT = %O'000000000100'; LITERAL CL$DLL = %O'000000000004'; LITERAL CL$IN = %O'000000000002'; LITERAL CL$NMB = %O'000000000020'; LITERAL CL$OUT = %O'000000000001'; LITERAL CL$RST = %O'000000000040'; LITERAL ERAEF_ = %O'000000000004'; LITERAL ERBNF_ = %O'000000000020'; LITERAL ERCSD_ = %O'000000000021'; LITERAL ERDNA_ = %O'000000000011'; LITERAL ERDNE_ = %O'000000000022'; LITERAL ERFBM_ = %O'000000000003'; LITERAL ERFCU_ = %O'000000000030'; LITERAL ERFNF_ = %O'000000000000'; LITERAL ERILU_ = %O'000000000013'; LITERAL ERIPP_ = %O'000000000001'; LITERAL ERISU_ = %O'000000000005'; LITERAL ERLBC_ = %O'000000000001'; LITERAL ERLNM_ = %O'000000000002'; LITERAL ERLOH_ = %O'000000000031'; LITERAL ERLVL_ = %O'000000000025'; LITERAL ERNCE_ = %O'000000000026'; LITERAL ERNEC_ = %O'000000000010'; LITERAL ERNET_ = %O'000000000016'; LITERAL ERNLI_ = %O'000000000032'; LITERAL ERNRM_ = %O'000000000014'; LITERAL ERNSD_ = %O'000000000012'; LITERAL ERNSF_ = %O'000000000007'; LITERAL ERPOA_ = %O'000000000017'; LITERAL ERPRT_ = %O'000000000002'; LITERAL ERSLE_ = %O'000000000024'; LITERAL ERSNF_ = %O'000000000023'; LITERAL ERSNS_ = %O'000000000027'; LITERAL ERTRN_ = %O'000000000006'; LITERAL ERWLK_ = %O'000000000015'; LITERAL IO$ACT = %O'000000010000'; LITERAL IO$BKT = %O'000000040000'; LITERAL IO$BOT = %O'000000004000'; LITERAL IO$D29 = %O'000000000100'; LITERAL IO$DEN = %O'000000000600'; LITERAL IO$DER = %O'000000200000'; LITERAL IO$DTE = %O'000000100000'; LITERAL IO$EOF = %O'000000020000'; LITERAL IO$EOT = %O'000000002000'; LITERAL IO$ERR = %O'000000740000'; LITERAL IO$FCS = %O'000000000100'; LITERAL IO$IMP = %O'000000400000'; LITERAL IO$LEM = %O'000000000100'; LITERAL IO$MOD = %O'000000000017'; LITERAL IO$NRC = %O'000000000100'; LITERAL IO$NSD = %O'000000000100'; LITERAL IO$PAR = %O'000000001000'; LITERAL IO$PTI = %O'000000004000'; LITERAL IO$PTM = %O'000000001000'; LITERAL IO$PTO = %O'000000002000'; LITERAL IO$SFF = %O'000000000100'; LITERAL IO$SIM = %O'000000000100'; LITERAL IO$SSD = %O'000000000200'; LITERAL IO$SUP = %O'000000000200'; LITERAL IO$SYN = %O'000000000040'; LITERAL IO$TEC = %O'000000000400'; LITERAL IO$UWC = %O'000000000020'; LITERAL IO$WHD = %O'000000000100';