1 #------------------------------------------------------------------------------
3 #* Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
4 #* This program and the accompanying materials
5 #* are licensed and made available under the terms and conditions of the BSD License
6 #* which accompanies this distribution. The full text of the license may be found at
7 #* http://opensource.org/licenses/bsd-license.php
9 #* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 #* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #------------------------------------------------------------------------------
18 ##############################################################################
19 # Now in 64-bit long mode.
20 ##############################################################################
30 .equ DEFAULT_HANDLER_SIZE, INT1 - INT0
32 .macro jmpCommonIdtEntry
33 # jmp commonIdtEntry - this must be hand coded to keep the assembler from
34 # using a 8 bit reletive jump when the entries are
35 # within 255 bytes of the common entry. This must
36 # be done to maintain the consistency of the size
38 .byte 0xe9 # jmp 16 bit relative
39 .long commonIdtEntry - . - 4 # offset to jump to
45 movl $0x001fffe8,%esp # make final stack aligned
47 # set OSFXSR and OSXMMEXCPT because some code will use XMM register
61 # Populate IDT with meaningful offsets for exception handlers...
63 sidt (%eax) # get fword address of IDT
67 movl %eax,%ebx # use bx to copy 15..0 to descriptors
68 shrl $16,%eax # use ax to copy 31..16 to descriptors
69 # 63..32 of descriptors is 0
70 movl $0x78,%ecx # 78h IDT entries to initialize with unique entry points (exceptions)
71 movl $(Idtr + 2), %esi
74 LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler
75 movw %bx, (%edi) # write bits 15..0 of offset
76 movw $0x38, 2(%edi) # SYS_CODE_SEL64 from GDT
77 movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present
78 movw %ax, 6(%edi) # write bits 31..16 of offset
79 movl $0, 8(%edi) # write bits 31..16 of offset
80 addl $16, %edi # move up to next descriptor
81 addw $DEFAULT_HANDLER_SIZE, %bx # move to next entry point
82 loopl LOOP_1 # loop back through again until all descriptors are initialized
84 ## at this point edi contains the offset of the descriptor for INT 20
85 ## and bx contains the low 16 bits of the offset of the default handler
86 ## so initialize all the rest of the descriptors with these two values...
87 # mov ecx, 101 ; there are 100 descriptors left (INT 20 (14h) - INT 119 (77h)
88 #@@: ; loop through all IDT entries exception handlers and initialize to default handler
89 # mov word ptr [edi], bx ; write bits 15..0 of offset
90 # mov word ptr [edi+2], 38h ; SYS_CODE64_SEL from GDT
91 # mov word ptr [edi+4], 0e00h OR 8000h ; type = 386 interrupt gate, present
92 # mov word ptr [edi+6], ax ; write bits 31..16 of offset
93 # mov dword ptr [edi+8], 0 ; write bits 63..32 of offset
94 # add edi, 16 ; move up to next descriptor
95 # loop @b ; loop back through again until all descriptors are initialized
98 ## DUMP location of IDT and several of the descriptors
100 # mov eax, [offset Idtr + 2]
109 ## just for fun, let's do a software interrupt to see if we correctly land in the exception handler...
110 # mov eax, 011111111h
111 # mov ebx, 022222222h
112 # mov ecx, 033333333h
113 # mov edx, 044444444h
114 # mov ebp, 055555555h
115 # mov esi, 066666666h
116 # mov edi, 077777777h
122 movl $0x22000,%esi # esi = 22000
123 movl 0x14(%esi),%eax # eax = [22014]
124 addl %eax,%esi # esi = 22000 + [22014] = Base of EFILDR.C
125 movl 0x3c(%esi),%ebp # ebp = [22000 + [22014] + 3c] = NT Image Header for EFILDR.C
127 movl 0x30(%ebp),%edi # edi = [[22000 + [22014] + 3c] + 2c] = ImageBase (63..32 is zero, ignore)
128 movl 0x28(%ebp),%eax # eax = [[22000 + [22014] + 3c] + 24] = EntryPoint
129 addl %edi,%eax # eax = ImageBase + EntryPoint
130 movl $EfiLdrOffset, %ebx
131 movl %eax, (%ebx) # Modify far jump instruction for correct entry point
133 movw 6(%ebp), %bx # bx = Number of sections
135 movw 0x14(%ebp), %ax # ax = Optional Header Size
137 addl $0x18,%ebp # ebp = Start of 1st Section
140 pushl %esi # Save Base of EFILDR.C
141 pushl %edi # Save ImageBase
142 addl 0x14(%ebp),%esi # esi = Base of EFILDR.C + PointerToRawData
143 addl 0x0c(%ebp),%edi # edi = ImageBase + VirtualAddress
144 movl 0x10(%ebp),%ecx # ecs = SizeOfRawData
151 popl %edi # Restore ImageBase
152 popl %esi # Restore Base of EFILDR.C
154 addw $0x28,%bp # ebp = ebp + 028h = Pointer to next section record
162 movl $Idtr, %edx # get size of IDT
167 addl 2(%edx), %eax # add to base of IDT to get location of memory map...
169 movl %eax,%ecx # put argument to RCX
175 .long 0x00401000 # Offset of EFILDR
183 # db "**** DEFAULT IDT ENTRY ***",0
187 pushl $0x0 # push error code place holder on the stack
190 # db 0e9h ; jmp 16 bit reletive
191 # dd commonIdtEntry - $ - 4 ; offset to jump to
194 pushl $0x0 # push error code place holder on the stack
199 pushl $0x0 # push error code place holder on the stack
204 pushl $0x0 # push error code place holder on the stack
209 pushl $0x0 # push error code place holder on the stack
214 pushl $0x0 # push error code place holder on the stack
219 pushl $0x0 # push error code place holder on the stack
224 pushl $0x0 # push error code place holder on the stack
229 # Double fault causes an error code to be pushed so no phony push necessary
236 pushl $0x0 # push error code place holder on the stack
241 # Invalid TSS causes an error code to be pushed so no phony push necessary
248 # Segment Not Present causes an error code to be pushed so no phony push necessary
255 # Stack fault causes an error code to be pushed so no phony push necessary
262 # GP fault causes an error code to be pushed so no phony push necessary
269 # Page fault causes an error code to be pushed so no phony push necessary
276 pushl $0x0 # push error code place holder on the stack
281 pushl $0x0 # push error code place holder on the stack
286 # Alignment check causes an error code to be pushed so no phony push necessary
293 pushl $0x0 # push error code place holder on the stack
298 pushl $0x0 # push error code place holder on the stack
303 # The following segment repeats (0x78 - 20) times:
305 pushl $0x0 # push error code place holder on the stack
306 # push xxh ; push vector number
308 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
311 pushl $0x0 # push error code place holder on the stack
312 # push xxh ; push vector number
314 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
317 pushl $0x0 # push error code place holder on the stack
318 # push xxh ; push vector number
320 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
323 pushl $0x0 # push error code place holder on the stack
324 # push xxh ; push vector number
326 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
329 pushl $0x0 # push error code place holder on the stack
330 # push xxh ; push vector number
332 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
335 pushl $0x0 # push error code place holder on the stack
336 # push xxh ; push vector number
338 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
341 pushl $0x0 # push error code place holder on the stack
342 # push xxh ; push vector number
344 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
347 pushl $0x0 # push error code place holder on the stack
348 # push xxh ; push vector number
350 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
353 pushl $0x0 # push error code place holder on the stack
354 # push xxh ; push vector number
356 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
359 pushl $0x0 # push error code place holder on the stack
360 # push xxh ; push vector number
362 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
365 pushl $0x0 # push error code place holder on the stack
366 # push xxh ; push vector number
368 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
371 pushl $0x0 # push error code place holder on the stack
372 # push xxh ; push vector number
374 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
377 pushl $0x0 # push error code place holder on the stack
378 # push xxh ; push vector number
380 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
383 pushl $0x0 # push error code place holder on the stack
384 # push xxh ; push vector number
386 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
389 pushl $0x0 # push error code place holder on the stack
390 # push xxh ; push vector number
392 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
395 pushl $0x0 # push error code place holder on the stack
396 # push xxh ; push vector number
398 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
401 pushl $0x0 # push error code place holder on the stack
402 # push xxh ; push vector number
404 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
407 pushl $0x0 # push error code place holder on the stack
408 # push xxh ; push vector number
410 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
413 pushl $0x0 # push error code place holder on the stack
414 # push xxh ; push vector number
416 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
419 pushl $0x0 # push error code place holder on the stack
420 # push xxh ; push vector number
422 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
425 pushl $0x0 # push error code place holder on the stack
426 # push xxh ; push vector number
428 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
431 pushl $0x0 # push error code place holder on the stack
432 # push xxh ; push vector number
434 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
437 pushl $0x0 # push error code place holder on the stack
438 # push xxh ; push vector number
440 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
443 pushl $0x0 # push error code place holder on the stack
444 # push xxh ; push vector number
446 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
449 pushl $0x0 # push error code place holder on the stack
450 # push xxh ; push vector number
452 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
455 pushl $0x0 # push error code place holder on the stack
456 # push xxh ; push vector number
458 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
461 pushl $0x0 # push error code place holder on the stack
462 # push xxh ; push vector number
464 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
467 pushl $0x0 # push error code place holder on the stack
468 # push xxh ; push vector number
470 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
473 pushl $0x0 # push error code place holder on the stack
474 # push xxh ; push vector number
476 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
479 pushl $0x0 # push error code place holder on the stack
480 # push xxh ; push vector number
482 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
485 pushl $0x0 # push error code place holder on the stack
486 # push xxh ; push vector number
488 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
491 pushl $0x0 # push error code place holder on the stack
492 # push xxh ; push vector number
494 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
497 pushl $0x0 # push error code place holder on the stack
498 # push xxh ; push vector number
500 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
503 pushl $0x0 # push error code place holder on the stack
504 # push xxh ; push vector number
506 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
509 pushl $0x0 # push error code place holder on the stack
510 # push xxh ; push vector number
512 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
515 pushl $0x0 # push error code place holder on the stack
516 # push xxh ; push vector number
518 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
521 pushl $0x0 # push error code place holder on the stack
522 # push xxh ; push vector number
524 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
527 pushl $0x0 # push error code place holder on the stack
528 # push xxh ; push vector number
530 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
533 pushl $0x0 # push error code place holder on the stack
534 # push xxh ; push vector number
536 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
539 pushl $0x0 # push error code place holder on the stack
540 # push xxh ; push vector number
542 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
545 pushl $0x0 # push error code place holder on the stack
546 # push xxh ; push vector number
548 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
551 pushl $0x0 # push error code place holder on the stack
552 # push xxh ; push vector number
554 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
557 pushl $0x0 # push error code place holder on the stack
558 # push xxh ; push vector number
560 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
563 pushl $0x0 # push error code place holder on the stack
564 # push xxh ; push vector number
566 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
569 pushl $0x0 # push error code place holder on the stack
570 # push xxh ; push vector number
572 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
575 pushl $0x0 # push error code place holder on the stack
576 # push xxh ; push vector number
578 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
581 pushl $0x0 # push error code place holder on the stack
582 # push xxh ; push vector number
584 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
587 pushl $0x0 # push error code place holder on the stack
588 # push xxh ; push vector number
590 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
593 pushl $0x0 # push error code place holder on the stack
594 # push xxh ; push vector number
596 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
599 pushl $0x0 # push error code place holder on the stack
600 # push xxh ; push vector number
602 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
605 pushl $0x0 # push error code place holder on the stack
606 # push xxh ; push vector number
608 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
611 pushl $0x0 # push error code place holder on the stack
612 # push xxh ; push vector number
614 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
617 pushl $0x0 # push error code place holder on the stack
618 # push xxh ; push vector number
620 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
623 pushl $0x0 # push error code place holder on the stack
624 # push xxh ; push vector number
626 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
629 pushl $0x0 # push error code place holder on the stack
630 # push xxh ; push vector number
632 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
635 pushl $0x0 # push error code place holder on the stack
636 # push xxh ; push vector number
638 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
641 pushl $0x0 # push error code place holder on the stack
642 # push xxh ; push vector number
644 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
647 pushl $0x0 # push error code place holder on the stack
648 # push xxh ; push vector number
650 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
653 pushl $0x0 # push error code place holder on the stack
654 # push xxh ; push vector number
656 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
659 pushl $0x0 # push error code place holder on the stack
660 # push xxh ; push vector number
662 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
665 pushl $0x0 # push error code place holder on the stack
666 # push xxh ; push vector number
668 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
671 pushl $0x0 # push error code place holder on the stack
672 # push xxh ; push vector number
674 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
677 pushl $0x0 # push error code place holder on the stack
678 # push xxh ; push vector number
680 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
683 pushl $0x0 # push error code place holder on the stack
684 # push xxh ; push vector number
686 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
689 pushl $0x0 # push error code place holder on the stack
690 # push xxh ; push vector number
692 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
695 pushl $0x0 # push error code place holder on the stack
696 # push xxh ; push vector number
698 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
701 pushl $0x0 # push error code place holder on the stack
702 # push xxh ; push vector number
704 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
707 pushl $0x0 # push error code place holder on the stack
708 # push xxh ; push vector number
710 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
713 pushl $0x0 # push error code place holder on the stack
714 # push xxh ; push vector number
716 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
719 pushl $0x0 # push error code place holder on the stack
720 # push xxh ; push vector number
722 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
725 pushl $0x0 # push error code place holder on the stack
726 # push xxh ; push vector number
728 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
731 pushl $0x0 # push error code place holder on the stack
732 # push xxh ; push vector number
734 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
737 pushl $0x0 # push error code place holder on the stack
738 # push xxh ; push vector number
740 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
743 pushl $0x0 # push error code place holder on the stack
744 # push xxh ; push vector number
746 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
749 pushl $0x0 # push error code place holder on the stack
750 # push xxh ; push vector number
752 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
755 pushl $0x0 # push error code place holder on the stack
756 # push xxh ; push vector number
758 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
761 pushl $0x0 # push error code place holder on the stack
762 # push xxh ; push vector number
764 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
767 pushl $0x0 # push error code place holder on the stack
768 # push xxh ; push vector number
770 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
773 pushl $0x0 # push error code place holder on the stack
774 # push xxh ; push vector number
776 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
779 pushl $0x0 # push error code place holder on the stack
780 # push xxh ; push vector number
782 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
785 pushl $0x0 # push error code place holder on the stack
786 # push xxh ; push vector number
788 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
791 pushl $0x0 # push error code place holder on the stack
792 # push xxh ; push vector number
794 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
797 pushl $0x0 # push error code place holder on the stack
798 # push xxh ; push vector number
800 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
803 pushl $0x0 # push error code place holder on the stack
804 # push xxh ; push vector number
806 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
809 pushl $0x0 # push error code place holder on the stack
810 # push xxh ; push vector number
812 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
815 pushl $0x0 # push error code place holder on the stack
816 # push xxh ; push vector number
818 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
821 pushl $0x0 # push error code place holder on the stack
822 # push xxh ; push vector number
824 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
827 pushl $0x0 # push error code place holder on the stack
828 # push xxh ; push vector number
830 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
833 pushl $0x0 # push error code place holder on the stack
834 # push xxh ; push vector number
836 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
839 pushl $0x0 # push error code place holder on the stack
840 # push xxh ; push vector number
842 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
845 pushl $0x0 # push error code place holder on the stack
846 # push xxh ; push vector number
848 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
851 pushl $0x0 # push error code place holder on the stack
852 # push xxh ; push vector number
854 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
857 pushl $0x0 # push error code place holder on the stack
858 # push xxh ; push vector number
860 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
863 pushl $0x0 # push error code place holder on the stack
864 # push xxh ; push vector number
866 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
869 pushl $0x0 # push error code place holder on the stack
870 # push xxh ; push vector number
872 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
875 pushl $0x0 # push error code place holder on the stack
876 # push xxh ; push vector number
878 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
881 pushl $0x0 # push error code place holder on the stack
882 # push xxh ; push vector number
884 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
887 pushl $0x0 # push error code place holder on the stack
888 # push xxh ; push vector number
890 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
893 pushl $0x0 # push error code place holder on the stack
894 # push xxh ; push vector number
896 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
899 pushl $0x0 # push error code place holder on the stack
900 # push xxh ; push vector number
902 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
944 ## At this point the stack looks like this:
952 ## Int num or 0ffh for unknown int num
968 ## r15 <------- RSP, RBP
975 movl 16*8(%ebp),%eax ## move Int number into RAX
978 ja PrintDefaultString
979 PrintExceptionString:
980 shll $3,%eax ## multiply by 8 to get offset from StringTable to actual string address
981 addl $StringTable, %eax
985 movl $IntUnknownString, %esi
999 movl 19*8(%ebp),%eax # CS
1005 movl 18*8(%ebp),%eax # RIP
1012 movl $StringRax, %esi
1015 movl 15*8(%ebp),%eax
1018 movl $StringRcx, %esi
1021 movl 14*8(%ebp),%eax
1024 movl $StringRdx, %esi
1027 movl 13*8(%ebp),%eax
1032 movl $StringRbx, %esi
1035 movl 12*8(%ebp),%eax
1038 movl $StringRsp, %esi
1041 movl 21*8(%ebp),%eax
1044 movl $StringRbp, %esi
1047 movl 10*8(%ebp),%eax
1052 movl $StringRsi, %esi
1058 movl $StringRdi, %esi
1064 movl $StringEcode, %esi
1067 movl 17*8(%ebp),%eax
1072 movl $StringR8, %esi
1078 movl $StringR9, %esi
1084 movl $StringR10, %esi
1092 movl $StringR11, %esi
1098 movl $StringR12, %esi
1104 movl $StringR13, %esi
1112 movl $StringR14, %esi
1118 movl $StringR15, %esi
1124 movl $StringSs, %esi
1127 movl 22*8(%ebp),%eax
1132 movl $StringRflags, %esi
1135 movl 20*8(%ebp),%eax
1156 movb $0x20, %al # blank character
1170 movl 18*8(%ebp),%eax # RIP
1173 movl %eax,%esi # esi = rip - 8 QWORD linear (total 16 QWORD)
1187 movb $0x20, %al # blank character
1245 # add esp, 16 ; error code and INT number
1267 ## RAX contains qword to print
1268 ## RDI contains memory location (screen location) to print it to
1303 movb $0x20, %al # blank character
1327 String1: .asciz "*** INT "
1329 Int0String: .asciz "00h Divide by 0 -"
1330 Int1String: .asciz "01h Debug exception -"
1331 Int2String: .asciz "02h NMI -"
1332 Int3String: .asciz "03h Breakpoint -"
1333 Int4String: .asciz "04h Overflow -"
1334 Int5String: .asciz "05h Bound -"
1335 Int6String: .asciz "06h Invalid opcode -"
1336 Int7String: .asciz "07h Device not available -"
1337 Int8String: .asciz "08h Double fault -"
1338 Int9String: .asciz "09h Coprocessor seg overrun (reserved) -"
1339 Int10String: .asciz "0Ah Invalid TSS -"
1340 Int11String: .asciz "0Bh Segment not present -"
1341 Int12String: .asciz "0Ch Stack fault -"
1342 Int13String: .asciz "0Dh General protection fault -"
1343 Int14String: .asciz "0Eh Page fault -"
1344 Int15String: .asciz "0Fh (Intel reserved) -"
1345 Int16String: .asciz "10h Floating point error -"
1346 Int17String: .asciz "11h Alignment check -"
1347 Int18String: .asciz "12h Machine check -"
1348 Int19String: .asciz "13h SIMD Floating-Point Exception -"
1349 IntUnknownString: .asciz "??h Unknown interrupt -"
1351 StringTable: .long Int0String, 0, Int1String, 0, Int2String, 0, Int3String, 0, \
1352 Int4String, 0, Int5String, 0, Int6String, 0, Int7String, 0, \
1353 Int8String, 0, Int9String, 0, Int10String, 0, Int11String, 0, \
1354 Int12String, 0, Int13String, 0, Int14String, 0, Int15String, 0, \
1355 Int16String, 0, Int17String, 0, Int18String, 0, Int19String, 0
1357 String2: .asciz " HALT!! *** ("
1359 StringRax: .asciz "RAX="
1360 StringRcx: .asciz " RCX="
1361 StringRdx: .asciz " RDX="
1362 StringRbx: .asciz "RBX="
1363 StringRsp: .asciz " RSP="
1364 StringRbp: .asciz " RBP="
1365 StringRsi: .asciz "RSI="
1366 StringRdi: .asciz " RDI="
1367 StringEcode: .asciz " ECODE="
1368 StringR8: .asciz "R8 ="
1369 StringR9: .asciz " R9 ="
1370 StringR10: .asciz " R10="
1371 StringR11: .asciz "R11="
1372 StringR12: .asciz " R12="
1373 StringR13: .asciz " R13="
1374 StringR14: .asciz "R14="
1375 StringR15: .asciz " R15="
1376 StringSs: .asciz " SS ="
1377 StringRflags: .asciz "RFLAGS="