RE: Binary conversion

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Okay, I asked this a while back and now I've got a slightly different 
> problem.
> 
> If I have a sequence of {0,0,0,2} that is supposed to represent a binary 
> 
> number, how do I convert that to an atom?
> 
> Jonas

Hey Jonas,
I saw the other posts, but I am not real sure about what exactly
it is you are trying to do.

poke4 is a 32 bit command so you will store 4 bytes of information
at a specified location.  If this is the case, I do not see why
you are using peek to get the information back out.  Peek is an 8
bit command so, as posted, you would get back a 4 length sequence
representing the 4 bytes that you wrote out earlier.

Why not use peek4u or peek4s to read the data back out as these
are the 32 bit routines for accessing memory?

Write 90: poke4( mem, 90 )
Read 90: peek4u( mem )

Don

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu