GithubHelp home page GithubHelp logo

Add a C-compiler about z80-playground-cpm-fat HOT 1 CLOSED

skx avatar skx commented on June 26, 2024
Add a C-compiler

from z80-playground-cpm-fat.

Comments (1)

skx avatar skx commented on June 26, 2024

Currently preferring AzTec's C compiler:

  • Fewer files.
  • Seems to work under emulation.
  • Have built working code with it.

We'll see if it's as good on real hardware, and then choose.

Links:

Sample code:

/* WRITE.c - Steve Kemp 2021
 *
 * Write some text to the specified file, arguments are space-separated,
 * with a trailing newline.
 *
 * Usage:
 *
 *    WRITE TEST.TXT This is a test
 *
 * Compilation:
 *
 *    CC WRITE
 *    AS WRITE
 *    LN WRITE.O T.LIB C.LIB
 *
 */

#include <stdio.h>


FILE *fp=NULL;
FILE *fp2=NULL;

#define TRUE 1
#define FALSE 0

main(argc, argv)
int argc;
char *argv[];
{
    int i = 0;
    FILE *fp=NULL;

    /* need at least prog + file + one argument */
    if ( argc < 3 ) {
        printf("Usage: %s path.ext text to write ..\n");
        exit(1);
    }

    /* open output file */
    fp = fopen( argv[1] );
    if ( fp == NULL )  {
        printf("Failed to open file for writing.\n");
        exit(1);
    }

    /* write each argument out */
    for( i = 2; i < argc; i++ ){
        fprintf(fp, "%s%s", argv[i], (i+1 < argc) ? " " : "\n" );
    }

    /* All done */
    fclose(fp);
    exit(0);
}

from z80-playground-cpm-fat.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.