本文介绍了十进制转换为十六进制汇编的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
能否有人向我解释小数在装配进制转换算法,我在一个变量中有一个十进制值,我应该打印为十六进制value.Print应该是这样的:34AC6
Can someone explain to me decimal to hex conversion algorithm in assembly?I have a decimal value in a variable and I should print it as a hex value.Print should look like this: 34AC6 .
推荐答案
假设这是一门功课,这里有一对夫妇的提示:
Assuming that this is a homework, here's a couple of hints:
- 在变量的值的不是十进制,十六进制或任何其他系统的:它是什么系统,您的硬件支持(最有可能的,这是二进制)
- 要值转换为十六进制,你需要通过右移和掩蔽与
为0x0F
,和索引到的十六进制数字阵列分离出的4位块。
- The value in the variable is not in decimal, hex, or any other system: it is in whatever system that your hardware supports (most likely, it is binary).
- To convert a value to hex, you need to separate out 4-bit chunks by shifting right and masking with
0x0F
, and indexing into an array of hexadecimal digits.
这篇关于十进制转换为十六进制汇编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!