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

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

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

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

For 1-bit rotates, the instruction sets the OF flag to the exclusive OR of thetwo most significant bits of the result. When the rotate count is greater than 1, the OF flag is undefined.When the rotate count is 0, no flags are affected.MnemonicOpcodeDescriptionROR reg/mem8, 1D0 /1Rotate an 8-bit register or memory location right 1 bit.ROR reg/mem8, CLD2 /1Rotate an 8-bit register or memory location right thenumber of bits specified in the CL register.ROR reg/mem8, imm8C0 /1 ibRotate an 8-bit register or memory location right thenumber of bits specified by an 8-bit immediate value.ROR reg/mem16, 1D1 /1Rotate a 16-bit register or memory location right 1 bit.ROR reg/mem16, CLD3 /1Rotate a 16-bit register or memory location right thenumber of bits specified in the CL register.ROR reg/mem16, imm8C1 /1 ibRotate a 16-bit register or memory location right thenumber of bits specified by an 8-bit immediate value.ROR reg/mem32, 1D1 /1Rotate a 32-bit register or memory location right 1 bit.ROR reg/mem32, CLD3 /1Rotate a 32-bit register or memory location right thenumber of bits specified in the CL register.ROR reg/mem32, imm8C1 /1 ibRotate a 32-bit register or memory location right thenumber of bits specified by an 8-bit immediate value.ROR reg/mem64, 1D1 /1Rotate a 64-bit register or memory location right 1 bit.ROR reg/mem64, CLD3 /1Rotate a 64-bit register or memory operand right thenumber of bits specified in the CL register.ROR reg/mem64, imm8C1 /1 ibRotate a 64-bit register or memory operand right thenumber of bits specified by an 8-bit immediate value.Related InstructionsRCL, RCR, ROLInstruction ReferenceROR213AMD64 Technology24594—Rev.

3.13—July 2007rFLAGS AffectedIDVIPVIFACVMRFNTIOPLOFDFIFTFSFZFAFPFM2120191817161413–1211CFM109876420Note: 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, #SSVirtualReal 8086 ProtectedCause of ExceptionXXXA memory address exceeded the stack segment limit or wasnon-canonical.XXXA memory address exceeded a data segment limit or was noncanonical.XThe destination operand was in a non-writable segment.XA null data segment was used to reference memory.General protection,#GPPage fault, #PFXXA page fault resulted from the execution of the instruction.Alignment check,#ACXXAn unaligned memory reference was performed whilealignment checking was enabled.214RORInstruction Reference24594—Rev.

3.13—July 2007AMD64 TechnologySAHFStore AH into FlagsLoads the SF, ZF, AF, PF, and CF flags of the EFLAGS register with values from the correspondingbits in the AH register (bits 7, 6, 4, 2, and 0, respectively). The instruction ignores bits 1, 3, and 5 ofregister AH; it sets those bits in the EFLAGS register to 1, 0, and 0, respectively.The SAHF instruction can only be executed in 64-bit mode if supported by the processorimplementation. Check the status of ECX bit 0 returned by CPUID function 8000_0001h to verify thatthe processor supports SAHF in 64-bit mode.MnemonicOpcodeSAHFDescriptionLoads the sign flag, the zero flag, the auxiliary flag, theparity flag, and the carry flag from the AH register intothe lower 8 bits of the EFLAGS register.9ERelated InstructionsLAHFrFLAGS AffectedID21VIP20VIF19AC18VM17RF16NT14IOPLOF13–1211DF10IF9TF8SFZFAFPFCFMMMMM76420Note: 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.ExceptionsExceptionVirtualReal 8086 ProtectedInvalid opcode, #UDInstruction ReferenceXCause of ExceptionThis instruction is not supported in 64-bit mode, as indicatedby ECX bit 0 returned by CPUID function 8000_0001h.SAHF215AMD64 Technology24594—Rev. 3.13—July 2007SALSHLShift LeftShifts the bits of a register or memory location (first operand) to the left through the CF bit by thenumber of bit positions in an unsigned immediate value or the CL register (second operand). Theinstruction discards bits shifted out of the CF flag.

For each bit shift, the SAL instruction clears theleast-significant bit to 0. At the end of the shift operation, the CF flag contains the last bit shifted out ofthe first operand.The processor masks the upper three bits of the count operand, thus restricting the count to a numberbetween 0 and 31. When the destination is 64 bits wide, the processor masks the upper two bits of thecount, providing a count in the range of 0 to 63.The effect of this instruction is multiplication by powers of two.For 1-bit shifts, the instruction sets the OF flag to the exclusive OR of the CF bit (after the shift) andthe most significant bit of the result.

When the shift count is greater than 1, the OF flag is undefined.If the shift count is 0, no flags are modified.SHL is an alias to the SAL instruction.MnemonicOpcodeDescriptionSAL reg/mem8, 1D0 /4Shift an 8-bit register or memory location left 1 bit.SAL reg/mem8, CLD2 /4Shift an 8-bit register or memory location left the numberof bits specified in the CL register.SAL reg/mem8, imm8C0 /4 ibShift an 8-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SAL reg/mem16, 1D1 /4Shift a 16-bit register or memory location left 1 bit.SAL reg/mem16, CLD3 /4Shift a 16-bit register or memory location left the numberof bits specified in the CL register.SAL reg/mem16, imm8C1 /4 ibShift a 16-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SAL reg/mem32, 1D1 /4Shift a 32-bit register or memory location left 1 bit.SAL reg/mem32, CLD3 /4Shift a 32-bit register or memory location left the numberof bits specified in the CL register.SAL reg/mem32, imm8C1 /4 ibShift a 32-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SAL reg/mem64, 1D1 /4Shift a 64-bit register or memory location left 1 bit.SAL reg/mem64, CLD3 /4Shift a 64-bit register or memory location left the numberof bits specified in the CL register.SAL reg/mem64, imm8C1 /4 ibShift a 64-bit register or memory location left the numberof bits specified by an 8-bit immediate value.216SAL, SHLInstruction Reference24594—Rev.

3.13—July 2007MnemonicAMD64 TechnologyOpcodeDescriptionSHL reg/mem8, 1D0 /4Shift an 8-bit register or memory location by 1 bit.SHL reg/mem8, CLD2 /4Shift an 8-bit register or memory location left the numberof bits specified in the CL register.SHL reg/mem8, imm8C0 /4 ibShift an 8-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SHL reg/mem16, 1D1 /4Shift a 16-bit register or memory location left 1 bit.SHL reg/mem16, CLD3 /4Shift a 16-bit register or memory location left the numberof bits specified in the CL register.SHL reg/mem16, imm8C1 /4 ibShift a 16-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SHL reg/mem32, 1D1 /4Shift a 32-bit register or memory location left 1 bit.SHL reg/mem32, CLD3 /4Shift a 32-bit register or memory location left the numberof bits specified in the CL register.SHL reg/mem32, imm8C1 /4 ibShift a 32-bit register or memory location left the numberof bits specified by an 8-bit immediate value.SHL reg/mem64, 1D1 /4Shift a 64-bit register or memory location left 1 bit.SHL reg/mem64, CLD3 /4Shift a 64-bit register or memory location left the numberof bits specified in the CL register.SHL reg/mem64, imm8C1 /4 ibShift a 64-bit register or memory location left the numberof bits specified by an 8-bit immediate value.Related InstructionsSAR, SHR, SHLD, SHRDrFLAGS AffectedIDVIPVIFACVMRFNTIOPLOFDFIFTFM2120191817161413–12111098SFZFAFPFCFMMUMM76420Note: 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.Instruction ReferenceSAL, SHL217AMD64 Technology24594—Rev. 3.13—July 2007ExceptionsExceptionVirtualReal 8086 ProtectedStack, #SSXCause of ExceptionXXA memory address exceeded the stack segment limit or wasnon-canonical.XXA memory address exceeded a data segment limit or was noncanonical.XThe destination operand was in a non-writable segment.XA null data segment was used to reference memory.General protection,#GPPage fault, #PFXXA page fault resulted from the execution of the instruction.Alignment check,#ACXXAn unaligned memory reference was performed whilealignment checking was enabled.218SAL, SHLInstruction Reference24594—Rev.

3.13—July 2007AMD64 TechnologySARShift Arithmetic RightShifts the bits of a register or memory location (first operand) to the right through the CF bit by thenumber of bit positions in an unsigned immediate value or the CL register (second operand). Theinstruction discards bits shifted out of the CF flag. At the end of the shift operation, the CF flagcontains the last bit shifted out of the first operand.The SAR instruction does not change the sign bit of the target operand. For each bit shift, it copies thesign bit to the next bit, preserving the sign of the result.The processor masks the upper three bits of the count operand, thus restricting the count to a numberbetween 0 and 31.

When the destination is 64 bits wide, the processor masks the upper two bits of thecount, providing a count in the range of 0 to 63.For 1-bit shifts, the instruction clears the OF flag to 0. When the shift count is greater than 1, the OFflag is undefined.If the shift count is 0, no flags are modified.Although the SAR instruction effectively divides the operand by a power of 2, the behavior is differentfrom the IDIV instruction. For example, shifting –11 (FFFFFFF5h) by two bits to the right (that is,divide –11 by 4), gives a result of FFFFFFFDh, or –3, whereas the IDIV instruction for dividing –11 by4 gives a result of –2. This is because the IDIV instruction rounds off the quotient to zero, whereas theSAR instruction rounds off the remainder to zero for positive dividends and to negative infinity fornegative dividends.

So, for positive operands, SAR behaves like the corresponding IDIV instruction.For negative operands, it gives the same result if and only if all the shifted-out bits are zeroes;otherwise, the result is smaller by 1.MnemonicOpcodeDescriptionSAR reg/mem8, 1D0 /7Shift a signed 8-bit register or memory operand right 1bit.SAR reg/mem8, CLD2 /7Shift a signed 8-bit register or memory operand right thenumber of bits specified in the CL register.SAR reg/mem8, imm8C0 /7 ibShift a signed 8-bit register or memory operand right thenumber of bits specified by an 8-bit immediate value.SAR reg/mem16, 1D1 /7Shift a signed 16-bit register or memory operand right 1bit.SAR reg/mem16, CLD3 /7Shift a signed 16-bit register or memory operand rightthe number of bits specified in the CL register.SAR reg/mem16, imm8C1 /7 ibShift a signed 16-bit register or memory operand rightthe number of bits specified by an 8-bit immediate value.SAR reg/mem32, 1D1 /7Shift a signed 32-bit register or memory location 1 bit.SAR reg/mem32, CLD3 /7Shift a signed 32-bit register or memory location rightthe number of bits specified in the CL register.Instruction ReferenceSAR219AMD64 Technology24594—Rev.

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

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

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

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