1 2 3 下一页 汇编指令的一般性要求: 1、两个操作数的尺寸必须一致; 2、操作数不能同为内存. MOV(Move): 最常用的数据传送指令 ;该指令不影响 EFlags ;指令格式: (其中的 r、m、i 分别表示: 寄存器、内存、立即数) MOV r, r MOV r, m MOV r, i MOV m, r MOV m, i ; Test21_1.asm .386 .model flat, stdcall include Windows.inc include kernel32.inc include masm32.inc include debug.inc includelib kernel32.lib includelib masm32.lib includelib debug.lib .data? val dd ? .code main proc mov val, 123 mov edx, val mov eax, edx PrintDec eax ;123 ret main endp end main
LEA(Load Effective Address): 有效地址传送指令 ;该指令不影响 EFlags ;指令格式: LEA r, m ; Test21_2.asm .386 .model flat, stdcall include Windows.inc include kernel32.inc include masm32.inc include debug.inc includelib kernel32.lib includelib masm32.lib includelib debug.lib .data szText db ''ABCDEFG'', 0 .code main proc lea eax, offset szText lea ebx, szText PrintHex eax ;00403000 PrintHex ebx ;00403000 ret main endp end main (责任编辑:admin)
|