모두의 코드
STAC (Intel x86/64 assembly instruction)

작성일 : 2020-09-01 이 글은 632 번 읽혔습니다.

STAC

Set AC Flag in EFLAGS Register

참고 사항

아래 표를 해석하는 방법은 x86-64 명령어 레퍼런스 읽는 법 글을 참조하시기 바랍니다.

Opcode/
Instruction

Op /
En

64/32 bit
Mode
Support

CPUID
Feature
Flag

Description

0F 01 CB
STAC

NP

V/V

SMAP

Set the AC flag in the EFLAGS register.

Instruction Operand Encoding

Op/En

Operand 1

Operand 2

Operand 3

Operand 4

NP

NA

NA

NA

NA

Description

Sets the AC flag bit in EFLAGS register. This may enable alignment checking of user-mode data accesses. This allows explicit supervisor-mode data accesses to user-mode pages even if the SMAP bit is set in the CR4 register.

This instruction's operation is the same in non-64-bit modes and 64-bit mode. Attempts to execute STAC when CPL > 0 cause #UD.

Operation

EFLAGS.AC <- 1;

Flags Affected

AC set. Other flags are unaffected.

Protected Mode Exceptions

#UD

  • If the LOCK prefix is used.

  • If the CPL > 0.

  • If CPUID.(EAX=07H, ECX=0H):EBX.SMAP[bit 20] = 0.

Real-Address Mode Exceptions

#UD

  • If the LOCK prefix is used.

  • If CPUID.(EAX=07H, ECX=0H):EBX.SMAP[bit 20] = 0.

Virtual-8086 Mode Exceptions

#UD

  • The STAC instruction is not recognized in virtual-8086 mode.

Compatibility Mode Exceptions

#UD

  • If the LOCK prefix is used.

  • If the CPL > 0.

  • If CPUID.(EAX=07H, ECX=0H):EBX.SMAP[bit 20] = 0.

64-Bit Mode Exceptions

#UD

  • If the LOCK prefix is used.

  • If the CPL > 0.

  • If CPUID.(EAX=07H, ECX=0H):EBX.SMAP[bit 20] = 0.

첫 댓글을 달아주세요!
프로필 사진 없음
강좌에 관련 없이 궁금한 내용은 여기를 사용해주세요

    댓글을 불러오는 중입니다..