## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### Description

The two-byte register or memory operand of the VERR and VERW instructions contains the value of a selector. The VERR and VERW instructions determine whether the segment denoted by the selector is reachable from the current privilege level and whether the segment is readable (VERR) or writable ( VERW). If the segment is accessible, the ZF flag is set; if the segment is not accessible, the ZF flag is cleared. To set the ZF flag, the following conditions must be met:

The selector must denote a descriptor within the bounds of the table (GDT or LDT); the selector must be "defined."

The selector must denote the descriptor of a code or data segment (not that of a task state segment, LDT, or a gate).

For the VERR instruction, the segment must be readable. For the VERW instruction, the segment must be a writable data segment.

If the code segment is readable and conforming, the descriptor privilege level (DPL) can be any value for the VERR instruction. Otherwise, the DPL must be greater than or equal to (have less or the same privilege as) both the current privilege level and the selector's RPL.

The validation performed is the same as if the segment were loaded into the DS, ES, FS, or GS register, and the indicated access (read or write) were performed. The ZF flag receives the result of the validation. The selector' s value cannot result in a protection exception, enabling the software to anticipate possible segment access problems.