日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

汇编 and or xor not test cmp 条件跳转指令 jcc

發布時間:2025/6/17 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 汇编 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 L1

and 總是清除溢出標志和進位標志,并根據目標操作數的值來修改符號標志,零標志,奇偶標志。

  • 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, al

xor指令把兩個集合交集中的成員清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, 0

64位模式下的布爾指令

.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 = ffffffff80808080

Jcond指令

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
  • 兩個數中的較大數

mov edx, eax cmp eax, ebx jae L1 mov edx, ebx L1:
  • 三個數中的最小數
.data V1 word ? V2 word ? V3 word ? .code mov ax, V1 cmp ax, V2 jbe L1 mov ax, V2 L1:cmp ax, V3jbe L2 L2:
  • 循環直到按鍵
.data char byte ? .code L1:mov eax, 10call Delaycall ReadKeyjz L1mov char, al

條件循環指令

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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。