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

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

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

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

The source operand can be a register or a memory location; thedestination operand is a register. The bit index is an unsigned offset from bit 0 of thesource operand. If the content source operand is 0, the content of the destinationoperand is undefined.In 64-bit mode, the instruction’s default operation size is 32 bits.

Using a REX prefixin the form of REX.R permits access to additional registers (R8-R15). Using a REXprefix in the form of REX.W promotes operation to 64 bits. See the summary chart atthe beginning of this section for encoding data and limits.OperationIF SRC = 0THENZF ← 1;DEST is undefined;ELSEZF ← 0;temp ← OperandSize – 1;WHILE Bit(SRC, temp) = 0DOtemp ← temp - 1;DEST ← temp;OD;FI;BSR—Bit Scan ReverseVol.

2A 3-103INSTRUCTION SET REFERENCE, A-MFlags AffectedThe ZF flag is set to 1 if all the source operand is 0; otherwise, the ZF flag is cleared.The CF, OF, SF, AF, and PF, flags are undefined.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.#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.3-104 Vol.

2ABSR—Bit Scan ReverseINSTRUCTION SET REFERENCE, A-M#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.BSR—Bit Scan ReverseVol. 2A 3-105INSTRUCTION SET REFERENCE, A-MBSWAP—Byte SwapOpcodeInstructionOp/En64-bitModeCompat/ DescriptionLeg Mode0F C8+rdBSWAP r32AValid*ValidReverses the byte order ofa 32-bit register.REX.W + 0FC8+rdBSWAP r64AValidN.E.Reverses the byte order ofa 64-bit register.NOTES:* See IA-32 Architecture Compatibility section below.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4Areg (r, w)NANANADescriptionReverses the byte order of a 32-bit or 64-bit (destination) register.

This instruction isprovided for converting little-endian values to big-endian format and vice versa. Toswap bytes in a word value (16-bit register), use the XCHG instruction. When theBSWAP instruction references a 16-bit register, the result is undefined.In 64-bit mode, the instruction’s default operation size is 32 bits. Using a REX prefixin the form of REX.R permits access to additional registers (R8-R15).

Using a REXprefix in the form of REX.W promotes operation to 64 bits. See the summary chart atthe beginning of this section for encoding data and limits.IA-32 Architecture Legacy CompatibilityThe BSWAP instruction is not supported on IA-32 processors earlier than theIntel486™ processor family. For compatibility with this instruction, softwareshould include functionally equivalent code for execution on Intel processors earlierthan the Intel486 processor family.OperationTEMP ← DESTIF 64-bit mode AND OperandSize = 64THENDEST[7:0] ← TEMP[63:56];DEST[15:8] ← TEMP[55:48];DEST[23:16] ← TEMP[47:40];DEST[31:24] ← TEMP[39:32];DEST[39:32] ← TEMP[31:24];3-106 Vol.

2ABSWAP—Byte SwapINSTRUCTION SET REFERENCE, A-MDEST[47:40] ← TEMP[23:16];DEST[55:48] ← TEMP[15:8];DEST[63:56] ← TEMP[7:0];ELSEDEST[7:0] ← TEMP[31:24];DEST[15:8] ← TEMP[23:16];DEST[23:16] ← TEMP[15:8];DEST[31:24] ← TEMP[7:0];FI;Flags AffectedNone.Exceptions (All Operating Modes)#UDBSWAP—Byte SwapIf the LOCK prefix is used.Vol. 2A 3-107INSTRUCTION SET REFERENCE, A-MBT—Bit TestOpcodeInstructionOp/En64-bitModeCompat/ DescriptionLeg Mode0F A3BT r/m16, r16AValidValidStore selected bit in CF flag.0F A3BT r/m32, r32AValidValidStore selected bit in CF flag.REX.W + 0F A3BT r/m64, r64AValidN.E.Store selected bit in CF flag.0F BA /4 ibBT r/m16, imm8BValidValidStore selected bit in CF flag.0F BA /4 ibBT r/m32, imm8BValidValidStore selected bit in CF flag.REX.W + 0F BA/4 ibBT r/m64, imm8BValidN.E.Store selected bit in CF flag.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AModRM:r/m (r)ModRM:reg (r)NANABModRM:r/m (r)imm8NANADescriptionSelects the bit in a bit string (specified with the first operand, called the bit base) atthe bit-position designated by the bit offset (specified by the second operand) andstores the value of the bit in the CF flag.

The bit base operand can be a register or amemory location; the bit offset operand can be a register or an immediate value:•If the bit base operand specifies a register, the instruction takes the modulo 16,32, or 64 of the bit offset operand (modulo size depends on the mode andregister size; 64-bit operands are available only in 64-bit mode).•If the bit base operand specifies a memory location, the operand represents theaddress of the byte in memory that contains the bit base (bit 0 of the specifiedbyte) of the bit string. The range of the bit position that can be referenced by theoffset operand depends on the operand size.See also: Bit(BitBase, BitOffset) on page 3-11.Some assemblers support immediate bit offsets larger than 31 by using the immediate bit offset field in combination with the displacement field of the memoryoperand. In this case, the low-order 3 or 5 bits (3 for 16-bit operands, 5 for 32-bitoperands) of the immediate bit offset are stored in the immediate bit offset field, andthe high-order bits are shifted and combined with the byte displacement in theaddressing mode by the assembler.

The processor will ignore the high order bits ifthey are not zero.When accessing a bit in memory, the processor may access 4 bytes starting from thememory address for a 32-bit operand size, using by the following relationship:3-108 Vol. 2ABT—Bit TestINSTRUCTION SET REFERENCE, A-MEffective Address + (4 ∗ (BitOffset DIV 32))Or, it may access 2 bytes starting from the memory address for a 16-bit operand,using this relationship:Effective Address + (2 ∗ (BitOffset DIV 16))It may do so even when only a single byte needs to be accessed to reach the givenbit. When using this bit addressing mechanism, software should avoid referencingareas of memory close to address space holes. In particular, it should avoid references to memory-mapped I/O registers. Instead, software should use the MOVinstructions to load from or store to these addresses, and use the register form ofthese instructions to manipulate the data.In 64-bit mode, the instruction’s default operation size is 32 bits.

Using a REX prefixin the form of REX.R permits access to additional registers (R8-R15). Using a REXprefix in the form of REX.W promotes operation to 64 bit operands. See the summarychart at the beginning of this section for encoding data and limits.OperationCF ← Bit(BitBase, BitOffset);Flags AffectedThe CF flag contains the value of the selected bit.

The ZF flag is unaffected. The OF,SF, AF, and PF flags are undefined.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.#UDIf the LOCK prefix is used.BT—Bit TestVol.

2A 3-109INSTRUCTION SET REFERENCE, A-MVirtual-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.3-110 Vol.

2ABT—Bit TestINSTRUCTION SET REFERENCE, A-MBTC—Bit Test and ComplementOpcodeInstructionOp/En64-bitModeCompat/ DescriptionLeg Mode0F BBBTC r/m16, r16AValidValidStore selected bit in CF flagand complement.0F BBBTC r/m32, r32AValidValidStore selected bit in CF flagand complement.REX.W + 0F BBBTC r/m64, r64AValidN.E.Store selected bit in CF flagand complement.0F BA /7 ibBTC r/m16, imm8BValidValidStore selected bit in CF flagand complement.0F BA /7 ibBTC r/m32, imm8BValidValidStore selected bit in CF flagand complement.REX.W + 0F BA/7 ibBTC r/m64, imm8BValidN.E.Store selected bit in CF flagand complement.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AModRM:r/m (r, w)ModRM:reg (r)NANABModRM:r/m (r, w)imm8NANADescriptionSelects the bit in a bit string (specified with the first operand, called the bit base) atthe bit-position designated by the bit offset operand (second operand), stores thevalue of the bit in the CF flag, and complements the selected bit in the bit string.

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

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

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

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