Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
IIRC, a "word" in the strictest sense is the size of a data entity that is directly addressible (i.e. minimal size of data entity that can be transferred between main memory and CPU register), while a "byte" represents a data element that corresponds to a single character of data. On Control Data mainframes a word is a 60-bit quantity consisting of ten 6-bit bytes (Geez, am I really *that* old?). On Intel 80x86 family of CPUs a "byte" is an 8-bit quantity, a "word" is a 16-bit quantity (two bytes), a "doubleword" is a 32-bit quantity (four bytes), and a "quadword" is a 64-bit quantity (eight bytes). Using typical Intel assembly-language nomenclature:
BYTE 8-bit
WORD 8-bit
DWORD 16-bit
QWORD 32-bit
If you think you can't get more confused, C declarations are affected by architecture. In 16-bit architectures, the "natural" size of data is a 16-bit entity, whereas in a 32-bit architecture the "natural" size of data is a 32-bit entity. Integers are typically the same size as the "natural" size. So, for 16-bit systems we have:
unsigned char = 8-bit quantity (i.e. byte)
int = 16-bit quantity
short = 16-bit quantity
long = 32-bit quantity
In a 32-bit system it changes a bit:
unsigned char = 8-bit quantity (i.e. byte)
int = 32-bit quantity
short = 16-bit quantity
long = 32-bit quantity
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement