How to compare two strings assembly

后端 未结 2 486
无人及你
无人及你 2021-01-24 07:16

Could anyone tell me how to compare two strings in assembly language, I`ve written the followign, but it does not seem to work.

assume cs:code, ds:data

data seg         


        
2条回答
  •  感情败类
    2021-01-24 07:53

    j is jump l is less e is equel if bl=a & bh=k here cmp is work like a-k

    if here 0 or less-equal value then jle work. then n will work. if positive value jle is not work.

    cmp bl,bh jle n

    mov ah,2 mov dl,bh int 21h

    n: mov ah,2 mov dl,bl int 21h

提交回复
热议问题