编写微机原理的程序,比较两个字符串是否相等

2021-03-11 19:05:37 字数 1461 阅读 8906

1楼:臧禾锁尔槐

data

segment

lendb

10(字符个数)

str1

db'0123456789'

(字符1,单引号中可改,相应的专len也要变化的属)str2

db'0123456789'

result

db0ffh

data

ends

code

segment

assume

cs:code,ds:data

start:

movax,data

movds,ax

moves,ax

movcl,len

movch,0

movsi,offset

str1

movdi,offset

str2

cldrepe

cmpsb

jnzlp_no

movresult,56h

jmplp_end

lp_no:

movresult,4eh

lp_end:

movah,4ch

int21h

code

ends

endstart

2楼:我的逆云之鹰

datas segment

buf1 db 90,91 dup(0)

buf2 db 90 dup(0)

;此处输入数据段**

datas ends

stacks segment

;此处输入堆栈段**

stacks ends

codes segment

assume cs:codes,ds:datas,ss:stacksstart:

mov ax,datas

mov ds,ax

lea dx,[buf1]

mov ah,10

int 21h

lea si,[buf1+2]

mov cl,[buf1+1]

lea di,[buf2]

next:

cmp byte ptr[si],20h

jz lab1

jnz lab2

lab2:

mov al,[si]

mov [di],al

inc di

lab1:

inc si

loop next

mov byte ptr[di],'$'

mov ah,2

mov dl,10

int 21h

mov ah,9

lea dx,[buf2]

int 21h

mov ah,4ch

int 21h

codes ends

end start

微信小程序怎么判断两个字符串相等

1楼 相逢双恋 if 文本 框1 gettext equals 文本框2 gettext system out println 两个文本框内容相等 或者 if 文本框1 gettext equals 文本框2 gettext system out println 两个文本框内容不相等 2楼 熊猫大大...