Hi all, Can anyone help me with the following problem? I'm writing a long data to a long variable but instead of passing 4 Bytes it pass 3 Bytes. I'm using C51 v6.22. long var = 0xBD3C00BD; -> var=0x3C00BD; Thanks a lot, Reuven
Really? Then the Keil compiler is completely broken. Hmm, I doubt that. How are you inspecting the value? Don't say printf(). If you say printf() then besure you tell printf() that the object to be printed is of type %lu or %lX. Remember too that in the small model printf will only handle up to 15 bytes of stacked args, 40 in the large model (I think). So if you're printing this 4 byte unsigned long after a bunch of other longs you'll get garbage.
OK, after some invastigations I think the problem is in my emulator. In the *.LST file is see that the compiler take 4 bytes for this variable, so now I'm waiting for some answares from Ceibo (emulator's company).