Nothing new to add, except a link for those of us that have
interest, but not enough Zilog experience.
(Assembler manual)
http://www.bitsavers.org/pdf/zilog/z8000/Z8000Tech.pdf
char whatstr[] = "(a)[$]unlink.c 2.1 07/23/82 21:19:30 - 87wega3.2";
main(argc, argv)
int argc;
char **argv;
{
if(argc!=2) {
write(2, "Usage: /etc/unlink name\n", 24);
exit(1);
}
unlink(argv[1]);
exit(0);
}
The original ASM code for the beginning of main() until the argc
check is:
0042 abf3 dec r15,#4
0044 5df60000 ldl %0000(r15),rr6 ;Keven-X mode
Indexed
0048 0b070002 cp r7,#%0002
The ASM code my C file generates is:
0042 abf3 dec r15,#4
0044 1df6 ldl @r15,rr6 ;Keven-IR
mode Indirect Register
0046 0b070002 cp r7,#%0002
Since the 1st C code is the "cp r7,#%0002",
I say the line before comes from the definition of argv.
trying main ( int argc, char *argv[] ) might be an option.
using "register" is another - but you explored that.
long shot in using static
main (argc, argv)
int argc;
static char** argv;
{
Other modifiers "volatile", "const", "auto" might be
possible.
hmm - const might be another good choice -
with argv being placed onto the stack - as in a "fixed" location.
Keven Miller