Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How many bytes is a single WORD?

Author
Message
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 21st Mar 2005 21:01
Hi, I was wondering how many bytes were in a single WORD - I can't seem to find this info anywhere. Anyone know?


[href]www.LightningStudios.co.uk[/href]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Mar 2005 21:03
2.

Doubleword (DWord) is 4


Van-B


It's c**p being the only coder in the village.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Mar 2005 21:28
Just for future reference;

Byte ( 8 bits )
Word ( 2 Bytes )
DWord ( 4 Bytes )
Integer ( 4 Bytes )
Float ( 4 Bytes )

Double Integer ( 8 Bytes )
Double Float ( 8 Bytes )


Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Mar 2005 21:33
You forgot...

A Nibble (4 bits)

My own favourite , not that I've ever used it outside of my binary class though.


Van-B


It's c**p being the only coder in the village.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 21st Mar 2005 21:39 Edited at: 21st Mar 2005 22:37
Strictly speaking (I think) a word varies in size depending on the processor. So for a 32 bit processor a word is 4 bytes. It's the amount of bytes it can process in one chunk. That's what they tell us in AS computing anyway...

but for DBPro a word is definately 2 bytes.

EDIT____________

More info:
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Mar 2005 21:57
Van, I actually put in both a bit and a Nibble, with that very description, but then took it out as it seemed irrelevant for people that aren't familiar with binary

Chris, that's interesting, thanks for the info

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
sengsjc
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: Huddersfield, UK
Posted: 21st Mar 2005 23:33
I hit this problem when I used to work in ARM32 assembler (GBA etc.) You get used to calling 32 bits a word (on those architectures it is) and then you go and talk to a PC programmer where it's 16 bits and you get all confused and forget your name and where you live etc.
And don't get me started on big endian and little endian systems grrrrrr.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Mar 2005 23:52
lol.
So what's this about big endian and little endian?
Just kidding

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 22nd Mar 2005 03:01
Quote: "ARM32 assembler"

The best processor around...

Visit http://homepages.nildram.co.uk/~nickk/
Questions are a burden to others, answers a prison for oneself.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 23rd Mar 2005 11:38
why did he not just look in the help files under "datatypes"

X-Patch x-patch.exe(gui):75% make.exe:5% x-patch.dll(runtime dll):0% developed on win xp home sp2
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Mar 2005 13:16
Quote: "So what's this about big endian and little endian?"


dont go confusing the newbies, the sizes stay the same.

a dword in java and i think c++ is 8 bytes

"eureka" - Archimedes
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 23rd Mar 2005 17:18
seriously - what is the difference, i've always wondered..

Is it something to do with which end the bit representing a decimal value of "1" is?

My Website:
Supremacy
21
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 23rd Mar 2005 20:04
Quote: "what is the difference, i've always wondered.."


not much, but it myght be important if u need to know when a word ends , for data collecting porpuses.

Cryptoman
21
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 23rd Mar 2005 20:23
Big endian processors read MSB first.
Little read LSB first.
16 bit:
Big word 01 255=(1*256)+255 or 511
Little word 01 255=(255*256)+1 or 65281


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 23rd Mar 2005 20:33
Ahhh thought it was like that.. Cheers Trs80

My Website:

Login to post a reply

Server time is: 2025-06-06 16:14:41
Your offset time is: 2025-06-06 16:14:41