3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. 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.
24 // Debugger Disasm definition
26 #define EDB_DISASM_DEFINE(func) \
29 IN EFI_PHYSICAL_ADDRESS InstructionAddress, \
30 IN EFI_SYSTEM_CONTEXT SystemContext, \
31 OUT CHAR16 **DisasmString \
34 EDB_DISASM_DEFINE (EdbDisasmBREAK
);
35 EDB_DISASM_DEFINE (EdbDisasmJMP
);
36 EDB_DISASM_DEFINE (EdbDisasmJMP8
);
37 EDB_DISASM_DEFINE (EdbDisasmCALL
);
38 EDB_DISASM_DEFINE (EdbDisasmRET
);
39 EDB_DISASM_DEFINE (EdbDisasmCMP
);
40 EDB_DISASM_DEFINE (EdbDisasmUnsignedDataManip
);
41 EDB_DISASM_DEFINE (EdbDisasmSignedDataManip
);
42 EDB_DISASM_DEFINE (EdbDisasmMOVxx
);
43 EDB_DISASM_DEFINE (EdbDisasmMOVsnw
);
44 EDB_DISASM_DEFINE (EdbDisasmMOVsnd
);
45 EDB_DISASM_DEFINE (EdbDisasmLOADSP
);
46 EDB_DISASM_DEFINE (EdbDisasmSTORESP
);
47 EDB_DISASM_DEFINE (EdbDisasmPUSH
);
48 EDB_DISASM_DEFINE (EdbDisasmPOP
);
49 EDB_DISASM_DEFINE (EdbDisasmCMPI
);
50 EDB_DISASM_DEFINE (EdbDisasmPUSHn
);
51 EDB_DISASM_DEFINE (EdbDisasmPOPn
);
52 EDB_DISASM_DEFINE (EdbDisasmMOVI
);
53 EDB_DISASM_DEFINE (EdbDisasmMOVIn
);
54 EDB_DISASM_DEFINE (EdbDisasmMOVREL
);
57 // Debugger Disasm Table
59 EDB_DISASM_INSTRUCTION mEdbDisasmInstructionTable
[] = {
60 EdbDisasmBREAK
, // opcode 0x00 BREAK
61 EdbDisasmJMP
, // opcode 0x01 JMP
62 EdbDisasmJMP8
, // opcode 0x02 JMP8
63 EdbDisasmCALL
, // opcode 0x03 CALL
64 EdbDisasmRET
, // opcode 0x04 RET
65 EdbDisasmCMP
, // opcode 0x05 CMPEQ
66 EdbDisasmCMP
, // opcode 0x06 CMPLTE
67 EdbDisasmCMP
, // opcode 0x07 CMPGTE
68 EdbDisasmCMP
, // opcode 0x08 CMPULTE
69 EdbDisasmCMP
, // opcode 0x09 CMPUGTE
70 EdbDisasmUnsignedDataManip
, // opcode 0x0A NOT
71 EdbDisasmSignedDataManip
, // opcode 0x0B NEG
72 EdbDisasmSignedDataManip
, // opcode 0x0C ADD
73 EdbDisasmSignedDataManip
, // opcode 0x0D SUB
74 EdbDisasmSignedDataManip
, // opcode 0x0E MUL
75 EdbDisasmUnsignedDataManip
, // opcode 0x0F MULU
76 EdbDisasmSignedDataManip
, // opcode 0x10 DIV
77 EdbDisasmUnsignedDataManip
, // opcode 0x11 DIVU
78 EdbDisasmSignedDataManip
, // opcode 0x12 MOD
79 EdbDisasmUnsignedDataManip
, // opcode 0x13 MODU
80 EdbDisasmUnsignedDataManip
, // opcode 0x14 AND
81 EdbDisasmUnsignedDataManip
, // opcode 0x15 OR
82 EdbDisasmUnsignedDataManip
, // opcode 0x16 XOR
83 EdbDisasmUnsignedDataManip
, // opcode 0x17 SHL
84 EdbDisasmUnsignedDataManip
, // opcode 0x18 SHR
85 EdbDisasmSignedDataManip
, // opcode 0x19 ASHR
86 EdbDisasmUnsignedDataManip
, // opcode 0x1A EXTNDB
87 EdbDisasmUnsignedDataManip
, // opcode 0x1B EXTNDW
88 EdbDisasmUnsignedDataManip
, // opcode 0x1C EXTNDD
89 EdbDisasmMOVxx
, // opcode 0x1D MOVBW
90 EdbDisasmMOVxx
, // opcode 0x1E MOVWW
91 EdbDisasmMOVxx
, // opcode 0x1F MOVDW
92 EdbDisasmMOVxx
, // opcode 0x20 MOVQW
93 EdbDisasmMOVxx
, // opcode 0x21 MOVBD
94 EdbDisasmMOVxx
, // opcode 0x22 MOVWD
95 EdbDisasmMOVxx
, // opcode 0x23 MOVDD
96 EdbDisasmMOVxx
, // opcode 0x24 MOVQD
97 EdbDisasmMOVsnw
, // opcode 0x25 MOVSNW
98 EdbDisasmMOVsnd
, // opcode 0x26 MOVSND
100 EdbDisasmMOVxx
, // opcode 0x28 MOVQQ
101 EdbDisasmLOADSP
, // opcode 0x29 LOADSP
102 EdbDisasmSTORESP
, // opcode 0x2A STORESP
103 EdbDisasmPUSH
, // opcode 0x2B PUSH
104 EdbDisasmPOP
, // opcode 0x2C POP
105 EdbDisasmCMPI
, // opcode 0x2D CMPIEQ
106 EdbDisasmCMPI
, // opcode 0x2E CMPILTE
107 EdbDisasmCMPI
, // opcode 0x2F CMPIGTE
108 EdbDisasmCMPI
, // opcode 0x30 CMPIULTE
109 EdbDisasmCMPI
, // opcode 0x31 CMPIUGTE
110 EdbDisasmMOVxx
, // opcode 0x32 MOVNW
111 EdbDisasmMOVxx
, // opcode 0x33 MOVND
113 EdbDisasmPUSHn
, // opcode 0x35 PUSHN
114 EdbDisasmPOPn
, // opcode 0x36 POPN
115 EdbDisasmMOVI
, // opcode 0x37 MOVI
116 EdbDisasmMOVIn
, // opcode 0x38 MOVIN
117 EdbDisasmMOVREL
, // opcode 0x39 MOVREL
122 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
123 IN EFI_SYSTEM_CONTEXT SystemContext
,
124 OUT CHAR16
**DisasmString
130 Disasm instruction - BREAK
134 InstructionAddress - The instruction address
135 SystemContext - EBC system context.
136 DisasmString - The instruction string
144 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_BREAK
);
146 if (*(UINT8
*)(UINTN
)(InstructionAddress
+ 1) > 6) {
151 // Construct Disasm String
153 if (DisasmString
!= NULL
) {
154 *DisasmString
= EdbPreInstructionString ();
156 EdbPrintInstructionName (L
"BREAK");
157 EdbPrintDatan (*(UINT8
*)(UINTN
)(InstructionAddress
+ 1));
159 EdbPostInstructionString ();
165 extern CONST UINT8 mJMPLen
[];
169 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
170 IN EFI_SYSTEM_CONTEXT SystemContext
,
171 OUT CHAR16
**DisasmString
177 Disasm instruction - JMP
181 InstructionAddress - The instruction address
182 SystemContext - EBC system context.
183 DisasmString - The instruction string
197 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_JMP
);
199 Modifiers
= GET_MODIFIERS (InstructionAddress
);
200 Operands
= GET_OPERANDS (InstructionAddress
);
201 Size
= (UINTN
)mJMPLen
[(Modifiers
>> 6) & 0x03];
204 // Construct Disasm String
206 if (DisasmString
!= NULL
) {
207 *DisasmString
= EdbPreInstructionString ();
209 EdbPrintInstructionName (L
"JMP");
210 // if (Modifiers & OPCODE_M_IMMDATA64) {
211 // EdbPrintInstructionName (L"64");
213 // EdbPrintInstructionName (L"32");
215 if (Modifiers
& CONDITION_M_CONDITIONAL
) {
216 if (Modifiers
& JMP_M_CS
) {
217 EdbPrintInstructionName (L
"cs");
219 EdbPrintInstructionName (L
"cc");
223 InstructionAddress
+= 2;
224 if (Modifiers
& OPCODE_M_IMMDATA64
) {
225 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
226 if (Modifiers
& OPCODE_M_IMMDATA
) {
227 EdbPrintData64 (Data64
);
232 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
233 EdbPrintRegister1 (Operands
);
235 if ((Operands
& OPERAND_M_INDIRECT1
) == 0) {
236 if ((Modifiers
& OPCODE_M_IMMDATA
) == 0) {
239 EdbPrintImmDatan (Data32
);
241 EdbPrintRawIndexData32 (Data32
);
245 EdbPostInstructionString ();
253 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
254 IN EFI_SYSTEM_CONTEXT SystemContext
,
255 OUT CHAR16
**DisasmString
261 Disasm instruction - JMP8
265 InstructionAddress - The instruction address
266 SystemContext - EBC system context.
267 DisasmString - The instruction string
277 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_JMP8
);
278 Modifiers
= GET_MODIFIERS (InstructionAddress
);
281 // Construct Disasm String
283 if (DisasmString
!= NULL
) {
284 *DisasmString
= EdbPreInstructionString ();
286 EdbPrintInstructionName (L
"JMP8");
287 if (Modifiers
& CONDITION_M_CONDITIONAL
) {
288 if (Modifiers
& JMP_M_CS
) {
289 EdbPrintInstructionName (L
"cs");
291 EdbPrintInstructionName (L
"cc");
295 EdbPrintData8 (*(UINT8
*)(UINTN
)(InstructionAddress
+ 1));
297 EdbPostInstructionString ();
305 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
306 IN EFI_SYSTEM_CONTEXT SystemContext
,
307 OUT CHAR16
**DisasmString
313 Disasm instruction - CALL
317 InstructionAddress - The instruction address
318 SystemContext - EBC system context.
319 DisasmString - The instruction string
334 EFI_PHYSICAL_ADDRESS SavedInstructionAddress
;
336 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_CALL
);
337 SavedInstructionAddress
= InstructionAddress
;
339 Modifiers
= GET_MODIFIERS (InstructionAddress
);
340 Operands
= GET_OPERANDS (InstructionAddress
);
341 Size
= (UINTN
)mJMPLen
[(Modifiers
>> 6) & 0x03];
344 // Construct Disasm String
346 if (DisasmString
!= NULL
) {
347 *DisasmString
= EdbPreInstructionString ();
349 EdbPrintInstructionName (L
"CALL");
350 // if (Modifiers & OPCODE_M_IMMDATA64) {
351 // EdbPrintInstructionName (L"64");
353 // EdbPrintInstructionName (L"32");
355 if (Operands
& OPERAND_M_NATIVE_CALL
) {
356 EdbPrintInstructionName (L
"EX");
358 // if ((Operands & OPERAND_M_RELATIVE_ADDR) == 0) {
359 // EdbPrintInstructionName (L"a");
362 InstructionAddress
+= 2;
363 if (Modifiers
& OPCODE_M_IMMDATA64
) {
364 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
366 if (Modifiers
& OPCODE_M_IMMDATA
) {
367 Result
= EdbFindAndPrintSymbol ((UINTN
)Ip
);
369 EdbPrintData64 (Data64
);
375 if (Modifiers
& OPCODE_M_IMMDATA
) {
376 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
381 if ((Operands
& OPERAND_M_OP1
) == 0) {
384 Ip
= GetRegisterValue (SystemContext
, (Operands
& OPERAND_M_OP1
));
387 if ((Operands
& OPERAND_M_INDIRECT1
) == 0) {
388 if (Operands
& OPERAND_M_RELATIVE_ADDR
) {
389 Result
= EdbFindAndPrintSymbol ((UINTN
)(SavedInstructionAddress
+ Ip
+ Size
));
391 Result
= EdbFindAndPrintSymbol ((UINTN
)Ip
);
394 EdbPrintRegister1 (Operands
);
395 if (Modifiers
& OPCODE_M_IMMDATA
) {
396 EdbPrintImmData32 (Data32
);
400 EdbPrintRegister1 (Operands
);
401 if (Modifiers
& OPCODE_M_IMMDATA
) {
402 EdbPrintRawIndexData32 (Data32
);
407 EdbPostInstructionString ();
415 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
416 IN EFI_SYSTEM_CONTEXT SystemContext
,
417 OUT CHAR16
**DisasmString
423 Disasm instruction - RET
427 InstructionAddress - The instruction address
428 SystemContext - EBC system context.
429 DisasmString - The instruction string
437 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_RET
);
439 if (*(UINT8
*)(UINTN
)(InstructionAddress
+ 1) != 0) {
444 // Construct Disasm String
446 if (DisasmString
!= NULL
) {
447 *DisasmString
= EdbPreInstructionString ();
449 EdbPrintInstructionName (L
"RET");
451 EdbPostInstructionString ();
459 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
460 IN EFI_SYSTEM_CONTEXT SystemContext
,
461 OUT CHAR16
**DisasmString
467 Disasm instruction - CMP
471 InstructionAddress - The instruction address
472 SystemContext - EBC system context.
473 DisasmString - The instruction string
488 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPEQ
) ||
489 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPLTE
) ||
490 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPGTE
) ||
491 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPULTE
) ||
492 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPUGTE
)
495 Opcode
= GET_OPCODE (InstructionAddress
);
496 Modifiers
= GET_MODIFIERS (InstructionAddress
);
497 Operands
= GET_OPERANDS (InstructionAddress
);
498 if (Modifiers
& OPCODE_M_IMMDATA
) {
505 // Construct Disasm String
507 if (DisasmString
!= NULL
) {
508 *DisasmString
= EdbPreInstructionString ();
510 EdbPrintInstructionName (L
"CMP");
511 // if (Modifiers & OPCODE_M_64BIT) {
512 // EdbPrintInstructionName (L"64");
514 // EdbPrintInstructionName (L"32");
518 EdbPrintInstructionName (L
"eq");
521 EdbPrintInstructionName (L
"lte");
524 EdbPrintInstructionName (L
"gte");
527 EdbPrintInstructionName (L
"ulte");
530 EdbPrintInstructionName (L
"ugte");
534 EdbPrintRegister1 (Operands
);
535 InstructionAddress
+= 2;
538 EdbPrintRegister2 (Operands
);
540 if (Modifiers
& OPCODE_M_IMMDATA
) {
541 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
542 if (Operands
& OPERAND_M_INDIRECT2
) {
543 EdbPrintRawIndexData16 (Data16
);
545 EdbPrintImmDatan (Data16
);
549 EdbPostInstructionString ();
556 EdbDisasmUnsignedDataManip (
557 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
558 IN EFI_SYSTEM_CONTEXT SystemContext
,
559 OUT CHAR16
**DisasmString
565 Disasm instruction - Unsigned Data Manipulate
569 InstructionAddress - The instruction address
570 SystemContext - EBC system context.
571 DisasmString - The instruction string
586 (GET_OPCODE(InstructionAddress
) == OPCODE_NOT
) ||
587 (GET_OPCODE(InstructionAddress
) == OPCODE_MULU
) ||
588 (GET_OPCODE(InstructionAddress
) == OPCODE_DIVU
) ||
589 (GET_OPCODE(InstructionAddress
) == OPCODE_MODU
) ||
590 (GET_OPCODE(InstructionAddress
) == OPCODE_AND
) ||
591 (GET_OPCODE(InstructionAddress
) == OPCODE_OR
) ||
592 (GET_OPCODE(InstructionAddress
) == OPCODE_XOR
) ||
593 (GET_OPCODE(InstructionAddress
) == OPCODE_SHL
) ||
594 (GET_OPCODE(InstructionAddress
) == OPCODE_SHR
) ||
595 (GET_OPCODE(InstructionAddress
) == OPCODE_EXTNDB
) ||
596 (GET_OPCODE(InstructionAddress
) == OPCODE_EXTNDW
) ||
597 (GET_OPCODE(InstructionAddress
) == OPCODE_EXTNDD
)
600 Opcode
= GET_OPCODE (InstructionAddress
);
601 Operands
= GET_OPERANDS (InstructionAddress
);
602 Modifiers
= GET_MODIFIERS (InstructionAddress
);
603 if (Modifiers
& DATAMANIP_M_IMMDATA
) {
610 // Construct Disasm String
612 if (DisasmString
!= NULL
) {
613 *DisasmString
= EdbPreInstructionString ();
617 EdbPrintInstructionName (L
"NOT");
620 EdbPrintInstructionName (L
"MULU");
623 EdbPrintInstructionName (L
"DIVU");
626 EdbPrintInstructionName (L
"MODU");
629 EdbPrintInstructionName (L
"AND");
632 EdbPrintInstructionName (L
"OR");
635 EdbPrintInstructionName (L
"XOR");
638 EdbPrintInstructionName (L
"SHL");
641 EdbPrintInstructionName (L
"SHR");
644 EdbPrintInstructionName (L
"EXTNDB");
647 EdbPrintInstructionName (L
"EXTNDW");
650 EdbPrintInstructionName (L
"EXTNDD");
653 // if (Modifiers & DATAMANIP_M_64) {
654 // EdbPrintInstructionName (L"64");
656 // EdbPrintInstructionName (L"32");
659 EdbPrintRegister1 (Operands
);
661 EdbPrintRegister2 (Operands
);
663 InstructionAddress
+= 2;
664 if (Modifiers
& DATAMANIP_M_IMMDATA
) {
665 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
666 if (Operands
& OPERAND_M_INDIRECT2
) {
667 EdbPrintRawIndexData16 (Data16
);
669 EdbPrintImmDatan (Data16
);
673 EdbPostInstructionString ();
680 EdbDisasmSignedDataManip (
681 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
682 IN EFI_SYSTEM_CONTEXT SystemContext
,
683 OUT CHAR16
**DisasmString
689 Disasm instruction - Signed Data Manipulate
693 InstructionAddress - The instruction address
694 SystemContext - EBC system context.
695 DisasmString - The instruction string
710 (GET_OPCODE(InstructionAddress
) == OPCODE_NEG
) ||
711 (GET_OPCODE(InstructionAddress
) == OPCODE_ADD
) ||
712 (GET_OPCODE(InstructionAddress
) == OPCODE_SUB
) ||
713 (GET_OPCODE(InstructionAddress
) == OPCODE_MUL
) ||
714 (GET_OPCODE(InstructionAddress
) == OPCODE_DIV
) ||
715 (GET_OPCODE(InstructionAddress
) == OPCODE_MOD
) ||
716 (GET_OPCODE(InstructionAddress
) == OPCODE_ASHR
)
719 Opcode
= GET_OPCODE (InstructionAddress
);
720 Operands
= GET_OPERANDS (InstructionAddress
);
721 Modifiers
= GET_MODIFIERS (InstructionAddress
);
722 if (Modifiers
& DATAMANIP_M_IMMDATA
) {
729 // Construct Disasm String
731 if (DisasmString
!= NULL
) {
732 *DisasmString
= EdbPreInstructionString ();
736 EdbPrintInstructionName (L
"NEG");
739 EdbPrintInstructionName (L
"ADD");
742 EdbPrintInstructionName (L
"SUB");
745 EdbPrintInstructionName (L
"MUL");
748 EdbPrintInstructionName (L
"DIV");
751 EdbPrintInstructionName (L
"MOD");
754 EdbPrintInstructionName (L
"ASHR");
757 // if (Modifiers & DATAMANIP_M_64) {
758 // EdbPrintInstructionName (L"64");
760 // EdbPrintInstructionName (L"32");
763 EdbPrintRegister1 (Operands
);
765 EdbPrintRegister2 (Operands
);
767 InstructionAddress
+= 2;
768 if (Modifiers
& DATAMANIP_M_IMMDATA
) {
769 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
770 if (Operands
& OPERAND_M_INDIRECT2
) {
771 EdbPrintRawIndexData16 (Data16
);
773 EdbPrintImmDatan (Data16
);
777 EdbPostInstructionString ();
785 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
786 IN EFI_SYSTEM_CONTEXT SystemContext
,
787 OUT CHAR16
**DisasmString
793 Disasm instruction - MOVxx
797 InstructionAddress - The instruction address
798 SystemContext - EBC system context.
799 DisasmString - The instruction string
816 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVBW
) ||
817 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVWW
) ||
818 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVDW
) ||
819 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVQW
) ||
820 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVBD
) ||
821 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVWD
) ||
822 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVDD
) ||
823 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVQD
) ||
824 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVQQ
) ||
825 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVNW
) ||
826 (GET_OPCODE(InstructionAddress
) == OPCODE_MOVND
)
829 Opcode
= GET_OPCODE (InstructionAddress
);
830 Modifiers
= GET_MODIFIERS (InstructionAddress
);
831 Operands
= GET_OPERANDS (InstructionAddress
);
833 if (Modifiers
& (OPCODE_M_IMMED_OP1
| OPCODE_M_IMMED_OP2
)) {
834 if ((Opcode
<= OPCODE_MOVQW
) || (Opcode
== OPCODE_MOVNW
)) {
835 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
838 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
841 } else if ((Opcode
<= OPCODE_MOVQD
) || (Opcode
== OPCODE_MOVND
)) {
842 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
845 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
848 } else if (Opcode
== OPCODE_MOVQQ
) {
849 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
852 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
859 // Construct Disasm String
861 if (DisasmString
!= NULL
) {
862 *DisasmString
= EdbPreInstructionString ();
864 EdbPrintInstructionName (L
"MOV");
867 EdbPrintInstructionName (L
"bw");
870 EdbPrintInstructionName (L
"ww");
873 EdbPrintInstructionName (L
"dw");
876 EdbPrintInstructionName (L
"qw");
879 EdbPrintInstructionName (L
"bd");
882 EdbPrintInstructionName (L
"wd");
885 EdbPrintInstructionName (L
"dd");
888 EdbPrintInstructionName (L
"qd");
891 EdbPrintInstructionName (L
"qq");
894 EdbPrintInstructionName (L
"nw");
897 EdbPrintInstructionName (L
"nd");
901 EdbPrintRegister1 (Operands
);
903 InstructionAddress
+= 2;
904 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
905 if ((Opcode
<= OPCODE_MOVQW
) || (Opcode
== OPCODE_MOVNW
)) {
906 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
907 InstructionAddress
+= 2;
908 EdbPrintRawIndexData16 (Data16
);
909 } else if ((Opcode
<= OPCODE_MOVQD
) || (Opcode
== OPCODE_MOVND
)) {
910 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
911 InstructionAddress
+= 4;
912 EdbPrintRawIndexData32 (Data32
);
913 } else if (Opcode
== OPCODE_MOVQQ
) {
914 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
915 InstructionAddress
+= 8;
916 EdbPrintRawIndexData64 (Data64
);
921 EdbPrintRegister2 (Operands
);
923 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
924 if ((Opcode
<= OPCODE_MOVQW
) || (Opcode
== OPCODE_MOVNW
)) {
925 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
926 EdbPrintRawIndexData16 (Data16
);
927 } else if ((Opcode
<= OPCODE_MOVQD
) || (Opcode
== OPCODE_MOVND
)) {
928 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
929 EdbPrintRawIndexData32 (Data32
);
930 } else if (Opcode
== OPCODE_MOVQQ
) {
931 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
932 EdbPrintRawIndexData64 (Data64
);
936 EdbPostInstructionString ();
944 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
945 IN EFI_SYSTEM_CONTEXT SystemContext
,
946 OUT CHAR16
**DisasmString
952 Disasm instruction - MOVsnw
956 InstructionAddress - The instruction address
957 SystemContext - EBC system context.
958 DisasmString - The instruction string
971 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_MOVSNW
);
973 Modifiers
= GET_MODIFIERS (InstructionAddress
);
974 Operands
= GET_OPERANDS (InstructionAddress
);
976 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
979 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
984 // Construct Disasm String
986 if (DisasmString
!= NULL
) {
987 *DisasmString
= EdbPreInstructionString ();
989 EdbPrintInstructionName (L
"MOVsnw");
991 EdbPrintRegister1 (Operands
);
993 InstructionAddress
+= 2;
994 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
995 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
996 InstructionAddress
+= 2;
997 EdbPrintRawIndexData16 (Data16
);
1001 EdbPrintRegister2 (Operands
);
1003 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
1004 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1005 if (Operands
& OPERAND_M_INDIRECT2
) {
1006 EdbPrintRawIndexData16 (Data16
);
1008 EdbPrintImmDatan (Data16
);
1012 EdbPostInstructionString ();
1020 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1021 IN EFI_SYSTEM_CONTEXT SystemContext
,
1022 OUT CHAR16
**DisasmString
1026 Routine Description:
1028 Disasm instruction - MOVsnd
1032 InstructionAddress - The instruction address
1033 SystemContext - EBC system context.
1034 DisasmString - The instruction string
1047 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_MOVSND
);
1049 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1050 Operands
= GET_OPERANDS (InstructionAddress
);
1052 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
1055 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
1060 // Construct Disasm String
1062 if (DisasmString
!= NULL
) {
1063 *DisasmString
= EdbPreInstructionString ();
1065 EdbPrintInstructionName (L
"MOVsnd");
1067 EdbPrintRegister1 (Operands
);
1069 InstructionAddress
+= 2;
1070 if (Modifiers
& OPCODE_M_IMMED_OP1
) {
1071 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1072 InstructionAddress
+= 4;
1073 EdbPrintRawIndexData32 (Data32
);
1077 EdbPrintRegister2 (Operands
);
1079 if (Modifiers
& OPCODE_M_IMMED_OP2
) {
1080 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1081 if (Operands
& OPERAND_M_INDIRECT2
) {
1082 EdbPrintRawIndexData32 (Data32
);
1084 EdbPrintImmDatan (Data32
);
1088 EdbPostInstructionString ();
1096 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1097 IN EFI_SYSTEM_CONTEXT SystemContext
,
1098 OUT CHAR16
**DisasmString
1102 Routine Description:
1104 Disasm instruction - LOADSP
1108 InstructionAddress - The instruction address
1109 SystemContext - EBC system context.
1110 DisasmString - The instruction string
1120 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_LOADSP
);
1122 Operands
= GET_OPERANDS (InstructionAddress
);
1125 // Construct Disasm String
1127 if (DisasmString
!= NULL
) {
1128 *DisasmString
= EdbPreInstructionString ();
1130 EdbPrintInstructionName (L
"LOADSP");
1132 EdbPrintDedicatedRegister1 (Operands
);
1134 EdbPrintRegister2 (Operands
);
1136 EdbPostInstructionString ();
1144 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1145 IN EFI_SYSTEM_CONTEXT SystemContext
,
1146 OUT CHAR16
**DisasmString
1150 Routine Description:
1152 Disasm instruction - STORESP
1156 InstructionAddress - The instruction address
1157 SystemContext - EBC system context.
1158 DisasmString - The instruction string
1168 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_STORESP
);
1170 Operands
= GET_OPERANDS (InstructionAddress
);
1173 // Construct Disasm String
1175 if (DisasmString
!= NULL
) {
1176 *DisasmString
= EdbPreInstructionString ();
1178 EdbPrintInstructionName (L
"STORESP");
1180 EdbPrintRegister1 (Operands
);
1182 EdbPrintDedicatedRegister2 (Operands
);
1184 EdbPostInstructionString ();
1192 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1193 IN EFI_SYSTEM_CONTEXT SystemContext
,
1194 OUT CHAR16
**DisasmString
1198 Routine Description:
1200 Disasm instruction - PUSH
1204 InstructionAddress - The instruction address
1205 SystemContext - EBC system context.
1206 DisasmString - The instruction string
1219 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_PUSH
);
1221 Operands
= GET_OPERANDS (InstructionAddress
);
1222 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1223 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1230 // Construct Disasm String
1232 if (DisasmString
!= NULL
) {
1233 *DisasmString
= EdbPreInstructionString ();
1235 EdbPrintInstructionName (L
"PUSH");
1236 // if (Modifiers & PUSHPOP_M_64) {
1237 // EdbPrintInstructionName (L"64");
1239 // EdbPrintInstructionName (L"32");
1242 EdbPrintRegister1 (Operands
);
1244 InstructionAddress
+= 2;
1245 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1246 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1247 if (Operands
& OPERAND_M_INDIRECT1
) {
1248 EdbPrintRawIndexData16 (Data16
);
1250 EdbPrintImmDatan (Data16
);
1254 EdbPostInstructionString ();
1262 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1263 IN EFI_SYSTEM_CONTEXT SystemContext
,
1264 OUT CHAR16
**DisasmString
1268 Routine Description:
1270 Disasm instruction - POP
1274 InstructionAddress - The instruction address
1275 SystemContext - EBC system context.
1276 DisasmString - The instruction string
1289 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_POP
);
1291 Operands
= GET_OPERANDS (InstructionAddress
);
1292 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1293 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1300 // Construct Disasm String
1302 if (DisasmString
!= NULL
) {
1303 *DisasmString
= EdbPreInstructionString ();
1305 EdbPrintInstructionName (L
"POP");
1306 // if (Modifiers & PUSHPOP_M_64) {
1307 // EdbPrintInstructionName (L"64");
1309 // EdbPrintInstructionName (L"32");
1312 EdbPrintRegister1 (Operands
);
1314 InstructionAddress
+= 2;
1315 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1316 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1317 if (Operands
& OPERAND_M_INDIRECT1
) {
1318 EdbPrintRawIndexData16 (Data16
);
1320 EdbPrintImmDatan (Data16
);
1324 EdbPostInstructionString ();
1332 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1333 IN EFI_SYSTEM_CONTEXT SystemContext
,
1334 OUT CHAR16
**DisasmString
1338 Routine Description:
1340 Disasm instruction - CMPI
1344 InstructionAddress - The instruction address
1345 SystemContext - EBC system context.
1346 DisasmString - The instruction string
1362 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPIEQ
) ||
1363 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPILTE
) ||
1364 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPIGTE
) ||
1365 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPIULTE
) ||
1366 (GET_OPCODE(InstructionAddress
) == OPCODE_CMPIUGTE
)
1369 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1370 Opcode
= GET_OPCODE (InstructionAddress
);
1371 Operands
= GET_OPERANDS (InstructionAddress
);
1373 if ((Operands
& 0xE0) != 0) {
1378 if (Operands
& OPERAND_M_CMPI_INDEX
) {
1381 if (Modifiers
& OPCODE_M_CMPI32_DATA
) {
1388 // Construct Disasm String
1390 if (DisasmString
!= NULL
) {
1391 *DisasmString
= EdbPreInstructionString ();
1393 EdbPrintInstructionName (L
"CMPI");
1394 // if (Modifiers & OPCODE_M_CMPI64) {
1395 // EdbPrintInstructionName (L"64");
1397 // EdbPrintInstructionName (L"32");
1399 if (Modifiers
& OPCODE_M_CMPI32_DATA
) {
1400 EdbPrintInstructionName (L
"d");
1402 EdbPrintInstructionName (L
"w");
1406 EdbPrintInstructionName (L
"eq");
1408 case OPCODE_CMPILTE
:
1409 EdbPrintInstructionName (L
"lte");
1411 case OPCODE_CMPIGTE
:
1412 EdbPrintInstructionName (L
"gte");
1414 case OPCODE_CMPIULTE
:
1415 EdbPrintInstructionName (L
"ulte");
1417 case OPCODE_CMPIUGTE
:
1418 EdbPrintInstructionName (L
"ugte");
1422 EdbPrintRegister1 (Operands
);
1424 InstructionAddress
+= 2;
1425 if (Operands
& OPERAND_M_CMPI_INDEX
) {
1426 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1427 InstructionAddress
+= 2;
1428 EdbPrintRawIndexData16 (Data16
);
1433 if (Modifiers
& OPCODE_M_CMPI32_DATA
) {
1434 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1435 EdbPrintDatan (Data32
);
1437 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1438 EdbPrintDatan (Data16
);
1441 EdbPostInstructionString ();
1449 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1450 IN EFI_SYSTEM_CONTEXT SystemContext
,
1451 OUT CHAR16
**DisasmString
1455 Routine Description:
1457 Disasm instruction - PUSHn
1461 InstructionAddress - The instruction address
1462 SystemContext - EBC system context.
1463 DisasmString - The instruction string
1476 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_PUSHN
);
1478 Operands
= GET_OPERANDS (InstructionAddress
);
1479 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1480 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1487 // Construct Disasm String
1489 if (DisasmString
!= NULL
) {
1490 *DisasmString
= EdbPreInstructionString ();
1492 EdbPrintInstructionName (L
"PUSHn");
1494 EdbPrintRegister1 (Operands
);
1496 InstructionAddress
+= 2;
1497 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1498 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1499 if (Operands
& OPERAND_M_INDIRECT1
) {
1500 EdbPrintRawIndexData16 (Data16
);
1502 EdbPrintImmDatan (Data16
);
1506 EdbPostInstructionString ();
1514 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1515 IN EFI_SYSTEM_CONTEXT SystemContext
,
1516 OUT CHAR16
**DisasmString
1520 Routine Description:
1522 Disasm instruction - POPn
1526 InstructionAddress - The instruction address
1527 SystemContext - EBC system context.
1528 DisasmString - The instruction string
1541 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_POPN
);
1543 Operands
= GET_OPERANDS (InstructionAddress
);
1544 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1545 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1552 // Construct Disasm String
1554 if (DisasmString
!= NULL
) {
1555 *DisasmString
= EdbPreInstructionString ();
1557 EdbPrintInstructionName (L
"POPn");
1559 EdbPrintRegister1 (Operands
);
1561 InstructionAddress
+= 2;
1562 if (Modifiers
& PUSHPOP_M_IMMDATA
) {
1563 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1564 if (Operands
& OPERAND_M_INDIRECT1
) {
1565 EdbPrintRawIndexData16 (Data16
);
1567 EdbPrintImmDatan (Data16
);
1571 EdbPostInstructionString ();
1579 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1580 IN EFI_SYSTEM_CONTEXT SystemContext
,
1581 OUT CHAR16
**DisasmString
1585 Routine Description:
1587 Disasm instruction - MOVI
1591 InstructionAddress - The instruction address
1592 SystemContext - EBC system context.
1593 DisasmString - The instruction string
1608 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_MOVI
);
1610 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1611 Operands
= GET_OPERANDS (InstructionAddress
);
1613 if (Operands
& MOVI_M_IMMDATA
) {
1618 if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH16
) {
1620 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH32
) {
1622 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH64
) {
1627 // Construct Disasm String
1629 if (DisasmString
!= NULL
) {
1630 *DisasmString
= EdbPreInstructionString ();
1632 EdbPrintInstructionName (L
"MOVI");
1633 switch (Operands
& MOVI_M_MOVEWIDTH
) {
1634 case MOVI_MOVEWIDTH8
:
1635 EdbPrintInstructionName (L
"b");
1637 case MOVI_MOVEWIDTH16
:
1638 EdbPrintInstructionName (L
"w");
1640 case MOVI_MOVEWIDTH32
:
1641 EdbPrintInstructionName (L
"d");
1643 case MOVI_MOVEWIDTH64
:
1644 EdbPrintInstructionName (L
"q");
1647 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1648 case MOVI_DATAWIDTH16
:
1649 EdbPrintInstructionName (L
"w");
1651 case MOVI_DATAWIDTH32
:
1652 EdbPrintInstructionName (L
"d");
1654 case MOVI_DATAWIDTH64
:
1655 EdbPrintInstructionName (L
"q");
1659 EdbPrintRegister1 (Operands
);
1661 InstructionAddress
+= 2;
1662 if (Operands
& MOVI_M_IMMDATA
) {
1663 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1664 InstructionAddress
+= 2;
1665 EdbPrintRawIndexData16 (Data16
);
1670 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1671 case MOVI_DATAWIDTH16
:
1672 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1673 EdbPrintDatan (Data16
);
1675 case MOVI_DATAWIDTH32
:
1676 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1677 EdbPrintDatan (Data32
);
1679 case MOVI_DATAWIDTH64
:
1680 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
1681 EdbPrintData64n (Data64
);
1685 EdbPostInstructionString ();
1693 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1694 IN EFI_SYSTEM_CONTEXT SystemContext
,
1695 OUT CHAR16
**DisasmString
1699 Routine Description:
1701 Disasm instruction - MOVIn
1705 InstructionAddress - The instruction address
1706 SystemContext - EBC system context.
1707 DisasmString - The instruction string
1722 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_MOVIN
);
1724 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1725 Operands
= GET_OPERANDS (InstructionAddress
);
1727 if (Operands
& MOVI_M_IMMDATA
) {
1732 if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH16
) {
1734 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH32
) {
1736 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH64
) {
1741 // Construct Disasm String
1743 if (DisasmString
!= NULL
) {
1744 *DisasmString
= EdbPreInstructionString ();
1746 EdbPrintInstructionName (L
"MOVIn");
1747 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1748 case MOVI_DATAWIDTH16
:
1749 EdbPrintInstructionName (L
"w");
1751 case MOVI_DATAWIDTH32
:
1752 EdbPrintInstructionName (L
"d");
1754 case MOVI_DATAWIDTH64
:
1755 EdbPrintInstructionName (L
"q");
1759 EdbPrintRegister1 (Operands
);
1761 InstructionAddress
+= 2;
1762 if (Operands
& MOVI_M_IMMDATA
) {
1763 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1764 InstructionAddress
+= 2;
1765 EdbPrintRawIndexData16 (Data16
);
1770 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1771 case MOVI_DATAWIDTH16
:
1772 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1773 EdbPrintRawIndexData16 (Data16
);
1775 case MOVI_DATAWIDTH32
:
1776 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1777 EdbPrintRawIndexData32 (Data32
);
1779 case MOVI_DATAWIDTH64
:
1780 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
1781 EdbPrintRawIndexData64 (Data64
);
1785 EdbPostInstructionString ();
1793 IN EFI_PHYSICAL_ADDRESS InstructionAddress
,
1794 IN EFI_SYSTEM_CONTEXT SystemContext
,
1795 OUT CHAR16
**DisasmString
1799 Routine Description:
1801 Disasm instruction - MOVREL
1805 InstructionAddress - The instruction address
1806 SystemContext - EBC system context.
1807 DisasmString - The instruction string
1822 EFI_PHYSICAL_ADDRESS SavedInstructionAddress
;
1824 ASSERT (GET_OPCODE(InstructionAddress
) == OPCODE_MOVREL
);
1825 SavedInstructionAddress
= InstructionAddress
;
1827 Modifiers
= GET_MODIFIERS (InstructionAddress
);
1828 Operands
= GET_OPERANDS (InstructionAddress
);
1830 if (Operands
& MOVI_M_IMMDATA
) {
1835 if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH16
) {
1837 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH32
) {
1839 } else if ((Modifiers
& MOVI_M_DATAWIDTH
) == MOVI_DATAWIDTH64
) {
1846 // Construct Disasm String
1848 if (DisasmString
!= NULL
) {
1849 *DisasmString
= EdbPreInstructionString ();
1851 EdbPrintInstructionName (L
"MOVrel");
1852 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1853 case MOVI_DATAWIDTH16
:
1854 EdbPrintInstructionName (L
"w");
1856 case MOVI_DATAWIDTH32
:
1857 EdbPrintInstructionName (L
"d");
1859 case MOVI_DATAWIDTH64
:
1860 EdbPrintInstructionName (L
"q");
1864 EdbPrintRegister1 (Operands
);
1866 InstructionAddress
+= 2;
1867 if (Operands
& MOVI_M_IMMDATA
) {
1868 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1869 InstructionAddress
+= 2;
1870 EdbPrintRawIndexData16 (Data16
);
1875 switch (Modifiers
& MOVI_M_DATAWIDTH
) {
1876 case MOVI_DATAWIDTH16
:
1877 CopyMem (&Data16
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT16
));
1878 Result
= EdbFindAndPrintSymbol ((UINTN
)(SavedInstructionAddress
+ Size
+ (INT16
)Data16
));
1880 EdbPrintData16 (Data16
);
1883 case MOVI_DATAWIDTH32
:
1884 CopyMem (&Data32
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT32
));
1885 Result
= EdbFindAndPrintSymbol ((UINTN
)(SavedInstructionAddress
+ Size
+ (INT32
)Data32
));
1887 EdbPrintData32 (Data32
);
1890 case MOVI_DATAWIDTH64
:
1891 CopyMem (&Data64
, (VOID
*)(UINTN
)(InstructionAddress
), sizeof(UINT64
));
1892 if (sizeof(UINTN
) == sizeof(UINT64
)) {
1893 Result
= EdbFindAndPrintSymbol ((UINTN
)(SavedInstructionAddress
+ Size
+ (INT64
)Data64
));
1898 EdbPrintData64 (Data64
);
1903 EdbPostInstructionString ();