Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCC - C compiler #419

Merged
merged 4 commits into from
Feb 15, 2017
Merged

KCC - C compiler #419

merged 4 commits into from
Feb 15, 2017

Conversation

larsbrinkhoff
Copy link
Member

@larsbrinkhoff larsbrinkhoff commented Feb 15, 2017

C;
KCC;
KCC.SY;
SYSENG; C INSERT
.INFO.; CC RECENT
EMACS1; C 1

C programs are linked with STINKR, see #418.

@larsbrinkhoff
Copy link
Member Author

@larsbrinkhoff
Copy link
Member Author

@eswenson1 Does KCC work in your ES-ITS? I get this:

*:c;cc -c hello c
hello:
ILOPR; 42>>-25,,757253   757253/   104,,154

HELLO C is just int main() { return 0; }

@eswenson1
Copy link
Member

`ES>:c;cc -c hello c
hello:

3: INVALID CHARACTER
3: INVALID CHARACTER
3: INVALID CHARACTER
3: INVALID CHARACTER
Can't Find 'c'.

:KILL EMACS◊J
ES>:c;cc -c hello

1: TITLE IS NOT A TYPE
2: HELLO: INVALID INITIALIZER TYPE
2: SYNTAX ERROR. PARSE SO FAR: <decl_specifiers>
<init_declarator_list> _ 10. . INSRT C ;
5: I GIVE UP

:KILL EMACS◊J
ES>`

@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Jan 31, 2017

I have now tested to copy several different sest of files to C, KCC, and KCC.SY. In all cases, C; TS CC fails to run. The failures are ILOPR or MPV, so I don't have much information to debug this.

I suspect there's a file missing in some other directory.

@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Feb 2, 2017

Trying to make progress...

If I set a breakpoint at ZMAIN+212, I see a call to ZEXECP. If I try to $^N that call, I get an error message:

Unrecognized Phase Option: ^@
Unable to execute phase ^?^A^A^A^B
ILOPR

@larsbrinkhoff
Copy link
Member Author

An xfile like this can relieve some pain:

:job kcc
:load c; ts cc
:cwd lars
:jcl -c test
zmain+212$b
$g

@larsbrinkhoff larsbrinkhoff mentioned this pull request Feb 4, 2017
@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Feb 15, 2017

Got it to work by combining AI: C; and MC: C; just like "Loki" said. I had to remove the DIR.LIST file though, because it overwrote some files with GFR links.

Tank you, @mattwyrm!

@larsbrinkhoff
Copy link
Member Author

Four versions of the C; [CLIB] library are needed. STINKER is linked against version 9. The binaries for the -C and -M compiler phases are linked against 11. The -LP phase is linked against 14. And the latest version is 16.

@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Feb 15, 2017

Testing can be done like this. First create a file called TEST C with e.g.

#include <c/stdio.h>
int main ()
{
  puts ("hello\n");
  return 0;
}

Compile it with :c;cc -c test. Assemble the output with :midas test midas.

To link it, create another file called C STINKR with

X C/LIB
L TEST
O TS.TEST

and run :stinkr c to get a ts test.

@larsbrinkhoff
Copy link
Member Author

Oh, and it doesn't work in SIMH!

Binary-only compiler and library, plus documentation and include files
for compiling new programs.
Copy link
Member

@eswenson1 eswenson1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't have source for kcc?

@larsbrinkhoff larsbrinkhoff merged commit 53f2a2e into master Feb 15, 2017
@larsbrinkhoff larsbrinkhoff deleted the lars/kcc branch February 15, 2017 18:27
@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Feb 15, 2017

There are a few files that I think are part of the C library. I don't know if it's a complete set.

  • C; C10JOB C
  • C; C10STD C
  • KCC; HUBMIO 1
  • KCC; HUMBLE 37
  • KCC; READ 1041
  • KCC; URT 1018

But I haven't seen anything at all for the compiler itself. But there are complete sources for a few TOPS-20 versions.

@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Feb 15, 2017

It seems we are missing source for C; C10SAV and both source and binary for C10BYT, C10CHS, C10EVL, C10FNM, C10IO, C10MIO, C10SRY. The only trace are links to backup tapes.

@larsbrinkhoff larsbrinkhoff added the source missing Flag that this program doesn't have source code. label Feb 28, 2017
@larsbrinkhoff
Copy link
Member Author

larsbrinkhoff commented Oct 17, 2018

To clarify: The files in the C directory aren't KCC, but Alan Snyder's C compiler. See #539.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c source missing Flag that this program doesn't have source code. todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants