В этом учебнике не хватает раздела про передачу аргументов командной строки в параметры программы. … n-assembly

AMD64 ABI Draft 0.99.7 – November 17, 2014

Для x86:

All the arguments are sitting on the stack when the program starts, so all we need to do is pop them off.
The first value popped off is the number of arguments (called argc in C/C++), the second is the name of the program, and finally we get the actual command line arguments.
when we pop the command line argument off the stack, it actually puts the address of that string in EBX
This just took us an entire 3 instructions

  pop ebx; argc (argument count)
  pop ebx; argv[0] (argument 0, the program name)
  pop ebx; The first real arg, a filename

Отредактировано Лис (2018-11-02 11:11:15)