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

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

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

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

2A 3-537INSTRUCTION SET REFERENCE, A-MIF code segment is non-conforming and DPL < CPLTHENIF VM = 0THENGOTO INTER-PRIVILEGE-LEVEL-INTERRUPT;(* PE = 1, interrupt or trap gate, nonconformingcode segment, DPL < CPL, VM = 0 *)ELSE (* VM = 1 *)IF code segment DPL ≠ 0THEN #GP; (new code segment selector);GOTO INTERRUPT-FROM-VIRTUAL-8086-MODE; FI;(* PE = 1, interrupt or trap gate, DPL < CPL, VM = 1 *)FI;ELSE (* PE = 1, interrupt or trap gate, DPL ≥ CPL *)IF VM = 1THEN #GP(new code segment selector); FI;IF code segment is conforming or code segment DPL = CPLTHENGOTO INTRA-PRIVILEGE-LEVEL-INTERRUPT;ELSE#GP(CodeSegmentSelector + EXT);(* PE = 1, interrupt or trap gate, nonconformingcode segment, DPL > CPL *)FI;FI;END;INTER-PRIVILEGE-LEVEL-INTERRUPT:(* PE = 1, interrupt or trap gate, non-conforming code segment, DPL < CPL *)(* Check segment selector and descriptor for stack of new privilege level in current TSS *)IF current TSS is 32-bit TSSTHENTSSstackAddress ← (new code segment DPL ∗ 8) + 4;IF (TSSstackAddress + 7) > TSS limitTHEN #TS(current TSS selector); FI;NewSS ← TSSstackAddress + 4;NewESP ← stack address;ELSEIF current TSS is 16-bit TSSTHEN(* TSS is 16-bit *)TSSstackAddress ← (new code segment DPL ∗ 4) + 2IF (TSSstackAddress + 4) > TSS limitTHEN #TS(current TSS selector); FI;NewESP ← TSSstackAddress;3-538 Vol.

2AINT n/INTO/INT 3—Call to Interrupt ProcedureINSTRUCTION SET REFERENCE, A-MNewSS ← TSSstackAddress + 2;ELSE (* TSS is 64-bit *)NewESP ← TSS[RSP FOR NEW TARGET DPL];NewSS ← CodeSegmentDescriptor(DPL);(* null selector with RPL = new CPL *)FI;FI;IF segment selector is NULLTHEN #TS(EXT); FI;IF segment selector index is not within its descriptor table limitsor segment selector's RPL ≠ DPL of code segment,THEN #TS(SS selector + EXT); FI;IF (IA32_EFER.LMA = 0) (* Not IA-32e mode *)Read segment descriptor for stack segment in GDT or LDT;IF stack segment DPL ≠ DPL of code segment,or stack segment does not indicate writable data segmentTHEN #TS(SS selector + EXT); FI;IF stack segment not presentTHEN #SS(SS selector + EXT); FI;FIIF 32-bit gateTHENIF new stack does not have room for 24 bytes (error code pushed)or 20 bytes (no error code pushed)THEN #SS(segment selector + EXT); FI;FIELSEIF 16-bit gateTHENIF new stack does not have room for 12 bytes (error code pushed)or 10 bytes (no error code pushed);THEN #SS(segment selector + EXT); FI;ELSE (* 64-bit gate*)IF StackAddress is non-canonicalTHEN #SS(0);FI;FI;FI;IF (IA32_EFER.LMA = 0) (* Not IA-32e mode *)THENIF instruction pointer is not within code segment limitsTHEN #GP(0); FI;SS:ESP ← TSS(NewSS:NewESP);(* Segment descriptor information also loaded *)INT n/INTO/INT 3—Call to Interrupt ProcedureVol.

2A 3-539INSTRUCTION SET REFERENCE, A-MELSEIF instruction pointer points to non-canonical addressTHEN #GP(0); FI:FI;IF 32-bit gateTHENCS:EIP ← Gate(CS:EIP); (* Segment descriptor information also loaded *)ELSEIF 16-bit gateTHENCS:IP ← Gate(CS:IP);(* Segment descriptor information also loaded *)ELSE (* 64-bit gate *)CS:RIP ← Gate(CS:RIP);(* Segment descriptor information also loaded *)FI;FI;IF 32-bit gateTHENPush(far pointer to old stack);(* Old SS and ESP, 3 words padded to 4 *)Push(EFLAGS);Push(far pointer to return instruction);(* Old CS and EIP, 3 words padded to 4 *)Push(ErrorCode); (* If needed, 4 bytes *)ELSEIF 16-bit gateTHENPush(far pointer to old stack);(* Old SS and SP, 2 words *)Push(EFLAGS(15-0]);Push(far pointer to return instruction);(* Old CS and IP, 2 words *)Push(ErrorCode); (* If needed, 2 bytes *)ELSE (* 64-bit gate *)Push(far pointer to old stack);(* Old SS and SP, each an 8-byte push *)Push(RFLAGS); (* 8-byte push *)Push(far pointer to return instruction);(* Old CS and RIP, each an 8-byte push *)Push(ErrorCode); (* If needed, 8-bytes *)FI;FI;CPL ← CodeSegmentDescriptor(DPL);3-540 Vol.

2AINT n/INTO/INT 3—Call to Interrupt ProcedureINSTRUCTION SET REFERENCE, A-MCS(RPL) ← CPL;IF interrupt gateTHEN IF ← 0 (* Interrupt flag set to 0: disabled *); FI;TF ← 0;VM ← 0;RF ← 0;NT ← 0;END;INTERRUPT-FROM-VIRTUAL-8086-MODE:(* Check segment selector and descriptor for privilege level 0 stack in current TSS *)IF current TSS is 32-bit TSSTHENTSSstackAddress ← (new code segment DPL ∗ 8) + 4;IF (TSSstackAddress + 7) > TSS limitTHEN #TS(current TSS selector); FI;NewSS ← TSSstackAddress + 4;NewESP ← stack address;ELSE (* TSS is 16-bit *)TSSstackAddress ← (new code segment DPL ∗ 4) + 2;IF (TSSstackAddress + 4) > TSS limitTHEN #TS(current TSS selector); FI;NewESP ← TSSstackAddress;NewSS ← TSSstackAddress + 2;FI;IF segment selector is NULLTHEN #TS(EXT); FI;IF segment selector index is not within its descriptor table limitsor segment selector's RPL ≠ DPL of code segmentTHEN #TS(SS selector + EXT); FI;Access segment descriptor for stack segment in GDT or LDT;IF stack segment DPL ≠ DPL of code segment,or stack segment does not indicate writable data segmentTHEN #TS(SS selector + EXT); FI;IF stack segment not presentTHEN #SS(SS selector + EXT); FI;IF 32-bit gateTHENIF new stack does not have room for 40 bytes (error code pushed)or 36 bytes (no error code pushed)THEN #SS(segment selector + EXT); FI;ELSE IF 16-bit gateTHENIF new stack does not have room for 20 bytes (error code pushed)INT n/INTO/INT 3—Call to Interrupt ProcedureVol.

2A 3-541INSTRUCTION SET REFERENCE, A-Mor 18 bytes (no error code pushed)THEN #SS(segment selector + EXT); FI;ELSE (* 64-bit gate*)IF StackAddress is non-canonicalTHEN #SS(0);FI;FI;IF instruction pointer is not within code segment limitsTHEN #GP(0); FI;tempEFLAGS ← EFLAGS;VM ← 0;TF ← 0;RF ← 0;NT ← 0;IF service through interrupt gateTHEN IF = 0; FI;TempSS ← SS;TempESP ← ESP;SS:ESP ← TSS(SS0:ESP0); (* Change to level 0 stack segment *)(* Following pushes are 16 bits for 16-bit gate and 32 bits for 32-bit gates;Segment selector pushes in 32-bit mode are padded to two words *)Push(GS);Push(FS);Push(DS);Push(ES);Push(TempSS);Push(TempESP);Push(TempEFlags);Push(CS);Push(EIP);GS ← 0; (* Segment registers NULLified, invalid in protected mode *)FS ← 0;DS ← 0;ES ← 0;CS ← Gate(CS);IF OperandSize = 32THENEIP ← Gate(instruction pointer);ELSE (* OperandSize is 16 *)EIP ← Gate(instruction pointer) AND 0000FFFFH;FI;(* Start execution of new routine in Protected Mode *)END;3-542 Vol.

2AINT n/INTO/INT 3—Call to Interrupt ProcedureINSTRUCTION SET REFERENCE, A-MINTRA-PRIVILEGE-LEVEL-INTERRUPT:(* PE = 1, DPL = CPL or conforming segment *)IF 32-bit gate and IA32_EFER.LMA = 0THENIF current stack does not have room for 16 bytes (error code pushed)or 12 bytes (no error code pushed)THEN #SS(0); FI;ELSE IF 16-bit gateIF current stack does not have room for 8 bytes (error code pushed)or 6 bytes (no error code pushed)THEN #SS(0); FI;ELSE (* 64-bit gate*)IF StackAddress is non-canonicalTHEN #SS(0);FI;FI;IF instruction pointer not within code segment limitTHEN #GP(0); FI;IF 32-bit gateTHENPush (EFLAGS);Push (far pointer to return instruction); (* 3 words padded to 4 *)CS:EIP ← Gate(CS:EIP); (* Segment descriptor information also loaded *)Push (ErrorCode); (* If any *)ELSEIF 16-bit gateTHENPush (FLAGS);Push (far pointer to return location); (* 2 words *)CS:IP ← Gate(CS:IP);(* Segment descriptor information also loaded *)Push (ErrorCode); (* If any *)ELSE (* 64-bit gate*)Push(far pointer to old stack);(* Old SS and SP, each an 8-byte push *)Push(RFLAGS); (* 8-byte push *)Push(far pointer to return instruction);(* Old CS and RIP, each an 8-byte push *)Push(ErrorCode); (* If needed, 8 bytes *)CS:RIP ← GATE(CS:RIP);(* Segment descriptor information also loaded *)FI;FI;CS(RPL) ← CPL;INT n/INTO/INT 3—Call to Interrupt ProcedureVol.

2A 3-543INSTRUCTION SET REFERENCE, A-MIF interrupt gateTHEN IF ← 0; FI; (* Interrupt flag set to 0: disabled *)TF ← 0;NT ← 0;VM ← 0;RF ← 0;END;Flags AffectedThe EFLAGS register is pushed onto the stack. The IF, TF, NT, AC, RF, and VM flagsmay be cleared, depending on the mode of operation of the processor when the INTinstruction is executed (see the “Operation” section). If the interrupt uses a taskgate, any flags may be set or cleared, controlled by the EFLAGS image in the newtask’s TSS.Protected Mode Exceptions#GP(0)If the instruction pointer in the IDT or in the interrupt-, trap-, ortask gate is beyond the code segment limits.#GP(selector)If the segment selector in the interrupt-, trap-, or task gate isNULL.If an interrupt-, trap-, or task gate, code segment, or TSSsegment selector index is outside its descriptor table limits.If the interrupt vector number is outside the IDT limits.If an IDT descriptor is not an interrupt-, trap-, or task-descriptor.If an interrupt is generated by the INT n, INT 3, or INTO instruction and the DPL of an interrupt-, trap-, or task-descriptor is lessthan the CPL.If the segment selector in an interrupt- or trap-gate does notpoint to a segment descriptor for a code segment.If the segment selector for a TSS has its local/global bit set forlocal.If a TSS segment descriptor specifies that the TSS is busy or notavailable.#SS(0)If pushing the return address, flags, or error code onto the stackexceeds the bounds of the stack segment and no stack switchoccurs.#SS(selector)If the SS register is being loaded and the segment pointed to ismarked not present.If pushing the return address, flags, error code, or stacksegment pointer exceeds the bounds of the new stack segmentwhen a stack switch occurs.3-544 Vol.

2AINT n/INTO/INT 3—Call to Interrupt ProcedureINSTRUCTION SET REFERENCE, A-M#NP(selector)If code segment, interrupt-, trap-, or task gate, or TSS is notpresent.#TS(selector)If the RPL of the stack segment selector in the TSS is not equalto the DPL of the code segment being accessed by the interruptor trap gate.If DPL of the stack segment descriptor pointed to by the stacksegment selector in the TSS is not equal to the DPL of the codesegment descriptor for the interrupt or trap gate.If the stack segment selector in the TSS is NULL.If the stack segment for the TSS is not a writable data segment.If segment-selector index for stack segment is outsidedescriptor table limits.#PF(fault-code)If a page fault occurs.#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.If the interrupt vector number is outside the IDT limits.#SSIf stack limit violation on push.If pushing the return address, flags, or error code onto the stackexceeds the bounds of the stack segment.#UDIf the LOCK prefix is used.Virtual-8086 Mode Exceptions#GP(0)(For INT n, INTO, or BOUND instruction) If the IOPL is less than3 or the DPL of the interrupt-, trap-, or task-gate descriptor isnot equal to 3.If the instruction pointer in the IDT or in the interrupt-, trap-, ortask gate is beyond the code segment limits.#GP(selector)If the segment selector in the interrupt-, trap-, or task gate isNULL.If a interrupt-, trap-, or task gate, code segment, or TSSsegment selector index is outside its descriptor table limits.If the interrupt vector number is outside the IDT limits.If an IDT descriptor is not an interrupt-, trap-, or task-descriptor.If an interrupt is generated by the INT n instruction and the DPLof an interrupt-, trap-, or task-descriptor is less than the CPL.If the segment selector in an interrupt- or trap-gate does notpoint to a segment descriptor for a code segment.INT n/INTO/INT 3—Call to Interrupt ProcedureVol.

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

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

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

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