5 ms·
That's probably not a good model to fit in assembly code. It's easier to have a wrapper in another language as the launcher and have it set the variables in the
by haolez 8y ago
That's probably not a good model to fit in assembly code. It's easier to have a wrapper in another language as the launcher and have it set the variables in the assembly code and build the binary.
- getcrunk 8y agoWhy?
- SSLy 8y agofor starters, you'd need a text parser
- admax88q 8y agoSomething you already have if you're building an http server in asm...
- haolez 8y agoI’m assuming that there is a need to dynamically configure things like the port in the parent’s environment. However, for an assembly tool, it might make sense to simply have it hard coded and save the extra complexity. My launcher script suggestion is a possible solution to this, but I would just hard code the port and ship it without a launcher myself. The suckless projects make use of hard coded configurations in their C programs. The principle is the same.
- kjeetgill 8y agospeculation: Maybe it's simpler to just bake a string into the binary and hardcode the pointer to at every use than futz around with strings in asm? But if you're already doing the rest of it in asm why would that scare you?
- captoblivious 8y agoA wrapper that recompiles every time you run or change an option? lol. HN has caught the reddit cancer. environment variables are after argv. http://asm.sourceforge.net/articles/startup.html#st http://asm.sourceforge.net/articles/startup.html#st
- saagarjha 8y agoWhile the point you are making is correct, you could have presented it in a less abrasive way. Not everyone is aware of how environment variables are passed to programs, or pieced together that char envp is also available in assembly.
- alxlaz 8y agoIf we're talking about bad ways to present knowledge, the parent comment could also have been "I really don't know much on this topic so I'd rather not speculate" ;-).