我不明白汇编如何与 ASCII 一起工作?
我有一个程序应该获取值并将其打印回来。但是当用户输入类似 12(十六进制的 C)之类的内容时,程序会打印出一些奇怪的字母,我认为这是 ASCII 的表示形式。有没有办法让它将这些数字保存为原始数字?我正在通过外部库进行输入和输出,所以我不知道这是否与之有关。
I have a program that's supposed to take values and print them back out. But when the user enters something like 12, (C in HEX) the program prints out some weird letter, that I think is the representation in ASCII. Is there a way to make it save those numbers as raw numbers? I'm doing the input and output through an external library, so I don't know if that has anything to do with it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以在计算机内存储数字。主要是:
您需要弄清楚(希望文档说明)您的输入库需要什么格式以及您的输出库提供什么格式,并在程序中在它们之间进行转换。这种转换的通用名称是“二进制-十进制转换”
There are multiple ways to store a number inside of a computer. The main ones are:
You'll need to figure (hopefully the documentation says) out what format your input library wants and what format your output library provides, and convert between them in your program. The general name for this conversion is "binary-decimal conversion"