??? 06/05/04 15:35 Read: times |
#71835 - RE: Little Endian Big endian conversion. Responding to: ???'s previous message |
If you have a program in 8051 assembly language and need to change the byte order (endian-ness) of a 16 bit variable it is rather easy to do. If the variable is stored in the 8051 internal data memory as follows:
... WORD_VAL: DS 2 ... ... XCH A, WORD_VAL+0 XCH A, WORD_VAL+1 XCH A, WORD_VAL+0 This gets the job done short and sweet and even keeps the original value of the A register intact. Michael Karas |