Simple asm question

Parents
  • Note: This was originally posted on 24th July 2009 at http://forums.arm.com

    forumer,

    The simple piece of information you appear to be missing is that the double representation of 12.0 requires two ARM registers (in this case r2 and r3), and has the hexidecimal equivalent of 0x4028000000000000.

    Thus, the parameters for:

    [font="Courier New"]printf("Foo %d %f %d\n", 34, (12.0), 67);[/font]

    are passed as:

    [font="Courier New"]r0 = char * = "Foo %d %f %d\n"
    r1 = int = 0x22 = 34
    {r2,r3} = double = 0x40280...00 = 12.0
    sp[0] = int = 0x43 = 67[/font]

    hth
    s.
Reply
  • Note: This was originally posted on 24th July 2009 at http://forums.arm.com

    forumer,

    The simple piece of information you appear to be missing is that the double representation of 12.0 requires two ARM registers (in this case r2 and r3), and has the hexidecimal equivalent of 0x4028000000000000.

    Thus, the parameters for:

    [font="Courier New"]printf("Foo %d %f %d\n", 34, (12.0), 67);[/font]

    are passed as:

    [font="Courier New"]r0 = char * = "Foo %d %f %d\n"
    r1 = int = 0x22 = 34
    {r2,r3} = double = 0x40280...00 = 12.0
    sp[0] = int = 0x43 = 67[/font]

    hth
    s.
Children
No data
More questions in this forum