Kirk - Thanks much! Certainly worth considering.
I wish IBM were better organized in general around this: - the C and COBOL compilers use ARCH levels - the assembler uses ZS- codes which are different numerically - there is nothing in the PoOp that says "this instruction requires ARCH n." Yes, it says "requires the long displacement facility" but then it is another lookup to see what ARCH and/or machine type that is. Not the worst problem humanity faces, but I think a poor presentation of important information. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Kirk Wolf Sent: Wednesday, November 25, 2015 3:47 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Straightforward way to determine hardware architecture level? Charles, I agree that there should be a compiler or LE API to do this. If not: ARCH levels actually map to a set of required "Facilities" (the Principles of Operation term). You can test at the facility bits in the PSAE, mapped by IHAFACL. Then you could use the documentation on ARCH in the compiler manual to construct a bit mask for each level. Then start with the lowest level and search until you find the last one with all of the required facilities. Here's my whack at it (but I have no idea if it is accurate; Maybe open an ETR with IBM to confirm? ) ARCH(5) z-arch base. (Assuming that you know that you are running modern z/OS in z-arch mode, I would start here) - FaclZArchInstalled ARCH(6) long-displacement facility - FaclLongDisplacement ARCH(7) (z9) extended-immediate facility, DFP facility (if DFP compiler option enabled) - FaclExtendedImmediate ARCH(8) (z10) general instruction extensions facility, DFP Facility - FaclGeneralInstExtension - FaclDFPF ARCH(9) (z196) high-word facility, the interlocked-access facility, the load/store-on-condition facility, the distinct-operands-facility and the population-count facility. - FaclHighWord - FaclLoadStoreOnCondition - FaclDistinctOperands - FaclPopulationCount ARCH(10) (xC12) execution-hint facility, the load-and-trap facility, the miscellaneous-instruction-extension facility, and the transactional-execution facility. - FaclMiscInstExt - FaclExecutionHint - FaclLoadAndTrap - FaclTransactionalExecution ARCH(11) (z13) vector facility, the decimal floating point packed conversion facility, the load/store-on-condition facility, and the conditional-transaction-end facility. - Facl_VectorExtensionFacility - FACL_DFPPackedConversion - FACL_LoadStoreOnCond2 - FACL_CTEND ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN