@Istarian
I think I was never able to make it compile - I know I did try compiling it on a C compiler on an IBM-370, as I have some fragments of line printer listings from that. But it isn't clear to me I was ever able to run it. My memory around this is not great because my hobby interest in C moved quickly from Tiny-C to Small-C (CPM/80 product), to real C on an Apollo workstation (Unix like 68020) not long after that.
If I get my Bigboard CPM/80 machine going, I might find that I got tiny-c running on that. Although I'm not sure why I would have done that.
If the DDJ archive copy looks complete - that's surely the right place to start.
I was able (with a lot of effort) to correct a number of typos and get it to compile, but it isn't producing sensible results and my understanding of the expected syntax is not the best. I could try starting over and typing in the code directly from the article, but the interchangeable use of char and int is problematic to say the least.
Code:
void doif() {
int flev;
int fsp;
int flab1;
int flab2;
flev=locptr;
fsp=sp;
flab1=getlabel();
test(flab1);
statement();
sp=modstk(fsp);
locptr=flev;
if (amatch("else",4)==0) {
printlabel(flab1);col();nl();
return;
}
jump(flab2=getlabel());
printlabel(flab1);
col();
nl();
statement();
sp=modstk(fsp);
locptr=flev;
printlabel(flab2);
col();
nl();
}
Notice that 'flev' (an integer) and 'locptr' (a char *) are traded back and forth here... I believe char is still an 8-bit value in most cases, but int can be 16-bit, 32-bit, or even 64-bit depending on what you compile this with.
I wasn't really expect it to produce a valid executable or anything, especially since I'm not pulling in runtime libraries, but I can't even get it to spit out assembly mnemonics..
I think this just might be a dead end for the moment.
Last edited: