Главная » Просмотр файлов » Volume 3 General-Purpose and System Instructions

Volume 3 General-Purpose and System Instructions (794097), страница 30

Файл №794097 Volume 3 General-Purpose and System Instructions (Intel and AMD manuals) 30 страницаVolume 3 General-Purpose and System Instructions (794097) страница 302019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

3.13—July 2007rFLAGS AffectedNoneExceptionsExceptionGeneral protection,#GP152VirtualReal 8086 ProtectedXXXCause of ExceptionThe target offset exceeded the code segment limit or was noncanonical.LOOPccInstruction Reference24594—Rev. 3.13—July 2007AMD64 TechnologyLZCNTCount Leading ZerosCounts the number of leading zero bits in the 16-, 32-, or 64-bit general purpose register or memorysource operand. Counting starts downward from the most significant bit and stops when the highest bithaving a value of 1 is encountered or when the least significant bit is encountered. The count is writtento the destination register.If the input operand is zero, CF is set to 1 and the size (in bits) of the input operand is written to thedestination register. Otherwise, CF is cleared.If the most significant bit is a one, the ZF flag is set to 1, zero is written to the destination register.Otherwise, ZF is cleared.Support for the LZCNT instruction is indicated by ECX bit 5 (LZCNT) as returned by CPUIDfunction 8000_0001h.

If the LZCNT instruction is not available, the encoding is treated as the BSRinstruction. Software MUST check the CPUID bit once per program or library initialization beforeusing the LZCNT instruction, or inconsistent behavior may result.MnemonicOpcodeDescriptionLZCNTreg16, reg/mem16F3 0F BD /rCount the number of leading zeros in reg/mem16.LZCNTreg32, reg/mem32F3 0F BD /rCount the number of leading zeros in reg/mem32.LZCNTreg64, reg/mem64F3 0F BD /rCount the number of leading zeros in reg/mem64.Related InstructionsBSF, BSR, POPCNTInstruction ReferenceLZCNT153AMD64 Technology24594—Rev. 3.13—July 2007rFLAGS AffectedIDVIPVIFACVMRFNTIOPLOFDFIFTFU2120191817161413–12111098SFZFAFPFCFUMUUM76420Note: Bits 31–22, 15, 5, 3, and 1 are reserved.

A flag set to 1 or cleared to 0 is M (modified). Unaffected flags areblank. Undefined flags are U.ExceptionsExceptionStack, #SSGeneral protection, #GPVirtualReal 8086 ProtectedCause of ExceptionXXXA memory address exceeded the stack segment limit orwas non-canonical.XXXA memory address exceeded a data segment limit or wasnon-canonical.XA null data segment was used to reference memory.Page fault, #PFXXA page fault resulted from the execution of the instruction.Alignment check, #ACXXAn unaligned memory reference was performed whilealignment checking was enabled.154LZCNTInstruction Reference24594—Rev.

3.13—July 2007AMD64 TechnologyMFENCEMemory FenceActs as a barrier to force strong memory ordering (serialization) between load and store instructionspreceding the MFENCE, and load and store instructions that follow the MFENCE. The processor mayperform loads out of program order with respect to non-conflicting stores for certain memory types.The MFENCE instruction guarantees that the system completes all previous memory accesses beforeexecuting subsequent accesses.The MFENCE instruction is weakly-ordered with respect to data and instruction prefetches.Speculative loads initiated by the processor, or specified explicitly using cache-prefetch instructions,can be reordered around an MFENCE.In addition to load and store instructions, the MFENCE instruction is strongly ordered with respect toother MFENCE instructions, LFENCE instructions, SFENCE instructions, serializing instructions,and CLFLUSH instructions.

Further details on the use of MFENCE to order accesses among differingmemory types may be found in AMD64 Architecture Programmer’s Manual Volume 2: SystemProgramming, section 7.4 “Memory Types” on page 168.Support for the MFENCE instruction is indicated when the SSE2 bit (bit 26) is set to 1 in EDX afterexecuting CPUID with function 0000_0001h.MnemonicOpcodeMFENCE0F AE F0DescriptionForce strong ordering of (serialized) load and storeoperations.Related InstructionsLFENCE, SFENCErFLAGS AffectedNoneExceptionsExceptionInvalid opcode, #UDVirtualReal 8086 ProtectedXInstruction ReferenceXXCause of ExceptionThe MFENCE instruction is not supported as indicated by bit26 of CPUID function 0000_0001h.MFENCE155AMD64 Technology24594—Rev. 3.13—July 2007MOVMoveCopies an immediate value or the value in a general-purpose register, segment register, or memorylocation (second operand) to a general-purpose register, segment register, or memory location.

Thesource and destination must be the same size (byte, word, doubleword, or quadword) and cannot bothbe memory locations.In opcodes A0 through A3, the memory offsets (called moffsets) are address sized. In 64-bit mode,memory offsets default to 64 bits. Opcodes A0–A3, in 64-bit mode, are the only cases that support a64-bit offset value. (In all other cases, offsets and displacements are a maximum of 32 bits.) The B8through BF (B8 +rq) opcodes, in 64-bit mode, are the only cases that support a 64-bit immediate value(in all other cases, immediate values are a maximum of 32 bits).When reading segment-registers with a 32-bit operand size, the processor zero-extends the 16-bitselector results to 32 bits. When reading segment-registers with a 64-bit operand size, the processorzero-extends the 16-bit selector to 64 bits.

If the destination operand specifies a segment register (DS,ES, FS, GS, or SS), the source operand must be a valid segment selector.It is possible to move a null segment selector value (0000–0003h) into the DS, ES, FS, or GS register.This action does not cause a general protection fault, but a subsequent reference to such a segmentdoes cause a #GP exception. For more information about segment selectors, see “Segment Selectorsand Registers” on page 67.When the MOV instruction is used to load the SS register, the processor blocks external interrupts untilafter the execution of the following instruction. This action allows the following instruction to be aMOV instruction to load a stack pointer into the ESP register (MOV ESP,val) before an interruptoccurs.

However, the LSS instruction provides a more efficient method of loading SS and ESP.Attempting to use the MOV instruction to load the CS register generates an invalid opcode exception(#UD). Use the far JMP, CALL, or RET instructions to load the CS register.To initialize a register to 0, rather than using a MOV instruction, it may be more efficient to use theXOR instruction with identical destination and source operands.MnemonicOpcodeDescriptionMOV reg/mem8, reg888 /rMove the contents of an 8-bit register to an 8-bitdestination register or memory operand.MOV reg/mem16, reg1689 /rMove the contents of a 16-bit register to a 16-bitdestination register or memory operand.MOV reg/mem32, reg3289 /rMove the contents of a 32-bit register to a 32-bitdestination register or memory operand.MOV reg/mem64, reg6489 /rMove the contents of a 64-bit register to a 64-bitdestination register or memory operand.MOV reg8, reg/mem88A /rMove the contents of an 8-bit register or memoryoperand to an 8-bit destination register.156MOVInstruction Reference24594—Rev.

3.13—July 2007MnemonicAMD64 TechnologyOpcodeDescriptionMOV reg16, reg/mem168B /rMove the contents of a 16-bit register or memoryoperand to a 16-bit destination register.MOV reg32, reg/mem328B /rMove the contents of a 32-bit register or memoryoperand to a 32-bit destination register.MOV reg64, reg/mem648B /rMove the contents of a 64-bit register or memoryoperand to a 64-bit destination register.MOV reg16/32/64/mem16,segReg8C /rMove the contents of a segment register to a 16-bit, 32bit, or 64-bit destination register or to a 16-bit memoryoperand.MOV segReg, reg/mem168E /rMove the contents of a 16-bit register or memoryoperand to a segment register.MOV AL, moffset8A0Move 8-bit data at a specified memory offset to the ALregister.MOV AX, moffset16A1Move 16-bit data at a specified memory offset to the AXregister.MOV EAX, moffset32A1Move 32-bit data at a specified memory offset to theEAX register.MOV RAX, moffset64A1Move 64-bit data at a specified memory offset to theRAX register.MOV moffset8, ALA2Move the contents of the AL register to an 8-bit memoryoffset.MOV moffset16, AXA3Move the contents of the AX register to a 16-bit memoryoffset.MOV moffset32, EAXA3Move the contents of the EAX register to a 32-bitmemory offset.MOV moffset64, RAXA3Move the contents of the RAX register to a 64-bitmemory offset.MOV reg8, imm8B0 +rb +ibMove an 8-bit immediate value into an 8-bit register.MOV reg16, imm16B8 +rw +iwMove a 16-bit immediate value into a 16-bit register.MOV reg32, imm32B8 +rd +idMove an 32-bit immediate value into a 32-bit register.MOV reg64, imm64B8 +rq +iqMove an 64-bit immediate value into a 64-bit register.MOV reg/mem8, imm8C6 /0 +ibMove an 8-bit immediate value to an 8-bit register ormemory operand.MOV reg/mem16, imm16C7 /0 +iwMove a 16-bit immediate value to a 16-bit register ormemory operand.MOV reg/mem32, imm32C7 /0 +idMove a 32-bit immediate value to a 32-bit register ormemory operand.MOV reg/mem64, imm32C7 /0 +idMove a 32-bit signed immediate value to a 64-bitregister or memory operand.Instruction ReferenceMOV157AMD64 Technology24594—Rev.

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

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

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

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