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

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

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

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

The terms “less” and “greater” are used for comparisons of signed integers and the terms “above” and “below” are used for unsignedintegers.Because a particular state of the status flags can sometimes be interpreted in twoways, two mnemonics are defined for some opcodes. For example, the JA (jump ifabove) instruction and the JNBE (jump if not below or equal) instruction are alternatemnemonics for the opcode 77H.The Jcc instruction does not support far jumps (jumps to other code segments).When the target for the conditional jump is in a different segment, use the oppositecondition from the condition being tested for the Jcc instruction, and then access thetarget with an unconditional far jump (JMP instruction) to the other segment.

Forexample, the following conditional far jump is illegal:JZ FARLABEL;To accomplish this far jump, use the following two instructions:JNZ BEYOND;JMP FARLABEL;BEYOND:The JRCXZ, JECXZ and JCXZ instructions differ from other Jcc instructions becausethey do not check status flags. Instead, they check RCX, ECX or CX for 0. The registerchecked is determined by the address-size attribute. These instructions are usefulwhen used at the beginning of a loop that terminates with a conditional loop instruction (such as LOOPNE). They can be used to prevent an instruction sequence fromentering a loop when RCX, ECX or CX is 0.

This would cause the loop to execute 264,232 or 64K times (not zero times).All conditional jumps are converted to code fetches of one or two cache lines, regardless of jump address or cacheability.In 64-bit mode, operand size is fixed at 64 bits. JMP Short is RIP = RIP + 8-bit offsetsign extended to 64 bits.

JMP Near is RIP = RIP + 32-bit offset sign extended to64-bits.OperationIF conditionTHENtempEIP ← EIP + SignExtend(DEST);IF OperandSize = 16THEN tempEIP ← tempEIP AND 0000FFFFH;FI;IF tempEIP is not within code segment limitTHEN #GP(0);Jcc—Jump if Condition Is MetVol. 2A 3-569INSTRUCTION SET REFERENCE, A-MELSE EIP ← tempEIPFI;FI;Protected Mode Exceptions#GP(0)If the offset being jumped to is beyond the limits of the CSsegment.#UDIf the LOCK prefix is used.Real-Address Mode Exceptions#GPIf the offset being jumped to is beyond the limits of the CSsegment or is outside of the effective address space from 0 toFFFFH.

This condition can occur if a 32-bit address size overrideprefix is used.#UDIf the LOCK prefix is used.Virtual-8086 Mode ExceptionsSame exceptions as in real address mode.Compatibility Mode ExceptionsSame exceptions as in protected mode.64-Bit Mode Exceptions#GP(0)If the memory address is in a non-canonical form.#UDIf the LOCK prefix is used.3-570 Vol. 2AJcc—Jump if Condition Is MetINSTRUCTION SET REFERENCE, A-MJMP—JumpOpcodeInstructionOp/En64-BitModeCompat/ DescriptionLeg ModeEB cbJMP rel8AValidValidJump short, RIP = RIP + 8-bitdisplacement sign extendedto 64-bitsE9 cwJMP rel16AN.S.ValidJump near, relative,displacement relative tonext instruction.

Notsupported in 64-bit mode.E9 cdJMP rel32AValidValidJump near, relative, RIP =RIP + 32-bit displacementsign extended to 64-bitsFF /4JMP r/m16BN.S.ValidJump near, absolute indirect,address = zero-extendedr/m16. Not supported in 64bit mode.FF /4JMP r/m32BN.S.ValidJump near, absolute indirect,address given in r/m32.

Notsupported in 64-bit mode.FF /4JMP r/m64BValidN.E.Jump near, absolute indirect,RIP = 64-Bit offset fromregister or memoryEA cdJMP ptr16:16AInv.ValidJump far, absolute, addressgiven in operandEA cpJMP ptr16:32AInv.ValidJump far, absolute, addressgiven in operandFF /5JMP m16:16AValidValidJump far, absolute indirect,address given in m16:16FF /5JMP m16:32AValidValidJump far, absolute indirect,address given in m16:32.REX.W + FF /5JMP m16:64AValidN.E.Jump far, absolute indirect,address given in m16:64.Instruction Operand EncodingOp/EnOperand 1Operand 2Operand 3Operand 4AOffsetNANANABModRM:r/m (r)NANANADescriptionJMP—JumpVol. 2A 3-571INSTRUCTION SET REFERENCE, A-MTransfers program control to a different point in the instruction stream withoutrecording return information. The destination (target) operand specifies the addressof the instruction being jumped to.

This operand can be an immediate value, ageneral-purpose register, or a memory location.This instruction can be used to execute four different types of jumps:•Near jump—A jump to an instruction within the current code segment (thesegment currently pointed to by the CS register), sometimes referred to as anintrasegment jump.•Short jump—A near jump where the jump range is limited to –128 to +127 fromthe current EIP value.•Far jump—A jump to an instruction located in a different segment than thecurrent code segment but at the same privilege level, sometimes referred to asan intersegment jump.•Task switch—A jump to an instruction located in a different task.A task switch can only be executed in protected mode (see Chapter 7, in the Intel®64 and IA-32 Architectures Software Developer’s Manual, Volume 3A, for informationon performing task switches with the JMP instruction).Near and Short Jumps.

When executing a near jump, the processor jumps to theaddress (within the current code segment) that is specified with the target operand.The target operand specifies either an absolute offset (that is an offset from the baseof the code segment) or a relative offset (a signed displacement relative to thecurrent value of the instruction pointer in the EIP register). A near jump to a relativeoffset of 8-bits (rel8) is referred to as a short jump.

The CS register is not changed onnear and short jumps.An absolute offset is specified indirectly in a general-purpose register or a memorylocation (r/m16 or r/m32). The operand-size attribute determines the size of thetarget operand (16 or 32 bits). Absolute offsets are loaded directly into the EIPregister. If the operand-size attribute is 16, the upper two bytes of the EIP registerare cleared, resulting in a maximum instruction pointer size of 16 bits.A relative offset (rel8, rel16, or rel32) is generally specified as a label in assemblycode, but at the machine code level, it is encoded as a signed 8-, 16-, or 32-bitimmediate value. This value is added to the value in the EIP register.

(Here, the EIPregister contains the address of the instruction following the JMP instruction). Whenusing relative offsets, the opcode (for short vs. near jumps) and the operand-sizeattribute (for near relative jumps) determines the size of the target operand (8, 16,or 32 bits).Far Jumps in Real-Address or Virtual-8086 Mode. When executing a far jump in realaddress or virtual-8086 mode, the processor jumps to the code segment and offsetspecified with the target operand.

Here the target operand specifies an absolute faraddress either directly with a pointer (ptr16:16 or ptr16:32) or indirectly with amemory location (m16:16 or m16:32). With the pointer method, the segment andaddress of the called procedure is encoded in the instruction, using a 4-byte (16-bitoperand size) or 6-byte (32-bit operand size) far address immediate. With the indi-3-572 Vol. 2AJMP—JumpINSTRUCTION SET REFERENCE, A-Mrect method, the target operand specifies a memory location that contains a 4-byte(16-bit operand size) or 6-byte (32-bit operand size) far address.

The far address isloaded directly into the CS and EIP registers. If the operand-size attribute is 16, theupper two bytes of the EIP register are cleared.Far Jumps in Protected Mode. When the processor is operating in protected mode, theJMP instruction can be used to perform the following three types of far jumps:•••A far jump to a conforming or non-conforming code segment.A far jump through a call gate.A task switch.(The JMP instruction cannot be used to perform inter-privilege-level far jumps.)In protected mode, the processor always uses the segment selector part of the faraddress to access the corresponding descriptor in the GDT or LDT.

The descriptortype (code segment, call gate, task gate, or TSS) and access rights determine thetype of jump to be performed.If the selected descriptor is for a code segment, a far jump to a code segment at thesame privilege level is performed. (If the selected code segment is at a different privilege level and the code segment is non-conforming, a general-protection exceptionis generated.) A far jump to the same privilege level in protected mode is very similarto one carried out in real-address or virtual-8086 mode. The target operand specifiesan absolute far address either directly with a pointer (ptr16:16 or ptr16:32) or indirectly with a memory location (m16:16 or m16:32). The operand-size attributedetermines the size of the offset (16 or 32 bits) in the far address.

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

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

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

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