← Back to context

Comment by imtomt

4 days ago

Aw, that’s too bad. Sounds like it was a really fun project.

Thanks for the tips on CGI! Definitely going to look into it more. The server-side execution of CGI scripts definitely interests me more than the CGI scripts themselves, so I’ll probably just look for some existing (simple) CGI scripts and work on building the env vars and executing them.

Implementing a web server that can do CGI is actually probably easier than writing a CGI app. All you have to do for your server is set some environment variables and then spawn the executable.

  • It was a small "app". But I do remember writing string parsers in Assembly.

    My overall lesson was to stick with Perl / CGI-bin.

    That being said, I wrote in "Human Readable Assembly" back then. Ex: function calls were:

         mov eax, string
         call myFunction
         .db '\n' ; this parameter for myFunction
    

    I would put compile time constants after the functions. Then I would before returning, pop the return address off the stack and add reg, 1, and push it back on.

    It's horribly inefficient to do this today. But it allows you to write more flexible assembly functions that were more readable. Especially with macro-assemblers with some kind of preprocessor.