1 #------------------------------------------------------------------------------
3 #* Copyright (c) 2006, 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 ##############################################################################
27 .equ DEFAULT_HANDLER_SIZE, INT1 - INT0
29 .macro jmpCommonIdtEntry
30 # jmp commonIdtEntry - this must be hand coded to keep the assembler from
31 # using a 8 bit reletive jump when the entries are
32 # within 255 bytes of the common entry. This must
33 # be done to maintain the consistency of the size
35 .byte 0xe9 # jmp 16 bit relative
36 .long commonIdtEntry - . - 4 # offset to jump to
42 movl $0x001fffe8,%esp # make final stack aligned
44 # set OSFXSR and OSXMMEXCPT because some code will use XMM register
58 # Populate IDT with meaningful offsets for exception handlers...
63 movl %eax,%ebx # use bx to copy 15..0 to descriptors
64 shrl $16,%eax # use ax to copy 31..16 to descriptors
65 # 63..32 of descriptors is 0
66 movl $0x78,%ecx # 78h IDT entries to initialize with unique entry points (exceptions)
70 LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler
71 movw %bx, (%edi) # write bits 15..0 of offset
72 movw $0x38, 2(%edi) # SYS_CODE_SEL64 from GDT
73 movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present
74 movw %ax, 6(%edi) # write bits 31..16 of offset
75 movl $0, 8(%edi) # write bits 31..16 of offset
76 addl $16, %edi # move up to next descriptor
77 addw DEFAULT_HANDLER_SIZE, %bx # move to next entry point
78 loopl LOOP_1 # loop back through again until all descriptors are initialized
80 ## at this point edi contains the offset of the descriptor for INT 20
81 ## and bx contains the low 16 bits of the offset of the default handler
82 ## so initialize all the rest of the descriptors with these two values...
83 # mov ecx, 101 ; there are 100 descriptors left (INT 20 (14h) - INT 119 (77h)
84 #@@: ; loop through all IDT entries exception handlers and initialize to default handler
85 # mov word ptr [edi], bx ; write bits 15..0 of offset
86 # mov word ptr [edi+2], 38h ; SYS_CODE64_SEL from GDT
87 # mov word ptr [edi+4], 0e00h OR 8000h ; type = 386 interrupt gate, present
88 # mov word ptr [edi+6], ax ; write bits 31..16 of offset
89 # mov dword ptr [edi+8], 0 ; write bits 63..32 of offset
90 # add edi, 16 ; move up to next descriptor
91 # loop @b ; loop back through again until all descriptors are initialized
94 ## DUMP location of IDT and several of the descriptors
96 # mov eax, [offset Idtr + 2]
105 ## just for fun, let's do a software interrupt to see if we correctly land in the exception handler...
106 # mov eax, 011111111h
107 # mov ebx, 022222222h
108 # mov ecx, 033333333h
109 # mov edx, 044444444h
110 # mov ebp, 055555555h
111 # mov esi, 066666666h
112 # mov edi, 077777777h
118 movl $0x22000,%esi # esi = 22000
119 movl 0x14(%esi),%eax # eax = [22014]
120 addl %eax,%esi # esi = 22000 + [22014] = Base of EFILDR.C
121 movl 0x3c(%esi),%ebp # ebp = [22000 + [22014] + 3c] = NT Image Header for EFILDR.C
123 movl 0x30(%ebp),%edi # edi = [[22000 + [22014] + 3c] + 2c] = ImageBase (63..32 is zero, ignore)
124 movl 0x28(%ebp),%eax # eax = [[22000 + [22014] + 3c] + 24] = EntryPoint
125 addl %edi,%eax # eax = ImageBase + EntryPoint
126 movl %ebx, EfiLdrOffset
127 movl %eax, (%ebx) # Modify far jump instruction for correct entry point
129 movw 6(%ebp), %bx # bx = Number of sections
131 movw 0x14(%ebp), %ax # ax = Optional Header Size
133 addl $0x18,%ebp # ebp = Start of 1st Section
136 pushl %esi # Save Base of EFILDR.C
137 pushl %edi # Save ImageBase
138 addl 0x14(%ebp),%esi # esi = Base of EFILDR.C + PointerToRawData
139 addl 0x0c(%ebp),%edi # edi = ImageBase + VirtualAddress
140 movl 0x10(%ebp),%ecx # ecs = SizeOfRawData
147 popl %edi # Restore ImageBase
148 popl %esi # Restore Base of EFILDR.C
150 addw $0x28,%bp # ebp = ebp + 028h = Pointer to next section record
158 movl (Idtr), %eax # get size of IDT
163 addl 2(%edx), %eax # add to base of IDT to get location of memory map...
165 movl %eax,%ecx # put argument to RCX
171 .long 0x00401000 # Offset of EFILDR
179 # db "**** DEFAULT IDT ENTRY ***",0
183 pushl $0x0 # push error code place holder on the stack
186 # db 0e9h ; jmp 16 bit reletive
187 # dd commonIdtEntry - $ - 4 ; offset to jump to
190 pushl $0x0 # push error code place holder on the stack
195 pushl $0x0 # push error code place holder on the stack
200 pushl $0x0 # push error code place holder on the stack
205 pushl $0x0 # push error code place holder on the stack
210 pushl $0x0 # push error code place holder on the stack
215 pushl $0x0 # push error code place holder on the stack
220 pushl $0x0 # push error code place holder on the stack
225 # Double fault causes an error code to be pushed so no phony push necessary
232 pushl $0x0 # push error code place holder on the stack
237 # Invalid TSS causes an error code to be pushed so no phony push necessary
244 # Segment Not Present causes an error code to be pushed so no phony push necessary
251 # Stack fault causes an error code to be pushed so no phony push necessary
258 # GP fault causes an error code to be pushed so no phony push necessary
265 # Page fault causes an error code to be pushed so no phony push necessary
272 pushl $0x0 # push error code place holder on the stack
277 pushl $0x0 # push error code place holder on the stack
282 # Alignment check causes an error code to be pushed so no phony push necessary
289 pushl $0x0 # push error code place holder on the stack
294 pushl $0x0 # push error code place holder on the stack
299 # The following segment repeats (0x78 - 20) times:
301 pushl $0x0 # push error code place holder on the stack
302 # push xxh ; push vector number
304 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
307 pushl $0x0 # push error code place holder on the stack
308 # push xxh ; push vector number
310 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
313 pushl $0x0 # push error code place holder on the stack
314 # push xxh ; push vector number
316 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
319 pushl $0x0 # push error code place holder on the stack
320 # push xxh ; push vector number
322 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
325 pushl $0x0 # push error code place holder on the stack
326 # push xxh ; push vector number
328 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
331 pushl $0x0 # push error code place holder on the stack
332 # push xxh ; push vector number
334 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
337 pushl $0x0 # push error code place holder on the stack
338 # push xxh ; push vector number
340 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
343 pushl $0x0 # push error code place holder on the stack
344 # push xxh ; push vector number
346 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
349 pushl $0x0 # push error code place holder on the stack
350 # push xxh ; push vector number
352 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
355 pushl $0x0 # push error code place holder on the stack
356 # push xxh ; push vector number
358 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
361 pushl $0x0 # push error code place holder on the stack
362 # push xxh ; push vector number
364 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
367 pushl $0x0 # push error code place holder on the stack
368 # push xxh ; push vector number
370 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
373 pushl $0x0 # push error code place holder on the stack
374 # push xxh ; push vector number
376 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
379 pushl $0x0 # push error code place holder on the stack
380 # push xxh ; push vector number
382 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
385 pushl $0x0 # push error code place holder on the stack
386 # push xxh ; push vector number
388 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
391 pushl $0x0 # push error code place holder on the stack
392 # push xxh ; push vector number
394 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
397 pushl $0x0 # push error code place holder on the stack
398 # push xxh ; push vector number
400 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
403 pushl $0x0 # push error code place holder on the stack
404 # push xxh ; push vector number
406 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
409 pushl $0x0 # push error code place holder on the stack
410 # push xxh ; push vector number
412 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
415 pushl $0x0 # push error code place holder on the stack
416 # push xxh ; push vector number
418 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
421 pushl $0x0 # push error code place holder on the stack
422 # push xxh ; push vector number
424 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
427 pushl $0x0 # push error code place holder on the stack
428 # push xxh ; push vector number
430 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
433 pushl $0x0 # push error code place holder on the stack
434 # push xxh ; push vector number
436 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
439 pushl $0x0 # push error code place holder on the stack
440 # push xxh ; push vector number
442 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
445 pushl $0x0 # push error code place holder on the stack
446 # push xxh ; push vector number
448 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
451 pushl $0x0 # push error code place holder on the stack
452 # push xxh ; push vector number
454 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
457 pushl $0x0 # push error code place holder on the stack
458 # push xxh ; push vector number
460 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
463 pushl $0x0 # push error code place holder on the stack
464 # push xxh ; push vector number
466 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
469 pushl $0x0 # push error code place holder on the stack
470 # push xxh ; push vector number
472 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
475 pushl $0x0 # push error code place holder on the stack
476 # push xxh ; push vector number
478 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
481 pushl $0x0 # push error code place holder on the stack
482 # push xxh ; push vector number
484 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
487 pushl $0x0 # push error code place holder on the stack
488 # push xxh ; push vector number
490 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
493 pushl $0x0 # push error code place holder on the stack
494 # push xxh ; push vector number
496 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
499 pushl $0x0 # push error code place holder on the stack
500 # push xxh ; push vector number
502 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
505 pushl $0x0 # push error code place holder on the stack
506 # push xxh ; push vector number
508 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
511 pushl $0x0 # push error code place holder on the stack
512 # push xxh ; push vector number
514 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
517 pushl $0x0 # push error code place holder on the stack
518 # push xxh ; push vector number
520 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
523 pushl $0x0 # push error code place holder on the stack
524 # push xxh ; push vector number
526 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
529 pushl $0x0 # push error code place holder on the stack
530 # push xxh ; push vector number
532 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
535 pushl $0x0 # push error code place holder on the stack
536 # push xxh ; push vector number
538 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
541 pushl $0x0 # push error code place holder on the stack
542 # push xxh ; push vector number
544 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
547 pushl $0x0 # push error code place holder on the stack
548 # push xxh ; push vector number
550 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
553 pushl $0x0 # push error code place holder on the stack
554 # push xxh ; push vector number
556 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
559 pushl $0x0 # push error code place holder on the stack
560 # push xxh ; push vector number
562 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
565 pushl $0x0 # push error code place holder on the stack
566 # push xxh ; push vector number
568 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
571 pushl $0x0 # push error code place holder on the stack
572 # push xxh ; push vector number
574 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
577 pushl $0x0 # push error code place holder on the stack
578 # push xxh ; push vector number
580 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
583 pushl $0x0 # push error code place holder on the stack
584 # push xxh ; push vector number
586 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
589 pushl $0x0 # push error code place holder on the stack
590 # push xxh ; push vector number
592 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
595 pushl $0x0 # push error code place holder on the stack
596 # push xxh ; push vector number
598 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
601 pushl $0x0 # push error code place holder on the stack
602 # push xxh ; push vector number
604 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
607 pushl $0x0 # push error code place holder on the stack
608 # push xxh ; push vector number
610 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
613 pushl $0x0 # push error code place holder on the stack
614 # push xxh ; push vector number
616 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
619 pushl $0x0 # push error code place holder on the stack
620 # push xxh ; push vector number
622 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
625 pushl $0x0 # push error code place holder on the stack
626 # push xxh ; push vector number
628 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
631 pushl $0x0 # push error code place holder on the stack
632 # push xxh ; push vector number
634 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
637 pushl $0x0 # push error code place holder on the stack
638 # push xxh ; push vector number
640 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
643 pushl $0x0 # push error code place holder on the stack
644 # push xxh ; push vector number
646 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
649 pushl $0x0 # push error code place holder on the stack
650 # push xxh ; push vector number
652 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
655 pushl $0x0 # push error code place holder on the stack
656 # push xxh ; push vector number
658 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
661 pushl $0x0 # push error code place holder on the stack
662 # push xxh ; push vector number
664 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
667 pushl $0x0 # push error code place holder on the stack
668 # push xxh ; push vector number
670 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
673 pushl $0x0 # push error code place holder on the stack
674 # push xxh ; push vector number
676 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
679 pushl $0x0 # push error code place holder on the stack
680 # push xxh ; push vector number
682 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
685 pushl $0x0 # push error code place holder on the stack
686 # push xxh ; push vector number
688 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
691 pushl $0x0 # push error code place holder on the stack
692 # push xxh ; push vector number
694 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
697 pushl $0x0 # push error code place holder on the stack
698 # push xxh ; push vector number
700 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
703 pushl $0x0 # push error code place holder on the stack
704 # push xxh ; push vector number
706 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
709 pushl $0x0 # push error code place holder on the stack
710 # push xxh ; push vector number
712 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
715 pushl $0x0 # push error code place holder on the stack
716 # push xxh ; push vector number
718 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
721 pushl $0x0 # push error code place holder on the stack
722 # push xxh ; push vector number
724 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
727 pushl $0x0 # push error code place holder on the stack
728 # push xxh ; push vector number
730 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
733 pushl $0x0 # push error code place holder on the stack
734 # push xxh ; push vector number
736 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
739 pushl $0x0 # push error code place holder on the stack
740 # push xxh ; push vector number
742 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
745 pushl $0x0 # push error code place holder on the stack
746 # push xxh ; push vector number
748 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
751 pushl $0x0 # push error code place holder on the stack
752 # push xxh ; push vector number
754 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
757 pushl $0x0 # push error code place holder on the stack
758 # push xxh ; push vector number
760 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
763 pushl $0x0 # push error code place holder on the stack
764 # push xxh ; push vector number
766 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
769 pushl $0x0 # push error code place holder on the stack
770 # push xxh ; push vector number
772 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
775 pushl $0x0 # push error code place holder on the stack
776 # push xxh ; push vector number
778 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
781 pushl $0x0 # push error code place holder on the stack
782 # push xxh ; push vector number
784 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
787 pushl $0x0 # push error code place holder on the stack
788 # push xxh ; push vector number
790 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
793 pushl $0x0 # push error code place holder on the stack
794 # push xxh ; push vector number
796 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
799 pushl $0x0 # push error code place holder on the stack
800 # push xxh ; push vector number
802 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
805 pushl $0x0 # push error code place holder on the stack
806 # push xxh ; push vector number
808 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
811 pushl $0x0 # push error code place holder on the stack
812 # push xxh ; push vector number
814 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
817 pushl $0x0 # push error code place holder on the stack
818 # push xxh ; push vector number
820 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
823 pushl $0x0 # push error code place holder on the stack
824 # push xxh ; push vector number
826 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
829 pushl $0x0 # push error code place holder on the stack
830 # push xxh ; push vector number
832 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
835 pushl $0x0 # push error code place holder on the stack
836 # push xxh ; push vector number
838 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
841 pushl $0x0 # push error code place holder on the stack
842 # push xxh ; push vector number
844 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
847 pushl $0x0 # push error code place holder on the stack
848 # push xxh ; push vector number
850 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
853 pushl $0x0 # push error code place holder on the stack
854 # push xxh ; push vector number
856 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
859 pushl $0x0 # push error code place holder on the stack
860 # push xxh ; push vector number
862 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
865 pushl $0x0 # push error code place holder on the stack
866 # push xxh ; push vector number
868 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
871 pushl $0x0 # push error code place holder on the stack
872 # push xxh ; push vector number
874 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
877 pushl $0x0 # push error code place holder on the stack
878 # push xxh ; push vector number
880 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
883 pushl $0x0 # push error code place holder on the stack
884 # push xxh ; push vector number
886 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
889 pushl $0x0 # push error code place holder on the stack
890 # push xxh ; push vector number
892 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
895 pushl $0x0 # push error code place holder on the stack
896 # push xxh ; push vector number
898 .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number
940 ## At this point the stack looks like this:
948 ## Int num or 0ffh for unknown int num
964 ## r15 <------- RSP, RBP
971 movl 16*8(%ebp),%eax ## move Int number into RAX
974 ja PrintDefaultString
975 PrintExceptionString:
976 shll $3,%eax ## multiply by 8 to get offset from StringTable to actual string address
977 addl StringTable, %eax
981 movl IntUnknownString, %esi
995 movl 19*8(%ebp),%eax # CS
1001 movl 18*8(%ebp),%eax # RIP
1008 movl StringRax, %esi
1011 movl 15*8(%ebp),%eax
1014 movl StringRcx, %esi
1017 movl 14*8(%ebp),%eax
1020 movl StringRdx, %esi
1023 movl 13*8(%ebp),%eax
1028 movl StringRbx, %esi
1031 movl 12*8(%ebp),%eax
1034 movl StringRsp, %esi
1037 movl 21*8(%ebp),%eax
1040 movl StringRbp, %esi
1043 movl 10*8(%ebp),%eax
1048 movl StringRsi, %esi
1054 movl StringRdi, %esi
1060 movl StringEcode, %esi
1063 movl 17*8(%ebp),%eax
1080 movl StringR10, %esi
1088 movl StringR11, %esi
1094 movl StringR12, %esi
1100 movl StringR13, %esi
1108 movl StringR14, %esi
1114 movl StringR15, %esi
1123 movl 22*8(%ebp),%eax
1128 movl StringRflags, %esi
1131 movl 20*8(%ebp),%eax
1166 movl 18*8(%ebp),%eax # RIP
1169 movl %eax,%esi # esi = rip - 8 QWORD linear (total 16 QWORD)
1241 # add esp, 16 ; error code and INT number
1263 ## RAX contains qword to print
1264 ## RDI contains memory location (screen location) to print it to
1323 String1: .asciz "*** INT "
1325 Int0String: .asciz "00h Divide by 0 -"
1326 Int1String: .asciz "01h Debug exception -"
1327 Int2String: .asciz "02h NMI -"
1328 Int3String: .asciz "03h Breakpoint -"
1329 Int4String: .asciz "04h Overflow -"
1330 Int5String: .asciz "05h Bound -"
1331 Int6String: .asciz "06h Invalid opcode -"
1332 Int7String: .asciz "07h Device not available -"
1333 Int8String: .asciz "08h Double fault -"
1334 Int9String: .asciz "09h Coprocessor seg overrun (reserved) -"
1335 Int10String: .asciz "0Ah Invalid TSS -"
1336 Int11String: .asciz "0Bh Segment not present -"
1337 Int12String: .asciz "0Ch Stack fault -"
1338 Int13String: .asciz "0Dh General protection fault -"
1339 Int14String: .asciz "0Eh Page fault -"
1340 Int15String: .asciz "0Fh (Intel reserved) -"
1341 Int16String: .asciz "10h Floating point error -"
1342 Int17String: .asciz "11h Alignment check -"
1343 Int18String: .asciz "12h Machine check -"
1344 Int19String: .asciz "13h SIMD Floating-Point Exception -"
1345 IntUnknownString: .asciz "??h Unknown interrupt -"
1347 StringTable: .long Int0String, Int1String, Int2String, Int3String, \
1348 Int4String, Int5String, Int6String, Int7String, \
1349 Int8String, Int9String, Int10String, Int11String, \
1350 Int12String, Int13String, Int14String, Int15String,\
1351 Int16String, Int17String, Int18String, Int19String
1353 String2: .asciz " HALT!! *** ("
1355 StringRax: .asciz "RAX="
1356 StringRcx: .asciz " RCX="
1357 StringRdx: .asciz " RDX="
1358 StringRbx: .asciz "RBX="
1359 StringRsp: .asciz " RSP="
1360 StringRbp: .asciz " RBP="
1361 StringRsi: .asciz "RSI="
1362 StringRdi: .asciz " RDI="
1363 StringEcode: .asciz " ECODE="
1364 StringR8: .asciz "R8 ="
1365 StringR9: .asciz " R9 ="
1366 StringR10: .asciz " R10="
1367 StringR11: .asciz "R11="
1368 StringR12: .asciz " R12="
1369 StringR13: .asciz " R13="
1370 StringR14: .asciz "R14="
1371 StringR15: .asciz " R15="
1372 StringSs: .asciz " SS ="
1373 StringRflags: .asciz "RFLAGS="