1. Rob - How does peek4s/peek4u work?

Rob,

Out of curiosity, does peek4s/peek4u assume the most signifcant byte 
will for or last in a 4 byte binary value?

Jonas

new topic     » topic index » view message » categorize

2. Re: Rob - How does peek4s/peek4u work?

Jonas writes:
> Out of curiosity, does peek4s/peek4u assume the most signifcant byte 
> will for or last in a 4 byte binary value?

They assume the standard byte-order on Intel (and compatibles).
The least significant byte comes first in memory
(at the lowest address). Then the next least, then the 2nd-most significant,
then the most significant. Run this to test:

include machine.e
atom addr

addr = allocate(4)
poke(addr, {1,2,3,4})
printf(1, "%08x", peek4u(addr))


If Euphoria were ported to a non-Intel-based machine,
peek4u/peek4s would have to conform to that 
machine's byte order.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu