MASM中的名称修改(ML64)不一致

时间:2017-06-12 20:44:56

标签: masm

使用以下文件并使用Microsoft汇编程序ML64(v14.00.2410.0,VS 2015附带),汇编程序通过添加下划线来修改第一个例程(asm_cli)的名称,但它没有mangle第二个例程的名称(asm_diable_vm)。为什么?列表文件不显示名称mangling,但.OBJ文件中的LINK / DUMP显示添加下划线。

LINK / DUMP的部分输出

RELOCATIONS #3
                                                Symbol    Symbol
 Offset    Type              Applied To         Index     Name
 --------  ----------------  -----------------  --------  ------
 00000070  SECREL                     00000000         C  $$000000
 00000074  SECTION                        0000         C  $$000000
 00000225  SECREL                     00000000         A  _asm_cli
 00000229  SECTION                        0000         A  _asm_cli
 00000259  SECREL                     00000000         B  asm_disable_vm
 0000025D  SECTION                        0000         B  asm_disable_vm

COFF SYMBOL TABLE
000 01035E92 ABS    notype       Static       | @comp.id
001 00000010 ABS    notype       Static       | @feat.00
002 00000000 SECT1  notype       Static       | .text$mn
    Section length   25, #relocs    0, #linenums    0, checksum        0
004 00000000 SECT2  notype       Static       | .data
    Section length    0, #relocs    0, #linenums    0, checksum        0
006 00000000 SECT3  notype       Static       | .debug$S
    Section length  274, #relocs    6, #linenums    0, checksum        0
008 00000000 SECT4  notype       Static       | .debug$T
    Section length   34, #relocs    0, #linenums    0, checksum        0
00A 00000000 SECT1  notype ()    External     | _asm_cli
00B 00000010 SECT1  notype ()    External     | asm_disable_vm
00C 00000000 SECT1  notype       Static       | $$000000

Assembly.asm

cr0_pg          EQU     80000000h               ; Paging bit. If set, enables paging (and uses CR3 as pointer to page tables)
cr4_pae         EQU     20H                     ; Physical Address Extension. If set, uses extended page table size

;
;   Declare an C-callable entry point
;

routine_start   MACRO Name, Section
Section SEGMENT PARA 'CODE'
    DB      6 DUP (0ccH)                        ; Padding required by the calling standard
    ALIGN   16

    PUBLIC  Name
Name    PROC FRAME
.ENDPROLOG
ENDM

;
;   Declare the end of a routine
;

routine_end MACRO Name, Section
Name    ENDP
Section ENDS
ENDM


routine_start   asm_cli, _TEXT

        CLI                                     ; Disable interrupts
        RET

routine_end     asm_cli, _TEXT



routine_start   asm_disable_vm, _TEXT

        ;
        ; Disable paging
        ;

        MOV         RAX, CR0                    ; Get the contents of control register 0
        AND         EAX, 7fffffffH              ; Clear the paging bit
        MOV         CR0, RAX                    ; Save back to the register

        ;
        ; Empty the Translation Look-aside Buffer (TLB) by clearing the address of the 
        ; first-level page table
        ;

        XOR         RAX, RAX                    ; Clear EAX
        MOV         CR3, RAX                    ; Clear Control Register 3

        ;
        ; Disable Physical Address Extension (PAE)
        ;

        MOV         RAX, CR4                    ; Get the contents of control register 4
        AND         AL, NOT cr4_pae             ; Clear the PAE bit
        MOV         CR4, RAX                    ; Save back to the register

        RET

routine_end     asm_disable_vm, _TEXT

END

0 个答案:

没有答案