- 7
- 0
- 约2.72千字
- 约 45页
- 2017-07-26 发布于河南
- 举报
AND指令可用于复位某些位(同0相和)
Chapter 8 Bit Manipulation;8.1 Logical Operations;True table;flags;Clear selected bits (marking);Set selected bits;negate selected bits;;AND指令可用于复位某些位(同0相与),不影响其他位:将BL中D3和D0位清0,其他位不变
and bl
;OR指令可用于置位某些位(同1相或),不影响其他位:将BL中D3和D0位置1,其他位不变
or bl,
;XOR指令可用于求反某些位(同1相异或),不影响其他位:将BL中D3和D0位求反,其他不变
xor bl,;Perform certain arithmetic operation;Manipulate ASCII codes;Application of TEST;test al,01h ;测试AL的最低位D0
jnz there ;标志ZF=0,即D0=1
;则程序转移到there
... ;否则ZF=1,即D0=0,顺序执行
there: ...;Shift and Rotate;Shift instructions;Shift instructions;SHL / SAL instruction;SHR instruction;SAR instruction;flags;Examples;;将DX.AX中32位数值左移一位
shl ax,1
rcl dx,1;;把AL最低位送BL最低位,保持AL不变
ror bl,1
ror al,1
rcl bl,1
rol al,1;Figure 8.7;Double shift instructions;flags;Examples:;Figure 8.7;Rotate instructions;Rotate operation;ROL instruction;ROR instruction;RCL instruction;RCR instruction;;将DX.AX中32位数值左移一位
shl ax,1
rcl dx,1;;把AL最低位送BL最低位,保持AL不变
ror bl,1
ror al,1
rcl bl,1
rol al,1;Figure 8.7;ASCII to double integer conversion;mov esi,[ebp+8]
; get parameter (source addr)
WhileBlankD:cmp BYTE PTR [esi], ; space?
jne EndWhileBlankD ; exit if not
inc esi ; increment character pointer
jmp WhileBlankD ; and try again
EndWhileBlankD:;;;;cmp cx,0 ; no digits?
jz overflowD ; if so, set overflow error flag
; if value is and sign is -,
; want to return (-2^32)
cmp eax ; ?
jne TooBigD?
cmp DWORD PTR [ebp-4],-1 ; multiplier -1 ?
je ok1D ; if so, return 8000h
TooBigD?: test eax,eax ; check sign flag
jns okD ; will be set if number 2^32 - 1
;overflowD: pop ax ; get flags
or ax,0000100001000100B ; set overflow, zero parity flags
and ax,1111111101111110B ; reset sign and carry flags
pu
您可能关注的文档
最近下载
- 电力工程专业设计工日定额-送电工程±500kV(直流)部分.doc VIP
- 2021春人教版九年级数学下册 第29章 全章教案.doc VIP
- 2025年湖北专升本武汉文理学院《动画概论》考试及答案.docx VIP
- 医院门诊服务优化与创新体系构建ppt课件.pptx
- 电力工程专业设计工日定额光纤通信工程部分.docx VIP
- 电力工程专业设计工日定额光纤通信工程部份.pdf VIP
- 建筑施工安全法律法规最新课件.ppt VIP
- 电力工程专业设计工日定额·变电工程220kV(户外)部分.pdf VIP
- 电力工程专业设计工日定额变电工程500kV部分.doc VIP
- 2025美国心脏协会和美国儿科学会新生儿复苏、儿童基础生命支持和儿童高级生命支持指南更新解读.pptx VIP
原创力文档

文档评论(0)