# MX\_GETDEV > [HTML Version](mx_getdev.htm) _Reviewed May 2024_ **xcall MIAMEX, MX\_GETDEV, dev, proj, prog, drbase, status \{,devflags\}** MX\_GETDEV (MIAMEX 19) returns information about the next device in the device table. **Parameters** _dev _([String](string.htm.md)), 6) \[in/out\] On input, if null (""), resets the scan to the start of the device table—i.e. returns the first device in the table. On output, returns the next device in the table, e.g. "DSK1", with no trailing colon. See _status_. _proj_, _prog _(B1 or B2) \[out\] For normal device definitions, whose PPNs are implicitly defined by the existence of ###### subdirectories, these parameters will return 0. Only for devices that are explicitly defined with only a single PPN will these parameters be returned with non-zero values. In that case, if _proj _and _proj _are mapped as B2 (preferred), the two parts of the PPN will be returned as decimal values ranging from 0-999. Although deprecated, for backwards compatibility, if _proj _and _prog _are mapped as B1 variables, the values will be encoded as if octal (with a range of 0-377). _drbase _([String](string.htm.md)), 100+) \[out\] The base path for the device or device/ppn combination is returned here. It will be terminated with a trailing directory separator character, e.g. c:\\vm\\miame\\dsk0\\. _status _([Num](num.htm.md)) \[out\] Returns 0 on success, else 1 if it hits the end of the device table, in which case the rest of the return parameters should be ignored. Note that the next call after hitting the end of the table will return the first device in the table. _devflags _([Num](num.htm.md)) \[out\] If specified, returns attribute flags related to the device (zero or more of the following): | **Value** | **Meaning** | |------|------| | \&h01 | Read-only device | | \&h02 | Memory device | **Comments** See the [DEVICE](device_sp.htm.md) system parameter for information about how the devices in the device table are defined. When MX\_GETDEV hits the end of the device table, it returns a _status _code and then starts over at the beginning on the next call. You can also force it to restart at the beginning by setting the _dev _parameter to "". MX\_GETDEV is very similar to [MX\_GETERSATZ](mx_getersatz.htm.md), but returns information about "real" devices rather than ersatz devices. **See Also** • [PPN Numbering](ppnnumbering.htm.md)