RE: Binary conversion
- Posted by Jonas Temple <jktemple at yhti.net> Aug 16, 2002
- 434 views
Don, The problem was that the IBM iSeries stores 32 bit values in the opposite order of the PC. What I wound up with after a call to a program on the iSeries is 4 bytes returned to me in the opposite order. You can't use peek4s or peek4u on the memory since peek4s/u is expecting the bytes to be in the PC order. Make sense? Don Phillips wrote: > 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 > >