027.列表文件与汇编语言程序的比较

列表文件以list为为结尾,是汇编语言编译器生成的一个汇编语言与机器指令一一对应的列表,表示一个汇编语言源文件是如何对应到机器指令的。在VS中生成list文件的方式如下。右键项目->属性->Microsoft Macro Assembler。将generatepreprocessedsourcelisting,以及listallavailiableinformation下拉框选择为“是”,点击应用保存,重新汇编你的源代码。在工程文件的根目录下就会看到list文件。下面举例说明 。
Microsoft (R) Macro Assembler Version 14.25.28610.4	    05/23/20 11:51:58
main.asm						     			Page 1 - 1


												; Operators (Operator.asm)

												; Demonstrates the TYPE, LENGTHOF, and SIZEOF operators
	
												.386
												.model flat,stdcall
												.stack 4096
												ExitProcess PROTO, dwExitCode:dword

 00000000										.data
 00000000 0A 14 1E								byte1    BYTE  10,20,30
 00000003  0000001E [							array1   WORD  30 DUP(?),0,0
	    0000
	   ] 0000 0000
 00000043  00000005 [							array2   WORD  5 DUP(3 DUP(?))
	    00000003 [
	     0000
	    ]
	   ]
 00000061 00000001								array3   DWORD 1,2,3,4
	   00000002
	   00000003
	   00000004
 00000071 31 32 33 34 35						digitStr BYTE  '12345678',0
	   36 37 38 00
 0000007A 0A 14 1E 28 32						myArray  BYTE  10,20,30,40,50,
	   3C 46 50 5A 64
				              					60,70,80,90,100

												; You can examine the following constant values
												; by looking in the listing file (Operator.lst):
												;---------------------------------------------
 = 00000003			X = LENGTHOF byte1		; 3
 = 00000020			X = LENGTHOF array1		; 30 + 2
 = 0000000F			X = LENGTHOF array2		; 5 * 3
 = 00000004			X = LENGTHOF array3		; 4
 = 00000009			X = LENGTHOF digitStr	; 9
 = 0000000A			X = LENGTHOF myArray	; 10

 = 00000003			X = SIZEOF byte1		; 1 * 3
 = 00000040			X = SIZEOF array1		; 2 * (30 + 2)
 = 0000001E			X = SIZEOF array2		; 2 * (5 * 3)
 = 00000010			X = SIZEOF array3		; 4 * 4
 = 00000009			X = SIZEOF digitStr		; 1 * 9

 00000000										.code
 00000000										main PROC






												invoke ExitProcess,0
 00000000  6A 00	   *	    push   +000000000h
 00000002  E8 00000000 E   *	    call   ExitProcess
 00000007										main ENDP
												END main
Microsoft (R) Macro Assembler Version 14.25.28610.4	    05/23/20 11:51:58
main.asm						     Symbols 2 - 1




Segments and Groups:

 N a m e                          Size     Length   Align   Combine Class

FLAT . . . . . . . . . . . . . .	GROUP
STACK  . . . . . . . . . . . . .	32 Bit	 00001000 DWord	  Stack	  'STACK'	 
_DATA  . . . . . . . . . . . . .	32 Bit	 00000084 DWord	  Public  'DATA'	
_TEXT  . . . . . . . . . . . . .	32 Bit	 00000007 DWord	  Public  'CODE'	


Procedures, parameters, and locals:

N a m e                             Type     Value    Attr

ExitProcess  . . . . . . . . . .	P Near	 00000000 FLAT	Length= 00000000 External STDCALL
main . . . . . . . . . . . . . .	P Near	 00000000 _TEXT	Length= 00000007 Public STDCALL


Symbols:

N a m e                             Type     Value    Attr

@CodeSize  . . . . . . . . . . .	Number	 00000000h   
@DataSize  . . . . . . . . . . .	Number	 00000000h   
@Interface . . . . . . . . . . .	Number	 00000003h   
@Model . . . . . . . . . . . . .	Number	 00000007h   
@code  . . . . . . . . . . . . .	Text   	 _TEXT
@data  . . . . . . . . . . . . .	Text   	 FLAT
@fardata?  . . . . . . . . . . .	Text   	 FLAT
@fardata . . . . . . . . . . . .	Text   	 FLAT
@stack . . . . . . . . . . . . .	Text   	 FLAT
X  . . . . . . . . . . . . . . .	Number	 00000009h   
array1 . . . . . . . . . . . . .	Word	 00000003 _DATA	
array2 . . . . . . . . . . . . .	Word	 00000043 _DATA	
array3 . . . . . . . . . . . . .	DWord	 00000061 _DATA	
byte1  . . . . . . . . . . . . .	Byte	 00000000 _DATA	
digitStr . . . . . . . . . . . .	Byte	 00000071 _DATA	
myArray  . . . . . . . . . . . .	Byte	 0000007A _DATA	

	   0 Warnings
	   0 Errors

展开阅读全文
©️2019 CSDN 皮肤主题: 护眼 设计师: 闪电赇
应支付0元
点击重新获取
扫码支付

支付成功即可阅读