1 2 3 4 下一页 AND: 逻辑与 ;该指令会置 CF=OF=0; 其结果影响 SF、ZF、PF ;指令格式: AND r, r AND r, m AND r, i AND m, r AND m, i ; Test22_1.asm - 使用 AND 运算将一个数的第二、四位清零 .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 .code main proc mov al, 00001111b and al, 11110101b PrintHex al ;05 - 00000101b ret main endp end main ; Test22_2.asm - 使用 AND 运算将字母转大写 .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 ''Delphi'', 0 .code main proc lea esi, szText mov ecx, lengthof szText - 1 @@: and byte ptr [esi], 11011111b ;大写字母和小写字母只有第五位不同 inc esi loop @B PrintString szText ;DELPHI ret main endp end main (责任编辑:admin)
|