Changeset 41792 in vbox
- Timestamp:
- Jun 16, 2012 11:41:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dis.h
r41791 r41792 529 529 /** 530 530 * The diassembler state and result. 531 *532 * @todo ModRM and SIB could be joined and 6 bytes would be saved, only it533 * doesn't make any sense right now because of structure alignment.534 531 */ 535 532 typedef struct DISSTATE 536 533 { 537 /* Because of pvUser2, put the less frequently used bits at the top for 538 now. (Might be better off in the middle?) */ 539 DISOPPARAM Param3; 540 DISOPPARAM Param2; 541 DISOPPARAM Param1; 542 543 /* off: 0x060 (96) */ 534 /** The number of valid bytes in abInstr. */ 535 uint8_t cbCachedInstr; 536 /** SIB fields. */ 537 union 538 { 539 /** Bitfield view */ 540 struct 541 { 542 uint8_t Base; 543 uint8_t Index; 544 uint8_t Scale; 545 } Bits; 546 } SIB; 544 547 /** ModRM fields. */ 545 548 union … … 548 551 struct 549 552 { 550 u nsigned Rm : 4;551 u nsigned Reg : 4;552 u nsigned Mod : 2;553 uint8_t Rm; 554 uint8_t Reg; 555 uint8_t Mod; 553 556 } Bits; 554 /** unsigned view */555 unsigned u;556 557 } ModRM; 557 /** SIB fields. */558 union559 {560 /** Bitfield view */561 struct562 {563 unsigned Base : 4;564 unsigned Index : 4;565 unsigned Scale : 2;566 } Bits;567 /** unsigned view */568 unsigned u;569 } SIB;570 /** SIB displacment. */571 int32_t i32SibDisp;572 573 /* off: 0x06c (108) */574 558 /** The CPU mode (DISCPUMODE). */ 575 559 uint8_t uCpuMode; … … 580 564 /** Per instruction prefix settings. */ 581 565 uint8_t fPrefix; 582 /* off: 0x070 (112) */583 566 /** REX prefix value (64 bits only). */ 584 567 uint8_t fRexPrefix; … … 589 572 /** First opcode byte of instruction. */ 590 573 uint8_t bOpCode; 591 /* off: 0x074 (116) */592 574 /** The size of the prefix bytes. */ 593 575 uint8_t cbPrefix; 594 576 /** The instruction size. */ 595 577 uint8_t cbInstr; 596 /** The number of valid bytes in abInstr. */ 597 uint8_t cbCachedInstr; 598 /** Unused byte. */ 599 uint8_t abUnused[1]; 600 /* off: 0x078 (120) */ 601 /** Return code set by a worker function like the opcode bytes readers. */ 602 int32_t rc; 578 /** Unused bytes. */ 579 uint8_t abUnused[3]; 603 580 /** Internal: instruction filter */ 604 581 uint32_t fFilter; 605 /* off: 0x080 (128) */606 582 /** Internal: pointer to disassembly function table */ 607 583 PCPFNDISPARSE pfnDisasmFnTable; … … 614 590 uint32_t uPtrPadding2; 615 591 #endif 616 /* off: 0x090 (144) */ 592 /** The instruction bytes. */ 593 uint8_t abInstr[16]; 594 /** SIB displacment. */ 595 int32_t i32SibDisp; 596 597 /** Return code set by a worker function like the opcode bytes readers. */ 598 int32_t rc; 617 599 /** The address of the instruction. */ 618 600 RTUINTPTR uInstrAddr; 619 /* off: 0x098 (152) */620 601 /** Optional read function */ 621 602 PFNDISREADBYTES pfnReadBytes; … … 623 604 uint32_t uPadding3; 624 605 #endif 625 /* off: 0x0a0 (160) */626 /** The instruction bytes. */627 uint8_t abInstr[16];628 /* off: 0x0b0 (176) */629 606 /** User data supplied as an argument to the APIs. */ 630 607 void *pvUser; … … 632 609 uint32_t uPadding4; 633 610 #endif 611 /** Parameters. */ 612 DISOPPARAM Param1; 613 DISOPPARAM Param2; 614 DISOPPARAM Param3; 634 615 } DISSTATE; 616 AssertCompileSize(DISSTATE, 0xb8); 635 617 636 618 /** @deprecated Use DISSTATE and change Cpu and DisState to Dis. */ -
trunk/src/VBox/Disassembler/DisasmFormatYasm.cpp
r41790 r41792 500 500 Assert(pDis->cbInstr >= 3); 501 501 PUT_SZ("db 00fh, 01fh,"); 502 PUT_NUM_8( pDis->ModRM.u);502 PUT_NUM_8(MAKE_MODRM(pDis->ModRM.Bits.Mod, pDis->ModRM.Bits.Reg, pDis->ModRM.Bits.Rm)); 503 503 for (unsigned i = 3; i < pDis->cbInstr; i++) 504 504 {
Note:
See TracChangeset
for help on using the changeset viewer.