You cant access Word or Long data --more that one byte at
a time-- at odd addresses --a 68000 limitation--, that
gives an address error or a bus error... Odd sized data
(and that includes odd sized char arrays) should not take
even sized data (char arrays are accessed byte per byte).
----- Original Message -----
From: "Alfred Wallner" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, May 21, 2001 9:09 PM
Subject: DmWrite offsets ?


> I have this structure:
>
> struct Record {
> UInt16 a;
> UInt16 b;
> UInt8 c;
> UInt16 d;
> } ixRec;
>
> the value in record field d is 0 at this point:
> then I am trying to change field d with DmWrite like this:
>
> UInt16 val = 0;
> val = (UInt16)(memP->d + 1);
> err = DmWrite(memP,5,&val,2);
>
> now the value at field d is 256 or 0b0000000100000000
> when I use:
> err = DmWrite(memP,6,&val,2);
> I get the correct result, d is now 1 or 0b0000000000000001
>
> >From my record structure, I picked 5 as the byte offset value for
DmWrite,
> but that doesn't work, so I have to pick offset 6, which is the low byte
> of the UInt16 field. That seems backwards because I am writing bytes
> 5 and 6 starting at 6, can someone explain or am I missing something
> else ?
> thanks.
>
>
> __________________________________________________
> FREE voicemail, email, and fax...all in one place.
> Sign Up Now! http://www.onebox.com
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to