Главная » Просмотр файлов » Volume 2A Instruction Set Reference A-M

Volume 2A Instruction Set Reference A-M (794101), страница 97

Файл №794101 Volume 2A Instruction Set Reference A-M (Intel and AMD manuals) 97 страницаVolume 2A Instruction Set Reference A-M (794101) страница 972019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 97)

They are the only instructions that directly load alinear address (that is, not a segment-relative address) and a limit in protectedmode. They are commonly executed in real-address mode to allow processor initialization prior to switching to protected mode.In 64-bit mode, the instruction’s operand size is fixed at 8+2 bytes (an 8-byte baseand a 2-byte limit). See the summary chart at the beginning of this section forencoding data and limits.See “SGDT—Store Global Descriptor Table Register” in Chapter 4, Intel® 64 andIA-32 Architectures Software Developer’s Manual, Volume 2B, for information onstoring the contents of the GDTR and IDTR.OperationIF Instruction is LIDTTHENIF OperandSize = 16THEN3-606 Vol. 2ALGDT/LIDT—Load Global/Interrupt Descriptor Table RegisterINSTRUCTION SET REFERENCE, A-MIDTR(Limit) ← SRC[0:15];IDTR(Base) ← SRC[16:47] AND 00FFFFFFH;ELSE IF 32-bit Operand SizeTHENIDTR(Limit) ← SRC[0:15];IDTR(Base) ← SRC[16:47];FI;ELSE IF 64-bit Operand Size (* In 64-Bit Mode *)THENIDTR(Limit) ← SRC[0:15];IDTR(Base) ← SRC[16:79];FI;FI;ELSE (* Instruction is LGDT *)IF OperandSize = 16THENGDTR(Limit) ← SRC[0:15];GDTR(Base) ← SRC[16:47] AND 00FFFFFFH;ELSE IF 32-bit Operand SizeTHENGDTR(Limit) ← SRC[0:15];GDTR(Base) ← SRC[16:47];FI;ELSE IF 64-bit Operand Size (* In 64-Bit Mode *)THENGDTR(Limit) ← SRC[0:15];GDTR(Base) ← SRC[16:79];FI;FI;FI;Flags AffectedNone.Protected Mode Exceptions#UDIf source operand is not a memory location.#GP(0)If the current privilege level is not 0.If the LOCK prefix is used.If a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.If the DS, ES, FS, or GS register is used to access memory and itcontains a NULL segment selector.LGDT/LIDT—Load Global/Interrupt Descriptor Table RegisterVol.

2A 3-607INSTRUCTION SET REFERENCE, A-M#SS(0)If a memory operand effective address is outside the SSsegment limit.#PF(fault-code)If a page fault occurs.Real-Address Mode Exceptions#UDIf source operand is not a memory location.If the LOCK prefix is used.#GPIf a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.#SSIf a memory operand effective address is outside the SSsegment limit.Virtual-8086 Mode Exceptions#UDIf source operand is not a memory location.If the LOCK prefix is used.#GP(0)The LGDT and LIDT instructions are not recognized in virtual8086 mode.#GPIf the current privilege level is not 0.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode Exceptions#SS(0)If a memory address referencing the SS segment is in a noncanonical form.#GP(0)If the current privilege level is not 0.#UDIf source operand is not a memory location.#PF(fault-code)If a page fault occurs.If the memory address is in a non-canonical form.If the LOCK prefix is used.3-608 Vol.

2ALGDT/LIDT—Load Global/Interrupt Descriptor Table RegisterINSTRUCTION SET REFERENCE, A-MLLDT—Load Local Descriptor Table RegisterOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg Mode0F 00 /2LLDT r/m16AValidValidLoad segment selectorr/m16 into LDTR.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AModRM:r/m (r)NANANADescriptionLoads the source operand into the segment selector field of the local descriptor tableregister (LDTR).

The source operand (a general-purpose register or a memory location) contains a segment selector that points to a local descriptor table (LDT). Afterthe segment selector is loaded in the LDTR, the processor uses the segment selectorto locate the segment descriptor for the LDT in the global descriptor table (GDT). Itthen loads the segment limit and base address for the LDT from the segmentdescriptor into the LDTR. The segment registers DS, ES, SS, FS, GS, and CS are notaffected by this instruction, nor is the LDTR field in the task state segment (TSS) forthe current task.If bits 2-15 of the source operand are 0, LDTR is marked invalid and the LLDT instruction completes silently.

However, all subsequent references to descriptors in the LDT(except by the LAR, VERR, VERW or LSL instructions) cause a general protectionexception (#GP).The operand-size attribute has no effect on this instruction.The LLDT instruction is provided for use in operating-system software; it should notbe used in application programs. This instruction can only be executed in protectedmode or 64-bit mode.In 64-bit mode, the operand size is fixed at 16 bits.OperationIF SRC(Offset) > descriptor table limitTHEN #GP(segment selector); FI;IF segment selector is validRead segment descriptor;IF SegmentDescriptor(Type) ≠ LDTTHEN #GP(segment selector); FI;LLDT—Load Local Descriptor Table RegisterVol.

2A 3-609INSTRUCTION SET REFERENCE, A-MIF segment descriptor is not presentTHEN #NP(segment selector); FI;LDTR(SegmentSelector) ← SRC;LDTR(SegmentDescriptor) ← GDTSegmentDescriptor;ELSE LDTR ← INVALIDFI;Flags AffectedNone.Protected Mode Exceptions#GP(0)If the current privilege level is not 0.If a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.If the DS, ES, FS, or GS register contains a NULL segmentselector.#GP(selector)If the selector operand does not point into the Global DescriptorTable or if the entry in the GDT is not a Local Descriptor Table.Segment selector is beyond GDT limit.#SS(0)If a memory operand effective address is outside the SSsegment limit.#NP(selector)If the LDT descriptor is not present.#PF(fault-code)If a page fault occurs.#UDIf the LOCK prefix is used.Real-Address Mode Exceptions#UDThe LLDT instruction is not recognized in real-address mode.Virtual-8086 Mode Exceptions#UDThe LLDT instruction is not recognized in virtual-8086 mode.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode Exceptions#SS(0)If a memory address referencing the SS segment is in a noncanonical form.#GP(0)If the current privilege level is not 0.If the memory address is in a non-canonical form.3-610 Vol.

2ALLDT—Load Local Descriptor Table RegisterINSTRUCTION SET REFERENCE, A-M#GP(selector)If the selector operand does not point into the Global DescriptorTable or if the entry in the GDT is not a Local Descriptor Table.#NP(selector)If the LDT descriptor is not present.#PF(fault-code)If a page fault occurs.#UDIf the LOCK prefix is used.Segment selector is beyond GDT limit.LLDT—Load Local Descriptor Table RegisterVol.

2A 3-611INSTRUCTION SET REFERENCE, A-MLMSW—Load Machine Status WordOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg Mode0F 01 /6LMSW r/m16AValidValidLoads r/m16 in machinestatus word of CR0.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AModRM:r/m (r)NANANADescriptionLoads the source operand into the machine status word, bits 0 through 15 of registerCR0. The source operand can be a 16-bit general-purpose register or a memory location.

Only the low-order 4 bits of the source operand (which contains the PE, MP, EM,and TS flags) are loaded into CR0. The PG, CD, NW, AM, WP, NE, and ET flags of CR0are not affected. The operand-size attribute has no effect on this instruction.If the PE flag of the source operand (bit 0) is set to 1, the instruction causes theprocessor to switch to protected mode. While in protected mode, the LMSW instruction cannot be used to clear the PE flag and force a switch back to real-address mode.The LMSW instruction is provided for use in operating-system software; it should notbe used in application programs. In protected or virtual-8086 mode, it can only beexecuted at CPL 0.This instruction is provided for compatibility with the Intel 286 processor; programsand procedures intended to run on the Pentium 4, Intel Xeon, P6 family, Pentium,Intel486, and Intel386 processors should use the MOV (control registers) instructionto load the whole CR0 register.

The MOV CR0 instruction can be used to set and clearthe PE flag in CR0, allowing a procedure or program to switch between protected andreal-address modes.This instruction is a serializing instruction.This instruction’s operation is the same in non-64-bit modes and 64-bit mode. Notethat the operand size is fixed at 16 bits.See “Changes to Instruction Behavior in VMX Non-Root Operation” in Chapter 22 ofthe Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3B, formore information about the behavior of this instruction in VMX non-root operation.OperationCR0[0:3] ← SRC[0:3];3-612 Vol. 2ALMSW—Load Machine Status WordINSTRUCTION SET REFERENCE, A-MFlags AffectedNone.Protected Mode Exceptions#GP(0)If the current privilege level is not 0.If a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.If the DS, ES, FS, or GS register is used to access memory and itcontains a NULL segment selector.#SS(0)If a memory operand effective address is outside the SSsegment limit.#PF(fault-code)If a page fault occurs.#UDIf the LOCK prefix is used.Real-Address Mode Exceptions#GPIf a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.#UDIf the LOCK prefix is used.Virtual-8086 Mode Exceptions#GP(0)If a memory operand effective address is outside the CS, DS,ES, FS, or GS segment limit.#SS(0)If a memory operand effective address is outside the SSsegment limit.#PF(fault-code)If a page fault occurs.#UDIf the LOCK prefix is used.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode Exceptions#SS(0)If a memory address referencing the SS segment is in a noncanonical form.#GP(0)If the current privilege level is not 0.#PF(fault-code)If a page fault occurs.#UDIf the LOCK prefix is used.If the memory address is in a non-canonical form.LMSW—Load Machine Status WordVol.

2A 3-613INSTRUCTION SET REFERENCE, A-MLOCK—Assert LOCK# Signal PrefixOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg ModeF0LOCKAValidValidAsserts LOCK# signal forduration of theaccompanying instruction.NOTES:* See IA-32 Architecture Compatibility section below.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4ANANANANADescriptionCauses the processor’s LOCK# signal to be asserted during execution of the accompanying instruction (turns the instruction into an atomic instruction). In a multiprocessor environment, the LOCK# signal ensures that the processor has exclusive useof any shared memory while the signal is asserted.Note that, in later Intel 64 and IA-32 processors (including the Pentium 4, Intel Xeon,and P6 family processors), locking may occur without the LOCK# signal beingasserted.

Характеристики

Тип файла
PDF-файл
Размер
2,92 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6390
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее