THE 80286 INSTRUCTION SET

VERR,VERW-Verifya Segment for Reading or Writing

Opcode

 

Instruction

Clocks

Description

OF

00

/4

VERR ew

14,mem=16

Set ZF=1 if seg. can be read, selector ew

OF

00

/5

VERWew

14,mem=16

Set ZF= 1 if seg. can be written, selector ew

FLAGS MODIFIED

Zero

FLAGS UNDEFINED

None

OPERATION

VERR and VERW expect the 2-byte register or memory operand to contain the value of a selector. The instructions determine whether the segment denoted by the selector is reachable from the current privilege level; the instructions also determine whether it is readable or writable. If the segment is determined to be accessible, the zero flag is set to 1; if the segment is not accessible, it is set to o. To set ZF, the following conditions must be met:

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

2.The selector must denote the descriptor of a code or data segment.

3.If the instruction is VERR, the segment must be readable. If the instruction is VERW, the segment must be a writable data segment.

4.If the code segment is readable and conforming, the descriptor privilege level (DPL) can be any value for VERR. 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 DS or ES and the indicated access (read or write) were performed. The zero flag receives the result of the validation. The selector's value cannot result in a protection exception. This enables the software to anticipate possible segment access problems.

PROTECTED MODE EXCEPTIONS

The only faults that can occur are those generated by illegally addressing the memory operand which contains the selector. The selector is not loaded into any segment register, and no faults attributable to the selector operand are generated.

#GP(O) for an illegal memory operand effective address in the CS, DS, or ES segments; #SS(O) for an illegal address in the SS segment.

8-111

Page 321
Image 321
Intel 80286 VERR,VERW-Verifya Segment for Reading or Writing, 14,mem=16 Set ZF=1 if seg. can be read, selector ew, 111