如何在Assembley中添加两个十六进制数字? [英] how to add two hexadecimal numbers in Assembley?

查看:807
本文介绍了如何在Assembley中添加两个十六进制数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



可以帮助我,如何编写一个程序,提示用户输入每个0到FFFF数字的两个十六进制数字,并在下一行打印它们的总和十六进制。如果用户输入非法字符,则应提示他或她再次开始。每个输入都以回车结束。我想知道如何添加检查,以便如果用户输入十六进制以外的数字,他/她应该被提示错误的数字。

thanx。

Hi,
can any one please help me that how to write a program that prompts the user to enter two hexadecimal numbers from 0 to FFFF digits each, and print their sum on the next line in hexadecimal. If the user enters an illegal character, he or she should be prompted to begin again. Each input ends with a carriage return. i wanna know how to add check so that if user enter other than hexadecimal numbers he/she should be prompted about wrong digit.
thanx.

推荐答案

我已经在如何在汇编语言中添加两个二进制数? [ ^ ]。您可以轻松地调整该代码以接受十六进制而不是二进制。如果您考虑如何处理大于9的值,那么逐字符打印十六进制数字并不会太困难。
I already answered a similar question for you, at how to add two binary numbers in Assembly language?[^]. You can easily adapt that code to accept hex rather than binary. And printing a hex number character by character is not too difficult if you think about what to do for values greater than 9.


这篇关于如何在Assembley中添加两个十六进制数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆