Hi Olin, I am sorry to say that i am not as all the bright men on this list. How should i explain my problem anymore? Thats why they call it a problem. Harry -----Oorspronkelijk bericht----- Van: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] Namens Olin Lathrop Verzonden: maandag 11 augustus 2008 16:15 Aan: Microcontroller discussion list - Public. Onderwerp: Re: [PIC] Packets problem to be solved Harry H. Arends wrote: > OK by now i am aware to be more specifik. The language is ASM. > The data to be sendout is in four 8 bit variables: > DATA0 contains all ones > DATA1 contains a 8 bit address (AAAAAAAA) > DATA2 contains a 8 bit command (DDDDDDDD) > DATA3 contains a bitwise exclusif OR from the DATA1 and DATA2 > > The result should become > BYTE0 11110AAA > BYTE1 AAAAA0DD > BYTE2 DDDDDD0E > BYTE3 EEEEEEE1 > > So how can i do that in ASM So your problem is really how to pack non-byte bit fields into bytes, and talk of transmitting anything was just to add confusion? I understand correctly, you are asking how to pack the following data fields successively into bytes with the bytes being filled in MSB to LSB order: 1111 0 a byte value (AAAAAAAA) 0 a byte value (DDDDDDDD) 0 a byte value (AAAAAAAA xor DDDDDDDD) 1 This is simple to do, and I suspect you could easily do it if only you had understood the problem to be as stated above in the first place. If you confirm this is indeed the problem, I can suggest some solutions if you can't already do it yourself. Note that none of this has anything to do with "sending" anything. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist