汇编 and or xor not test cmp 条件跳转指令 jcc
布爾和比較指令
- and
and destination, source
and reg, reg/mem/imm
and mem, reg/imm
mov al, 10101110b and al, 11110110b.data array byte 50 dup(?) .code mov ecx, lengthof array mov esi, offset array L1:and byte ptr [esi], 11011111binc esi loop L1and 總是清除溢出標志和進位標志,并根據目標操作數的值來修改符號標志,零標志,奇偶標志。
- or
or destination, source
or reg, reg/mem/imm
or mem, reg/imm
or 總是清除溢出標志和進位標志,并根據目標操作數的值來修改符號標志,零標志,奇偶標志。
mov al, 11100011b or al, 00000100b- xor
xor destination, source
xor 總是清除溢出標志和進位標志,并根據目標操作數的值來修改符號標志,零標志,奇偶標志。
mov al, 10110101b xor al, 0 mov al, 11001100b xor al, 0mov ax, 64c1h xor ah, alxor指令把兩個集合交集中的成員清0,并形成了其余位的并集
B0xorB1xorB2xorB3
- not
not reg/mem
mov al, 11110000b not al- test 進行邏輯與操作
xor 總是清除溢出標志和進位標志,并修改符號標志,零標志,奇偶標志。
test al, 00001001b
影響零標志,進位標志,符號標志,溢出標志,奇偶標志
位映射集
SetX = 10000000 00000000 00000000 00000111
mov eax, SetX
and eax, 10000b
-
補集
mov eax, SetX
not eax
-
交集
mov eax, SetX
and ea, SetY
-
并集
mov eax, SetX
or eax, SetY
cmp
cmp destination, source(有無符號數)
溢出,符號,零,進位,輔助進位,奇偶標志
mov ax, 5 cmp ax, 10mov ax, 1000 mov cx, 1000 cmp cx, axmov si, 105 cmp si, 0清除和設置標志位
test al, 0 and al, 0 or al, 0or al, 80h and al, 7fhstc clcmov al, 7fh inc al or eax, 064位模式下的布爾指令
.data allones qword 0ffffffffffffffffh .code mov rax, allones and rax, 80h mov rax, allones and rax, 8080h mov rax, allones and rax, 808080hmov rax, allones adn rax, 80808080h ; rax = ffffffff80808080Jcond指令
Jcond destination
jc, jnc, jz, jnz,jc, jnc, jo,jno,js,jns,jp,jnp
相等性的比較
je,jne,jcxz,jecxz,jrcxz
cmp eax, 5 je L1mov ax, 5 cmp ax, 6 jl L1mov ax, 5 jg L1 mov edx, 0a523h cmp edx, 0a523h jne L5 je L1mov bx, 1234h sub bx, 1234h jne L5 je L1mov cx, 0ffffh inc cx jcxz L2xor ecx, ecx jecxz L2無符號數比較
ja, jnbe, jae, jne, jb, jnae, jbe, ja
mov al, +127 cmp al, -128 ja IsAbove jg IsGreater有符號數比較
jg, jnle, jge, jnl, jl, jnge, jle, jng
mov edx, -1 cmp edx, 0 jnl L5 jnle L5 jl L1mov bx,+32 cmp bx, -35 jng L5 jnge L5 jge L1mov ecx, 0 cmp ecx, 0 jg L5 jnl L1mov ecx, 0 cmp ecx, 0 jl L5 jng L1-
測試狀態位
mov al, status test al, 00100000b jnz DeviceOfflinemov al, status test al, 00010011b jnz DeviceOfflinemov al, status and al, 10001100b cmp al, 10001100b je ResetMachine -
兩個數中的較大數
- 三個數中的最小數
- 循環直到按鍵
條件循環指令
LOOPZ和LOOPE指令
loopz(loope) destination
loopnz和loopne指令
loopnz(loopne) destination
.data array sword -3, -6, -1, -10, 10, 30, 40, 4 sentinel sword 0 .code mov esi, offset array mov ecx, lengthof array L1:test word ptr[esi], 8000hpushfdadd esi, type arraypopfdloopnz L1jnz quitsub esi, type array quit:總結
以上是生活随笔為你收集整理的汇编 and or xor not test cmp 条件跳转指令 jcc的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Irvine64链接库过程的使用说明 M
- 下一篇: 汇编 控制流伪指令 .break .c