Главная » Просмотр файлов » Volume 2 System Programming

Volume 2 System Programming (794096), страница 61

Файл №794096 Volume 2 System Programming (Intel and AMD manuals) 61 страницаVolume 2 System Programming (794096) страница 612019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

3.13—July 2007When a non-debug exception occurs (or when a string instruction is interrupted), the processornormally sets RFLAGS.RF to 1 in the RFLAGS image that is pushed on the interrupt stack. Asubsequent IRET back to the interrupted program pops the RFLAGS image off the stack and into theRFLAGS register, with RFLAGS.RF=1. The interrupted instruction executes without causing aninstruction breakpoint, after which the processor clears RFLAGS.RF to 0.However, when a #DB exception occurs, the processor clears RFLAGS.RF to 0 in the RFLAGS imagethat is pushed on the interrupt stack.

The #DB handler has two options:••Disable the instruction breakpoint completely.Set RFLAGS.RF to 1 in the interrupt-stack rFLAGS image. The instruction breakpoint condition isignored immediately after the IRET, but reoccurs if the instruction address is accessed later, as canoccur in a program loop.8.2.3 NMI—Non-Maskable-Interrupt Exception (Vector 2)An NMI exception occurs as a result of system logic signalling a non-maskable interrupt to theprocessor.Error Code Returned. None.Program Restart.

NMI is an interrupt. The processor recognizes an NMI at an instruction boundary.The saved instruction pointer points to the instruction immediately following the boundary where theNMI was recognized.Masking. NMI cannot be masked. However, when an NMI is recognized by the processor,recognition of subsequent NMIs are disabled until an IRET instruction is executed.8.2.4 #BP—Breakpoint Exception (Vector 3)A #BP exception occurs when an INT3 instruction is executed. The INT3 is normally used by debugsoftware to set instruction breakpoints by replacing instruction-opcode bytes with the INT3 opcode.#BP cannot be disabled.Error Code Returned.

None.Program Restart. #BP is a trap-type exception. The saved instruction pointer points to the byte afterthe INT3 instruction. This location can be the start of the next instruction. However, if the INT3 is usedto replace the first opcode bytes of an instruction, the restart location is likely to be in the middle of aninstruction. In the latter case, the debug software must replace the INT3 byte with the correctinstruction byte. The saved RIP instruction pointer must then be decremented by one before returningto the interrupted program.

This allows the program to be restarted correctly on the interruptedinstruction boundary.210Exceptions and Interrupts24593—Rev. 3.13—July 2007AMD64 Technology8.2.5 #OF—Overflow Exception (Vector 4)An #OF exception occurs as a result of executing an INTO instruction while the overflow bit inRFLAGS is set to 1 (RFLAGS.OF=1).#OF cannot be disabled.Error Code Returned. None.Program Restart. #OF is a trap-type exception. The saved instruction pointer points to theinstruction following the INTO instruction that caused the #OF.8.2.6 #BR—Bound-Range Exception (Vector 5)A #BR exception can occur as a result of executing the BOUND instruction.

The BOUND instructioncompares an array index (first operand) with the lower bounds and upper bounds of an array (secondoperand). If the array index is not within the array boundary, the #BR occurs.#BR cannot be disabled.Error Code Returned. None.Program Restart. #BR is a fault-type exception. The saved instruction pointer points to the BOUNDinstruction that caused the #BR.8.2.7 #UD—Invalid-Opcode Exception (Vector 6)A #UD exception occurs when an attempt is made to execute an invalid or undefined opcode.

Thevalidity of an opcode often depends on the processor operating mode. A #UD occurs under thefollowing conditions:•••••••••Execution of any reserved or undefined opcode in any mode.Execution of the UD2 instruction.Use of the LOCK prefix on an instruction that cannot be locked.Use of the LOCK prefix on a lockable instruction with a non-memory target location.Execution of an instruction with an invalid-operand type.Execution of the SYSENTER or SYSEXIT instructions in long mode.Execution of any of the following instructions in 64-bit mode: AAA, AAD, AAM, AAS, BOUND,CALL (opcode 9A), DAA, DAS, DEC, INC, INTO, JMP (opcode EA), LDS, LES, POP (DS, ES,SS), POPA, PUSH (CS, DS, ES, SS), PUSHA, SALC.Execution of the ARPL, LAR, LLDT, LSL, LTR, SLDT, STR, VERR, or VERW instructions whenprotected mode is not enabled, or when virtual-8086 mode is enabled.Execution of any 128-bit media instruction when CR4.OSFXSR is cleared to 0.

(For furtherinformation, see “FXSAVE/FXRSTOR Support (OSFXSR) Bit” on page 49.Exceptions and Interrupts211AMD64 Technology••••24593—Rev. 3.13—July 2007Execution of any 128-bit media instruction (uses XMM registers), or 64-bit media instruction(uses MMX™ registers) when CR0.EM = 1.Execution of any 128-bit media floating-point instruction (uses XMM registers) that causes anumeric exception when CR4.OSXMMEXCPT = 0.Use of the DR4 or DR5 debug registers when CR4.DE = 1.Execution of RSM when not in SMM mode.See the specific instruction description (in the other volumes) for additional information on invalidconditions.#UD cannot be disabled.Error Code Returned. None.Program Restart. #UD is a fault-type exception. The saved instruction pointer points to theinstruction that caused the #UD.8.2.8 #NM—Device-Not-Available Exception (Vector 7)A #NM exception occurs under any of the following conditions:••••An FWAIT/WAIT instruction is executed when CR0.MP=1 and CR0.TS=1.Any x87 instruction other than FWAIT is executed when CR0.EM=1.Any x87 instruction is executed when CR0.TS=1.

The CR0.MP bit controls whether theFWAIT/WAIT instruction causes an #NM exception when TS=1.Any 128-bit or 64-bit media instruction when CR0.TS=1.#NM can be enabled or disabled under the control of the CR0.MP, CR0.EM, and CR0.TS bits asdescribed above. See “CR0 Register” on page 42 for more information on the CR0 bits used to controlthe #NM exception.Error Code Returned.

None.Program Restart. #NM is a fault-type exception. The saved instruction pointer points to theinstruction that caused the #NM.8.2.9 #DF—Double-Fault Exception (Vector 8)A #DF exception can occur when a second exception occurs during the handling of a prior (first)exception or interrupt handler.Usually, the first and second exceptions can be handled sequentially without resulting in a #DF. In thiscase, the first exception is considered benign, as it does not harm the ability of the processor to handlethe second exception.In some cases, however, the first exception adversely affects the ability of the processor to handle thesecond exception.

These exceptions contribute to the occurrence of a #DF, and are called contributory212Exceptions and Interrupts24593—Rev. 3.13—July 2007AMD64 Technologyexceptions. If a contributory exception is followed by another contributory exception, a double-faultexception occurs. Likewise, if a page fault is followed by another page fault or a contributoryexception, a double-fault exception occurs.Table 8-3 on page 213 shows the conditions under which a #DF occurs. Page faults are either benign orcontributory, and are listed separately. See the “Class” column in Table 8-2 on page 208 forinformation on whether an exception is benign or contributory.Table 8-3.Double-Fault Exception ConditionsFirst Interrupting EventSecond Interrupting EventContributory Exceptions• Divide-by-Zero-Error Exception• Invalid-TSS Exception• Segment-Not-Present Exception• Stack Exception• General-Protection ExceptionInvalid-TSS ExceptionSegment-Not-Present ExceptionStack ExceptionGeneral-Protection ExceptionPage Fault ExceptionPage Fault ExceptionInvalid-TSS ExceptionSegment-Not-Present ExceptionStack ExceptionGeneral-Protection ExceptionIf a third interrupting event occurs while transferring control to the #DF handler, the processor shutsdown.

Only an NMI, RESET, or INIT can restart the processor in this case. However, if the processorshuts down as it is executing an NMI handler, the processor can only be restarted with RESET or INIT.#DF cannot be disabled.Error Code Returned. Zero.Program Restart. #DF is an abort-type exception. The saved instruction pointer is undefined, and theprogram cannot be restarted.8.2.10 Coprocessor-Segment-Overrun Exception (Vector 9)This interrupt vector is reserved.

It is for a discontinued exception originally used by processors thatsupported external x87-instruction coprocessors. On those processors, the exception condition iscaused by an invalid-segment or invalid-page access on an x87-instruction coprocessor-instructionoperand. On current processors, this condition causes a general-protection exception to occur.Error Code Returned.

Not applicable.Program Restart. Not applicable.Exceptions and Interrupts213AMD64 Technology24593—Rev. 3.13—July 20078.2.11 #TS—Invalid-TSS Exception (Vector 10)A #TS exception occurs when an invalid reference is made to a segment selector as part of a taskswitch. A #TS also occurs during a privilege-changing control transfer (through a call gate or aninterrupt gate), if a reference is made to an invalid stack-segment selector located in the TSS.

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

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

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

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