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

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

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

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

3.13—July 2007AMD64 TechnologyRET (Far)Far Return from Called ProcedureReturns from a procedure previously entered by a CALL Far instruction. This form of the RETinstruction returns to a calling procedure in a different segment than the current code segment. It canreturn to the same CPL or to a less privileged CPL.RET Far pops a target CS and rIP from the stack. If the new code segment is less privileged than thecurrent code segment, the stack pointer is incremented by the number of bytes indicated by theimmediate operand, if present; then a new SS and rSP are also popped from the stack.The final value of rSP is incremented by the number of bytes indicated by the immediate operand, ifpresent.

This action skips over the parameters (previously passed to the subroutine) that are no longerneeded.All stack pops are determined by the operand size. If necessary, the target rIP is zero-extended to 64bits before assuming program control.If the CPL changes, the data segment selectors are set to NULL for any of the data segments (DS, ES,FS, GS) not accessible at the new CPL.See RET (Near) for information on near returns—returns to procedures located inside the current codesegment. For details about control-flow instructions, see “Control Transfers” in Volume 1, and“Control-Transfer Privilege Checks” in Volume 2.MnemonicOpcodeDescriptionRETFCBFar return to the calling procedure.RETF imm16CA iwFar return to the calling procedure, then pop thespecified number of bytes from the stack.Action// Far returns (RETF)// See “Pseudocode Definitions” on page 41.RETF_START:IF (REAL_MODE)RETF_REAL_OR_VIRTUALELSIF (PROTECTED_MODE)RETF_PROTECTEDELSE // (VIRTUAL_MODE)RETF_REAL_OR_VIRTUALRETF_REAL_OR_VIRTUAL:IF (OPCODE = retf imm16)temp_IMM = word-sized immediate specified in the instruction,zero-extended to 64 bitsInstruction ReferenceRET (Far)207AMD64 Technology24594—Rev.

3.13—July 2007ELSE // (OPCODE = retf)temp_IMM = 0POP.v temp_RIPPOP.v temp_CSIF (temp_RIP > CS.limit)EXCEPTION [#GP(0)]CS.sel = temp_CSCS.base = temp_CS SHL 4RSP.s = RSP + temp_IMMRIP = temp_RIPEXITRETF_PROTECTED:IF (OPCODE = retf imm16)temp_IMM = word-sized immediate specified in the instruction,zero-extended to 64 bitsELSE // (OPCODE = retf)temp_IMM = 0POP.v temp_RIPPOP.v temp_CStemp_CPL = temp_CS.rplIF (CPL=temp_CPL){CS = READ_DESCRIPTOR (temp_CS, iret_chk)RSP.s = RSP + temp_IMMIF ((64BIT_MODE) && (temp_RIP is non-canonical)|| (!64BIT_MODE) && (temp_RIP > CS.limit))EXCEPTION [#GP(0)]RIP = temp_RIPEXIT}ELSE // (CPL!=temp_CPL){RSP.s = RSP + temp_IMMPOP.v temp_RSPPOP.v temp_SSCS = READ_DESCRIPTOR (temp_CS, iret_chk)208RET (Far)Instruction Reference24594—Rev. 3.13—July 2007AMD64 TechnologyCPL = temp_CPLIF ((64BIT_MODE) && (temp_RIP is non-canonical)|| (!64BIT_MODE) && (temp_RIP > CS.limit))EXCEPTION [#GP(0)]SS = READ_DESCRIPTOR (temp_SS, ss_chk)RSP.s = temp_RSP + temp_IMMIF (changing CPL){FOR (seg = ES, DS, FS, GS)IF ((seg.attr.dpl < CPL) && ((seg.attr.type = ’data’)|| (seg.attr.type = ’non-conforming-code’))){seg = NULL // can’t use lower dpl data segment at higher cpl}}RIP = temp_RIPEXIT}Related InstructionsCALL (Near), CALL (Far), RET (Near)rFLAGS AffectedNoneExceptionsExceptionVirtualReal 8086 ProtectedSegment notpresent, #NP(selector)Stack, #SSXXStack, #SS(selector)General protection,#GPXInstruction ReferenceXCause of ExceptionXThe return code segment was marked not present.XA memory address exceeded the stack segment limit or wasnon-canonical.XThe return stack segment was marked not present.XThe target offset exceeded the code segment limit or was noncanonical.RET (Far)209AMD64 TechnologyException24594—Rev.

3.13—July 2007VirtualReal 8086 ProtectedGeneral protection,#GP(selector)Cause of ExceptionXThe return code selector was a null selector.XThe return stack selector was a null selector and the returnmode was non-64-bit mode or CPL was 3.XThe return code or stack descriptor exceeded the descriptortable limit.XThe return code or stack selector’s TI bit was set but the LDTselector was a null selector.XThe segment descriptor for the return code was not a codesegment.XThe RPL of the return code segment selector was less thanthe CPL.XThe return code segment was non-conforming and thesegment selector’s DPL was not equal to the RPL of the codesegment’s segment selector.XThe return code segment was conforming and the segmentselector’s DPL was greater than the RPL of the codesegment’s segment selector.XThe segment descriptor for the return stack was not a writabledata segment.XThe stack segment descriptor DPL was not equal to the RPLof the return code segment selector.XThe stack segment selector RPL was not equal to the RPL ofthe return code segment selector.Page fault, #PFXXA page fault resulted from the execution of the instruction.Alignment check,#ACXXAn unaligned-memory reference was performed whilealignment checking was enabled.210RET (Far)Instruction Reference24594—Rev.

3.13—July 2007AMD64 TechnologyROLRotate LeftRotates the bits of a register or memory location (first operand) to the left (toward the more significantbit positions) by the number of bit positions in an unsigned immediate value or the CL register (secondoperand). The bits rotated out left are rotated back in at the right end (lsb) of the first operand location.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, it masks the upper two bits of the count,providing a count in the range of 0 to 63.After completing the rotation, the instruction sets the CF flag to the last bit rotated out (the lsb of theresult). For 1-bit rotates, the instruction sets the OF flag to the exclusive OR of the CF bit (after therotate) and the most significant bit of the result.

When the rotate count is greater than 1, the OF flag isundefined. When the rotate count is 0, no flags are affected.MnemonicOpcodeDescriptionROL reg/mem8, 1D0 /0Rotate an 8-bit register or memory operand left 1 bit.ROL reg/mem8, CLD2 /0Rotate an 8-bit register or memory operand left thenumber of bits specified in the CL register.ROL reg/mem8, imm8C0 /0 ibRotate an 8-bit register or memory operand left thenumber of bits specified by an 8-bit immediate value.ROL reg/mem16, 1D1 /0Rotate a 16-bit register or memory operand left 1 bit.ROL reg/mem16, CLD3 /0Rotate a 16-bit register or memory operand left thenumber of bits specified in the CL register.ROL reg/mem16, imm8C1 /0 ibRotate a 16-bit register or memory operand left thenumber of bits specified by an 8-bit immediate value.ROL reg/mem32, 1D1 /0Rotate a 32-bit register or memory operand left 1 bit.ROL reg/mem32, CLD3 /0Rotate a 32-bit register or memory operand left thenumber of bits specified in the CL register.ROL reg/mem32, imm8C1 /0 ibRotate a 32-bit register or memory operand left thenumber of bits specified by an 8-bit immediate value.ROL reg/mem64, 1D1 /0Rotate a 64-bit register or memory operand left 1 bit.ROL reg/mem64, CLD3 /0Rotate a 64-bit register or memory operand left thenumber of bits specified in the CL register.ROL reg/mem64, imm8C1 /0 ibRotate a 64-bit register or memory operand left thenumber of bits specified by an 8-bit immediate value.Related InstructionsRCL, RCR, RORInstruction ReferenceROL211AMD64 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.212ROLInstruction Reference24594—Rev.

3.13—July 2007AMD64 TechnologyRORRotate RightRotates the bits of a register or memory location (first operand) to the right (toward the less significantbit positions) by the number of bit positions in an unsigned immediate value or the CL register (secondoperand). The bits rotated out right are rotated back in at the left end (the most significant bit) of thefirst operand location.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.After completing the rotation, the instruction sets the CF flag to the last bit rotated out (the mostsignificant bit of the result).

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

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

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

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