I will put in my U.S. $0.02.

There is one place where doing something in C is definitely easier than
HLASM, IMO. That is in writing UNIX command processors. Why? The parameter
list coming into C is much easier to code and understand. Basically the C
prototype is: int main(int argc, char *argv[], char *env[]); The parameter
list coming into HLASM is a bit more complicated. Upon entry from the UNIX
exec() function (e.g. from the shell), GPR1 points to a list of 6
addresses: address 1 is a pointer to an int (argc); address 2 is a pointer
to an array of ints which are the lengths of the strings pointed to by list
of string addresses pointed by address 3; address 3 is a pointer to a list
of pointers to the UNIX "operands" (the char *argv[]); address; address 4
points to an int which is the number of addresses of environment variables
pointed by addresses 5&6; address 5 is a pointer to a list of ints for the
length of the corresponding environment variable; address 6 is a pointer to
a list of addresses which point to the environment variable strings.

Example code (not guaranteed to be "the best" or even "good") can be seen
at: https://github.com/JohnArchieMckown/utilities-1/blob/master/SKELETON.s

​A pseudo-C struct of the above would look something like:

struct {
           *int argc; /* pointer to argc​ - number of arguments */
           *int argvl[]; /* pointer to array of lengths of argument strings
*/
           *char argv[]; /* pointer to array of argument strings */
           *int envl[]; /* pointer to array of lengths of environment
strings */
           *char env[]; /* pointer to array of environment strings */
}



-- 
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

Reply via email to