什么是地址偏移 [英] what is address offset
本文介绍了什么是地址偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码是:
my code is :
x = x & 0xffff
x << 8
我不知道0xffff是地址偏移量还是十六进制数.
I don''t know whether 0xffff is an address offset or hex number.
推荐答案
前缀``0x
''表示十六进制数.它是指地址还是其他数量,完全取决于您的代码,因为它只是一种表示方式.
The prefix ''0x
'' indicates a hexadecimal number. Whether it refers to an address or any other quantity entirely depends on your code as it''s only a way of representation.
int number_of_apples = 0x13; /* 19 apples */
short int number_of_fields_on_checker_board = 0100; /* octal number for 64 */
void* pointer_to_nowhere = 546233512; /* points to the address 546233512 */
它只是十六进制值(65535).
It is just a value (65535) in Hex.
偏移量用于避免重复.
在您的情况下,为避免地址重复,对于x的每个值,十六进制值都应为"AND" ed.
这样就不会有重复的机会.
但是我不知道您使用的是这么大的十六进制数字.
offset is used to avoid the duplicate.
In your case, to avoid the duplicate of the address, for each value of x the hexa decimal value is ''AND'' ed.
so that there is not chance of duplicating.
But i wonder y such a big hexa number you are using.
这篇关于什么是地址偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文