zaskar9 / oberon-lang

An LLVM frontend for the Oberon programming language
MIT License
20 stars 3 forks source link

Access to argc & argv #47

Open tenko opened 6 months ago

tenko commented 6 months ago

As far as I can see it seems the only cross platform way to access argc & argv is to store these variables in the main procedure. Right now the main procedure is without arguments. This would then need to changed and argc, argc stored in external visible variables.

Alternative access from external visible functions in similar way to outline in #46. This way the argument can be modified by the runtime for example when running on embedded MCU in semihosting mode.

Also in the JIT mode the original argv should be modified so that perhaps all arguments after -- from the command line is propagated to the main function.