欢迎访问 生活随笔!

生活随笔

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

编程问答

汇编语言——输入两位数比较大小

发布时间:2024/10/5 编程问答 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 汇编语言——输入两位数比较大小 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

源代码 

code segmentassume cs:codeorg 100h start:jmp bbb msg1 db 10,13,'please input x:','$' msg2 db 10,13,'please input y:','$' x db 0 y db 0 msg3 db 10,13,'x=y','$' msg4 db 10,13,'x>y','$' msg5 db 10,13,'x<y','$'bbb:push cspop dslea dx,msg1mov ah,09hint 21hmov ah,1int 21hsub al,30hmov ah,0mov bl,10mul blmov cl,almov ah,1int 21hsub al,30hmov ah,0add al,clmov byte ptr[x],allea dx,msg2mov ah,09hint 21hmov ah,1int 21hsub al,30hmov ah,0mov bl,10mul blmov cl,almov ah,1int 21hsub al,30hmov ah,0add al,clmov byte ptr[y],almov bl,byte ptr[x]sub al,bljz l1jc l2jmp l3 l1:lea dx,msg3mov ah,9int 21hjmp exit1 l2:lea dx,msg4mov ah,9int 21hjmp exit1 l3:lea dx,msg5mov ah,9int 21h ; jmp exit1exit1:mov ah,4chint 21h code endsend start

参考文章

https://zhidao.baidu.com/question/562479802788685844.html

总结

以上是生活随笔为你收集整理的汇编语言——输入两位数比较大小的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。