Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void str_buf_append(const char&);
- extern char byvalue( char );
- extern char byref( const char & );
- int main( int argc, char * argv[] )
- {
- char c = byvalue( argv[0][0] ) + byref( argv[0][1] );
- return c;
- }
- $ g++ -O3 param.cpp -c -o param.o
- $ objdump -D param.o|less
- 0000000000000000 <main>:
- 0: 55 push %rbp
- 1: 53 push %rbx
- 2: 48 89 f3 mov %rsi,%rbx
- 5: 48 83 ec 08 sub $0x8,%rsp
- 9: 48 8b 06 mov (%rsi),%rax
- c: 0f be 38 movsbl (%rax),%edi ; %edi is character
- f: e8 00 00 00 00 callq 14 <main+0x14> ; byvalue
- 14: 48 8b 3b mov (%rbx),%rdi
- 17: 89 c5 mov %eax,%ebp
- 19: 48 83 c7 01 add $0x1,%rdi ; %rdi is address of character
- 1d: e8 00 00 00 00 callq 22 <main+0x22> ; byref
- 22: 48 83 c4 08 add $0x8,%rsp
- 26: 01 e8 add %ebp,%eax
- 28: 5b pop %rbx
- 29: 0f be c0 movsbl %al,%eax
- 2c: 5d pop %rbp
- 2d: c3 retq
- c: 0f be 38 movsbl (%rax),%edi ; %edi is character
- f: e8 00 00 00 00 callq 14 <main+0x14> ; byvalue
- 19: 48 83 c7 01 add $0x1,%rdi ; %rdi is address of character
- 1d: e8 00 00 00 00 callq 22 <main+0x22> ; byref
- void fun (char const & c) {use (c);}
- ...
- fun (x);
- [next line]
- void fun (char const c) {use (c);}
- ...
- fun (x);
- [next line]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement