ccz80

Would you like to react to this message? Create an account in a few clicks or log in to continue.
ccz80

ccz80 programming language


2 posters

    ccz80 3.0.0

    avatar
    Dinoneno


    Posts : 115
    Join date : 2008-01-15
    Age : 53
    Location : Toledo

    ccz80 3.0.0 Empty ccz80 3.0.0

    Post  Dinoneno Wed Apr 14, 2010 6:17 am

    ccz80 3.0.0 (español)

    La principal novedad es que permite definir macros para utilizar en cualquier expresión. Esto permite por ejemplo usar tablas mediante índices, estructuras, tablas de estructuras, definir funciones cuyo contenido sea una fórmula y otras utilizaciones.

    Ejemplo para usar tablas:

    Code:
    include "spectrum.ccz80"; // o bien "cpc464.ccz80" o "msx.ccz80"
    define longitud = 10;
    array byte datos[longitud];
    define tabla(i) = (*(datos + i));
    byte n;
    for (n = 0; n < longitud; ++n) tabla(n) = n + 1;
    for (n = 0; n < longitud; ++n) { printb(tabla(n)); printc(' '); }
    pause(0); // Para CPC o MSX eliminar esta línea
    return;
    Ejemplo de función fórmula:

    Code:
    include "spectrum.ccz80"; // o bien "cpc464.ccz80" o "msx.ccz80"
    define media(a, b, c) = ((a + b + c) / 3);
    printw(media(1, 7, 10));
    pause(0); // Para CPC o MSX eliminar esta línea
    return;
    ccz80 3.0.0 (inglés)

    The main novelty is that it allows you to define macros for use in any expression. This allows for example to use arrays with indexes, structures, arrays structures, define functions whose content is a formula and other uses.

    Example for using tables:

    Code:
    include "spectrum.ccz80"; // or "cpc464.ccz80" or "msx.ccz80"
    define length = 10;
    array byte data[length];
    define table(i) = (*(data + i));
    byte n;
    for (n = 0; n < length; ++n) table(n) = n + 1;
    for (n = 0; n < length; ++n) { printb(table(n)); printc(' '); }
    pause(0); // For CPC o MSX remove this line
    return;

    Function example formula:

    Code:
    include "spectrum.ccz80"; // or "cpc464.ccz80" or "msx.ccz80"
    define average(a, b, c) = ((a + b + c) / 3);
    printw(average(1, 7, 10));
    pause(0); // For CPC or MSX remove this line
    return;

    ccz80 3.0.0 (français)

    La principale nouveauté est qu'il vous permet de définir des macros pour les utiliser dans n'importe quelle expression. Cela permet par exemple d'utiliser des tables avec des index, des structures, des tables de structures, définir des fonctions dont le contenu est une formule, et d'autres utilisations.

    Exemple d'utilisation des tables:

    Code:
    include "spectrum.ccz80"; // ou bien "cpc464.ccz80" ou "msx.ccz80"
    define longueur = 10;
    array byte donnees[longueur];
    define tableau(i) = (*(donnees + i));
    byte n;
    for (n = 0; n < longueur ; ++n) tableau (n) = n + 1;
    for (n = 0; n < longueur ; ++n) { printb(tableau (n)); printc(' '); }
    pause(0); // Pour le CPC ou MSX effacer cette ligne
    return;

    Exemple de formule de fonction:

    Code:
    include "spectrum.ccz80"; // ou bien "cpc464.ccz80" ou "msx.ccz80"
    define moyenne(a, b, c) = ((a + b + c) / 3);
    printw(moyenne(1, 7, 10));
    pause(0); // Pour le CPC ou MSX effacer cette ligne
    return;
    avatar
    poppichicken


    Posts : 37
    Join date : 2009-10-09

    ccz80 3.0.0 Empty Re: ccz80 3.0.0

    Post  poppichicken Thu Apr 15, 2010 7:01 pm

    Hi there.

    Sounds like a great update to ccz80!

    Would there be any speed increase when using version 3's array facilities, over the way arrays had to be done in previous versions (ie. variables and offsets)?

    I might have a go at recompiling 3d-maze using ccz80 version 3, and slowly changing the old style array usage to the new style...
    avatar
    Dinoneno


    Posts : 115
    Join date : 2008-01-15
    Age : 53
    Location : Toledo

    ccz80 3.0.0 Empty Re: ccz80 3.0.0

    Post  Dinoneno Thu Apr 15, 2010 7:33 pm

    poppichicken wrote:Hi there.

    Sounds like a great update to ccz80!

    Would there be any speed increase when using version 3's array facilities, over the way arrays had to be done in previous versions (ie. variables and offsets)?

    I might have a go at recompiling 3d-maze using ccz80 version 3, and slowly changing the old style array usage to the new style...

    Well, the macros are just a tool to make the code more readable, not really improve speed, only allow write a code easier to understand.

    Sponsored content


    ccz80 3.0.0 Empty Re: ccz80 3.0.0

    Post  Sponsored content


      Current date/time is Fri Apr 26, 2024 11:49 pm