Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/04/04 22:51
Read: times


 
#71822 - RE: Little Endian Big endian conversion.
Responding to: ???'s previous message
hi,

friends, in my opinion 8051 has nothing defined about Big/Little Endian format. Here below I put some examples, which show my point. They are not based on compilers you use. Opposite it, they are based on the hardware which is only the factor helps to determite native numbers storage format. So...

1) The good test is command MOV DPTR,#value. Let compile:
	ORG	0x0000
	MOV	DPTR,#0x1234

and look at binary:
C:0x0000 901234
We see that the high byte of word value is placed first.

2) Try to check data memory. Another code for test:
	ORG	0x0000
	MOV	SP,#0x2F
	MOV	0x30,#0xFF
	MOV	0x31,#0xFF
	CALL	SUB_TEST
; ...
SUB_TEST:
	RET

Now we run simulator and see that return address (i.e. 16-bit word value at stack in data memory space) is placed with the low byte first (at 0x30).

Finally, just a sophictical example. Look how "virtual" values are paced inside SFR memory map (8052):

DPL: 0x82 DPH: 0x83
TL0: 0x8A TH0: 0x8C
TL1: 0x8B TH1: 0x8D
RCAP2L: 0xCA RCAP2H: 0xCB
--- does it seem that low bytes are placed first?
I doubt, for me it seems like 8051 hardware has nothing with 16-bit values in the whole. Comments?

Regards and good weekend,
Oleg

List of 23 messages in thread
TopicAuthorDate
Little Endian Big endian conversion.            01/01/70 00:00      
   RE: Little Endian Big endian conversion.            01/01/70 00:00      
      RE: Little Endian Big endian conversion.            01/01/70 00:00      
         RE: Little Endian Big endian conversion.            01/01/70 00:00      
            RE: Little Endian Big endian conversion.            01/01/70 00:00      
               RE: Little Endian Big endian conversion.            01/01/70 00:00      
                  RE: Little Endian Big endian conversion.            01/01/70 00:00      
                     RE: Little Endian Big endian conversion.            01/01/70 00:00      
               RE: Little Endian Big endian conversion.            01/01/70 00:00      
               Totally & Utterly Impossible!            01/01/70 00:00      
         RE: Little Endian or Big endian?            01/01/70 00:00      
      RE: Little Endian Big endian conversion.            01/01/70 00:00      
         RE: Junk            01/01/70 00:00      
   RE: Little Endian Big endian conversion.            01/01/70 00:00      
   RE: Little Endian Big endian conversion.            01/01/70 00:00      
      RE: machine-independent            01/01/70 00:00      
      RE: Little Endian Big endian conversion.            01/01/70 00:00      
         RE: Compiler-dependence            01/01/70 00:00      
            RE: Compiler-dependence            01/01/70 00:00      
   RE: Little Endian Big endian conversion.            01/01/70 00:00      
      RE: Little Endian Big endian conversion.            01/01/70 00:00      
   A Useful Link            01/01/70 00:00      
   RE: Little Endian Big endian conversion.            01/01/70 00:00      

Back to Subject List