How to get an integer from a sequence of bytes

J

Joshua Landau

There are tons (as in millions of units per month) of CPUs still being
sold in the DSP market with 16, 20, 24, and 32 bit "bytes". (When
writing C on a TMS320Cxx CPU sizeof (char) == sizeof (int) == sizeof
(long) == sizeof (float) == sizeof (double) == 1. They all contain 32
bits.
)

*) for the bracket not in the reply

Sorry.
 
C

Chris Angelico

)

*) for the bracket not in the reply

Sorry.

So... can we cite http://xkcd.com/859/ in two threads at once, or does
that create twice as much tension?

Once an XKCD is un-cited, will it be garbage collected promptly, or do
they contain refloops?

ChrisA
 
D

Dennis Lee Bieber

But you couldn't address individual 6-bit "hextets" in memory could
you? My recollection is that incrementing a memory address got you
the next 60-bit chunk -- that means that by the older terminology a
"byte" was 60 bits. A "character" was 6 bits, and a single register
or memory location could hold 6 characters.

How would you interpret the Xerox Sigma instruction set then...

It had LW (load word), LH (load halfword), LB (load byte)
instructions... BUT the address argument was always considered as a
32-bit word (word 1 was 32-bits after word 0).

To actually read a sequence of bytes required using LB with an
auxiliary index register, which identified which byte in the word was
desired.
 
F

Fábio Santos

A single machine word was 60 bits, so a single register read got you 10
characters.

10 characters! Now that sounds like it's enough to actually store a word.
However long words can inadverten be cropped.
 
G

Grant Edwards

10 characters! Now that sounds like it's enough to actually store a word.
However long words can inadverten be cropped.

Only the first 10 characters in variable names were significant when
you wrote Pascal programs (I don't remember if that was true for
FORTRAN, but I bet it was).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top