assembly - Unknown variable being moved into EAX register -


for following function:

void say_hello (void) {       char name[5];      gets(name); //this unsafe function use. results in stack overflow     printf("hello %s\n", name);   } 

say hello function

i know rbp+var_5 argument gets() function , rbp+var_10 argument printf function. rbp+var_14? , why being moved eax register?

you read backwards. assembly language code in intel syntax, looks instruction destination, source.

the line mov dword [ss:rbp:var+14], eax copies eax, contains return value calling printf(), temporary variable on stack. variable thrown away (no code afterwards reads it).


Comments