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

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

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

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

See the “IA-32 Architecture Compatibility” section below.The LOCK prefix can be prepended only to the following instructions and only to thoseforms of the instructions where the destination operand is a memory operand: ADD,ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, DEC, INC, NEG, NOT, OR, SBB,SUB, XOR, XADD, and XCHG. If the LOCK prefix is used with one of these instructionsand the source operand is a memory operand, an undefined opcode exception (#UD)may be generated. An undefined opcode exception will also be generated if the LOCKprefix is used with any instruction not in the above list. The XCHG instruction alwaysasserts the LOCK# signal regardless of the presence or absence of the LOCK prefix.The LOCK prefix is typically used with the BTS instruction to perform a read-modifywrite operation on a memory location in shared memory environment.The integrity of the LOCK prefix is not affected by the alignment of the memory field.Memory locking is observed for arbitrarily misaligned fields.This instruction’s operation is the same in non-64-bit modes and 64-bit mode.IA-32 Architecture CompatibilityBeginning with the P6 family processors, when the LOCK prefix is prefixed to aninstruction and the memory area being accessed is cached internally in theprocessor, the LOCK# signal is generally not asserted.

Instead, only the processor’scache is locked. Here, the processor’s cache coherency mechanism ensures that the3-614 Vol. 2ALOCK—Assert LOCK# Signal PrefixINSTRUCTION SET REFERENCE, A-Moperation is carried out atomically with regards to memory. See “Effects of a LockedOperation on Internal Processor Caches” in Chapter 8 of Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3A, the for more information onlocking of caches.OperationAssertLOCK#(DurationOfAccompaningInstruction);Flags AffectedNone.Protected Mode Exceptions#UDIf the LOCK prefix is used with an instruction not listed: ADD,ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCH8B, DEC, INC,NEG, NOT, OR, SBB, SUB, XOR, XADD, XCHG.Other exceptions can be generated by the instruction when theLOCK prefix is applied.Real-Address Mode ExceptionsSame exceptions as in protected mode.Virtual-8086 Mode ExceptionsSame exceptions as in protected mode.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode ExceptionsSame exceptions as in protected mode.LOCK—Assert LOCK# Signal PrefixVol.

2A 3-615INSTRUCTION SET REFERENCE, A-MLODS/LODSB/LODSW/LODSD/LODSQ—Load StringOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg ModeACLODS m8AValidValidFor legacy mode, Load byteat address DS:(E)SI into AL.For 64-bit mode load byteat address (R)SI into AL.ADLODS m16AValidValidFor legacy mode, Load wordat address DS:(E)SI into AX.For 64-bit mode load wordat address (R)SI into AX.ADLODS m32AValidValidFor legacy mode, Loaddword at address DS:(E)SIinto EAX. For 64-bit modeload dword at address (R)SIinto EAX.REX.W + ADLODS m64AValidN.E.Load qword at address (R)SIinto RAX.ACLODSBAValidValidFor legacy mode, Load byteat address DS:(E)SI into AL.For 64-bit mode load byteat address (R)SI into AL.ADLODSWAValidValidFor legacy mode, Load wordat address DS:(E)SI into AX.For 64-bit mode load wordat address (R)SI into AX.ADLODSDAValidValidFor legacy mode, Loaddword at address DS:(E)SIinto EAX.

For 64-bit modeload dword at address (R)SIinto EAX.REX.W + ADLODSQAValidN.E.Load qword at address (R)SIinto RAX.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4ANANANANADescriptionLoads a byte, word, or doubleword from the source operand into the AL, AX, or EAXregister, respectively. The source operand is a memory location, the address of which3-616 Vol. 2ALODS/LODSB/LODSW/LODSD/LODSQ—Load StringINSTRUCTION SET REFERENCE, A-Mis read from the DS:EDI or the DS:SI registers (depending on the address-sizeattribute of the instruction, 32 or 16, respectively).

The DS segment may be overridden with a segment override prefix.At the assembly-code level, two forms of this instruction are allowed: the “explicitoperands” form and the “no-operands” form. The explicit-operands form (specifiedwith the LODS mnemonic) allows the source operand to be specified explicitly. Here,the source operand should be a symbol that indicates the size and location of thesource value.

The destination operand is then automatically selected to match thesize of the source operand (the AL register for byte operands, AX for word operands,and EAX for doubleword operands). This explicit-operands form is provided to allowdocumentation; however, note that the documentation provided by this form can bemisleading. That is, the source operand symbol must specify the correct type (size)of the operand (byte, word, or doubleword), but it does not have to specify thecorrect location. The location is always specified by the DS:(E)SI registers, whichmust be loaded correctly before the load string instruction is executed.The no-operands form provides “short forms” of the byte, word, and doublewordversions of the LODS instructions. Here also DS:(E)SI is assumed to be the sourceoperand and the AL, AX, or EAX register is assumed to be the destination operand.The size of the source and destination operands is selected with the mnemonic:LODSB (byte loaded into register AL), LODSW (word loaded into AX), or LODSD(doubleword loaded into EAX).After the byte, word, or doubleword is transferred from the memory location into theAL, AX, or EAX register, the (E)SI register is incremented or decremented automatically according to the setting of the DF flag in the EFLAGS register.

(If the DF flag is0, the (E)SI register is incremented; if the DF flag is 1, the ESI register is decremented.) The (E)SI register is incremented or decremented by 1 for byte operations,by 2 for word operations, or by 4 for doubleword operations.In 64-bit mode, use of the REX.W prefix promotes operation to 64 bits. LODS/LODSQload the quadword at address (R)SI into RAX. The (R)SI register is then incrementedor decremented automatically according to the setting of the DF flag in the EFLAGSregister.The LODS, LODSB, LODSW, and LODSD instructions can be preceded by the REPprefix for block loads of ECX bytes, words, or doublewords.

More often, however,these instructions are used within a LOOP construct because further processing ofthe data moved into the register is usually necessary before the next transfer can bemade. See “REP/REPE/REPZ /REPNE/REPNZ—Repeat String Operation Prefix” inChapter 4 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual,Volume 2B, for a description of the REP prefix.OperationIF AL ← SRC; (* Byte load *)THEN AL ← SRC; (* Byte load *)IF DF = 0THEN (E)SI ← (E)SI + 1;LODS/LODSB/LODSW/LODSD/LODSQ—Load StringVol. 2A 3-617INSTRUCTION SET REFERENCE, A-MELSE (E)SI ← (E)SI – 1;FI;ELSE IF AX ← SRC; (* Word load *)THEN IF DF = 0THEN (E)SI ← (E)SI + 2;ELSE (E)SI ← (E)SI – 2;IF;FI;ELSE IF EAX ← SRC; (* Doubleword load *)THEN IF DF = 0THEN (E)SI ← (E)SI + 4;ELSE (E)SI ← (E)SI – 4;FI;FI;ELSE IF RAX ← SRC; (* Quadword load *)THEN IF DF = 0THEN (R)SI ← (R)SI + 8;ELSE (R)SI ← (R)SI – 8;FI;FI;FI;Flags AffectedNone.Protected Mode Exceptions#GP(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.#SS(0)If a memory operand effective address is outside the SSsegment limit.#PF(fault-code)If a page fault occurs.#AC(0)If alignment checking is enabled and an unaligned memoryreference is made while the current privilege level is 3.#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.#SSIf a memory operand effective address is outside the SSsegment limit.3-618 Vol.

2ALODS/LODSB/LODSW/LODSD/LODSQ—Load StringINSTRUCTION SET REFERENCE, A-M#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.#AC(0)If alignment checking is enabled and an unaligned memoryreference is made.#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 memory address is in a non-canonical form.#PF(fault-code)If a page fault occurs.#AC(0)If alignment checking is enabled and an unaligned memoryreference is made while the current privilege level is 3.#UDIf the LOCK prefix is used.LODS/LODSB/LODSW/LODSD/LODSQ—Load StringVol.

2A 3-619INSTRUCTION SET REFERENCE, A-MLOOP/LOOPcc—Loop According to ECX CounterOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg ModeE2 cbLOOP rel8AValidValidDecrement count; jumpshort if count ≠ 0.E1 cbLOOPE rel8AValidValidDecrement count; jumpshort if count ≠ 0 and ZF =1.E0 cbLOOPNE rel8AValidValidDecrement count; jumpshort if count ≠ 0 and ZF =0.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AOffsetNANANADescriptionPerforms a loop operation using the RCX, ECX or CX register as a counter (dependingon whether address size is 64 bits, 32 bits, or 16 bits). Note that the LOOP instructionignores REX.W; but 64-bit address size can be over-ridden using a 67H prefix.Each time the LOOP instruction is executed, the count register is decremented, thenchecked for 0. If the count is 0, the loop is terminated and program executioncontinues with the instruction following the LOOP instruction.

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

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

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

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