diff SSR.s @ 26:9abe1ac89aca

Update assembler code to 64bit
author Nina Engelhardt
date Mon, 29 Aug 2011 13:42:28 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/SSR.s	Mon Aug 29 13:42:28 2011 +0200
     1.3 @@ -0,0 +1,21 @@
     1.4 +
     1.5 +//Assembly code takes the return addr off the stack and saves
     1.6 +// into the singleton.  The first field in the singleton is the
     1.7 +// "endInstrAddr" field, and the return addr is at 0x4(%ebp)
     1.8 +.globl asm_save_ret_to_singleton
     1.9 +asm_save_ret_to_singleton:
    1.10 +    movq 0x8(%rbp),     %rax   #get ret address, ebp is the same as in the calling function
    1.11 +    movq     %rax,     (%rdi) #write ret addr to endInstrAddr field
    1.12 +    ret
    1.13 +
    1.14 +
    1.15 +//Assembly code changes the return addr on the stack to the one
    1.16 +// saved into the singleton by the end-singleton-fn
    1.17 +//The stack's return addr is at 0x4(%%ebp)
    1.18 +.globl asm_write_ret_from_singleton
    1.19 +asm_write_ret_from_singleton:
    1.20 +    movq    (%rdi),    %rax  #get endInstrAddr field
    1.21 +    movq      %rax,    0x8(%rbp) #write return addr to the stack of the caller
    1.22 +    ret
    1.23 +
    1.24 +