IOSLOOK — Locate unit control block

Note: The UCBLOOK macro is the preferred programming interface.

Description

The IOSLOOK macro locates the unit control block (UCB) associated with a device number. To use IOSLOOK, you must be executing in supervisor state. Register 13 must point to a 16-word save area where the macro stores registers 0 through 15 at offset 0. You must also include a DSECT for both the CVT (using the CVT mapping macro) and the IOCOM (using the IECDIOCM mapping macro).

Syntax

The IOSLOOK macro is written as follows:

Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede IOSLOOK.
   
IOSLOOK  
   
One or more blanks must follow IOSLOOK.
   
   DEV=(reg) reg: Register (0) - (12), (14), (15).
  Default: DEV=(6).
   
   ,UCB=(reg) reg: Register (0) - (12).
  Default: UCB=(7).
   

Parameters

The parameters are explained as follows:

DEV=(reg)
Specifies a general purpose register, symbolic or absolute, that contains the hexadecimal device number, right justified. If this parameter is omitted, register 6 is assumed.
,UCB=(reg)
Specifies a general purpose register, symbolic or absolute, that will be used to return the address of the UCB common segment. If this parameter is omitted, register 7 is assumed. If the UCB address cannot be found, then the contents of this register are unpredictable.
Note: The UCB must reside in 24-bit addressable storage.

Return codes

When IOSLOOK macro returns control to your program, GPR 15 contains a return code.

Table 1. Return Codes for the IOSLOOK Macro
Hexadecimal Return Code Meaning
00 Meaning: UCB address was found.
04 Meaning: Device number was invalid or no UCB exists.

Example

Find the UCB address for device 250. Register 2 contains the value X‘00000250’. The UCB address is to be returned in register 5 and UCBPTR is equated to 5.
IOSLOOK DEV=(2),UCB=(UCBPTR)