Hello all, I am using a float variable named val which has a value 169.0 in my program .When I ran the program I got the following assembly code in my disassembly window.Now I want to know the memory location at which the value 169.0 has been stored.Is it possible to know it from the code below? Looking for your help.
49: val=169.0; 0x000002B8 E59F1024 LDR R1,[PC,#0x0024] 0x000002BC E28D0000 ADD R0,R13,#0x00000000 0x000002C0 E5801000 STR R1,[R0]
Oh, my! The preview looked just fine. You almost got me there for a second, having changed 169.0 to 144.0, but anyhow, the constant is here:
0x000002E4 43100000 DDIA 0x43100000 0x43100000 = 0b01000011000100000000000000000000 Working through the floating point format: http://www.keil.com/support/man/docs/ca/ca_ap_float_format.htm S EEEEEEEE MMMMMMMMMMMMMMMMMMMMMMM 0 10000110 00100000000000000000000 Exponent: 134 - 127 = 7 Mantissa with leading 1-bit: 1.00100000000000000000000 After adjusting binary point: 10010000.0000000000000000 0b10010000 = 144
Hi Dan Henry, Thanks for all your help and replies and clearing my doubt. During my search I got a link where we can convert the our float values into hex value...hope you know the link http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html Thanks again for your help.