Discuss Scratch

SC_DStwo_Master
Scratcher
100+ posts

What exactly is a "word"?

So I've been told a word is a number of bytes which many design aspects of a processor are based on. For example, on amd64 platforms a word is 8 bytes. The memory addresses are 8 bytes, the registers are 8 bytes, etc. But then programs like ghex refer to 2 bytes as a “word”, and 4 bytes as a “longword”. What is going on here?

Last edited by SC_DStwo_Master (Oct. 4, 2016 18:30:48)

CodeLegend
Scratcher
500+ posts

What exactly is a "word"?

According to the Windows calculator:

QWORD = 64 bits = 8 bytes
DWORD = 32 bits = 4 bytes
WORD = 16 bits = 2 bytes

gdpr533f604550b2f20900645890
Scratcher
1000+ posts

What exactly is a "word"?

CodeLegend wrote:

According to the Windows calculator:

QWORD = 64 bits = 8 bytes
DWORD = 32 bits = 4 bytes
WORD = 16 bits = 2 bytes

According to this Stack Overflow post, a word is the amount of bits that can be processed, and the Windows “words” are irrelevant to its definition.

The size of a word varies between CPUs, so I have no idea why Ghex gave it a specific size.

Last edited by gdpr533f604550b2f20900645890 (Oct. 4, 2016 21:58:16)

novice27b
Scratcher
1000+ posts

What exactly is a "word"?

Chibi-Matoran wrote:

CodeLegend wrote:

According to the Windows calculator:

QWORD = 64 bits = 8 bytes
DWORD = 32 bits = 4 bytes
WORD = 16 bits = 2 bytes

According to this Stack Overflow post, a word is the amount of bits that can be processed, and the Windows “words” are irrelevant to its definition.

The size of a word varies between CPUs, so I have no idea why Ghex gave it a specific size.
Yep. It depends on the architecture and context.

You could have some really obscure hardware with 7 bit words, for example.

i use arch btw
CodeLegend
Scratcher
500+ posts

What exactly is a "word"?

novice27b wrote:

You could have some really obscure hardware with 7 bit words, for example.
*shudders*
novice27b
Scratcher
1000+ posts

What exactly is a "word"?

CodeLegend wrote:

novice27b wrote:

You could have some really obscure hardware with 7 bit words, for example.
*shudders*
https://www.ietf.org/rfc/rfc4042.txt

(that was an April Fools joke)

i use arch btw

Powered by DjangoBB