flat assembler
Message board for the users of flat assembler.
Index
> Tutorials and Examples > Win64 Tokenize command line arguments |
| Author |
|
|
DimonSoft 07 Dec 2018, 07:10
But RSI and RDI are also non-volatile, aren’t they? I believe, a short explanation on why having at most N parameters on the stack can be more profitable than using CommandLineToArgv is also a good idea for the example.
|
|||
|
|
TightCoderEx 07 Dec 2018, 16:56
As RBX is the only register initialized to a value contingent upon operation of the application, it is, in essence, the only non-volatile register. However, if this routine was to be called from somewhere else, then stricter adherence to ABI would be prudent. However, if this was the first routine to be called, then even RBX wouldn't need to be preserved.
The first issue I had with that API is this excerpt from Win 8.0 documentation; Quote: However, if lpCmdLine starts with any amount of whitespace, CommandLineToArgvW will consider the first argument to be an empty string. Excess whitespace at the end of lpCmdLine is ignored. Obviously as not having anything to do with the implementation of CommandLineToArgvW but I can't help but think, why does it have to be so convoluted, especially as it applies to allocating space on the heap for probably no more than 10 pointers. If the array on the stack created by ParseCL isn't needed anymore just simply move RSP. |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.