1 2 下一页 ;INC(Increment): 加一 ;DEC(Decrement): 减一 ;NEG(Negate): 求补(求反) ;ADD(Add): 加 ;ADC(Add Carry): 带进位加 ;SUB(Subtract): 减 ;SBB(Subtract With Borrow): 带进位减 ;CMP(Compare): 比较 ;INC、DEC、NEG 的指令格式: ;INC r/m ;ADD、ADC、SUB、SBB、CMP 的指令格式: ;ADD r/m, r/m/i ;它们的结果影响 OF、SF、ZF、AF、PF、CF
INC、DEC、NEG ; Test26_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 .code main proc mov eax, 6 inc eax PrintDec eax ;7 dec eax PrintDec eax ;6 neg eax ;NEG 就是加个负号 PrintDec eax ;-6 neg eax PrintDec eax ;6 ret main endp end main
ADD、ADC ; Test26_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 .code main proc mov eax, 5 add eax, 1 PrintDec eax ;6 stc ;CF=1 mov eax, 5 adc eax, 1 ;ADC 比 ADD 还要多加上 CF PrintDec eax ;7 clc ;CF=0 mov eax, 5 adc eax, 1 PrintDec eax ;6 ret main endp end main (责任编辑:admin)
|