Release notes

Version 0.8.6 Download release

This release improves standard C compatibility, adds support for the HUC6280 CPU and overflow of variables to main memory plus a ton of improvements and fixes.

Standard C Compatibility

    Updated syntax for pointer to function to match standard C void (*fn)(void). #661 (closed) #121 (closed)
    Removed support for the non-standard pointer to function syntax. #661 (closed)
    Updated syntax for const/volatile pointer to match standard C char * const ptr. #661 (closed)
    Implemented support for complex casts and parsing complex type names for sizeof(). #121 (closed)
    Added support for labels and goto. #687 (closed)
    Added support for silent truncation from int/long to char. #684 (closed)
    Added support for short / long / signed types (without int). #681 (closed)
    Added support for unsigned integer suffix U eg. `1234U. #682 (closed)
    Added support for sizeof without parentheses. #695 (closed)
    Added support for automatically converting function names to function pointers. #702 (closed)
    Added support for calling a pointer to function without(*). #692 (closed)
    Changed keyword 'export' into '__export'. #572 (closed)
    Removed low/high operators < and >. #221 (closed)
    Introduced BYTE0(x), BYTE1(x), BYTE2(x), BYTE3(x) for accessing bytes inside 16/32-bit values. #221 (closed) #667 (closed)
    Introduced WORD0(x), WORD1(x) for accessing words inside 16/32-bit values. #221 (closed) #667 (closed)
    Removed support for initializer lists for initializing word/dword. #668 (closed)
    Introduced MAKEWORD(h,l), MAKELONG(hw,lw), MAKELONG4(hh,hl, lh, ll) for constructing 16bit/32bit values. #668 (closed)
    Added support for character escape sequence '\0'. #642 (closed)
    Added support for character escape sequence '\\'. #504 (closed)
    Added support for int main(int argc, char **argv). #562 (closed)
    Added support for octal character encoding in strings and literal chars. #642 (closed)
    Added support for preprocessor stringize operator #. #721 (closed)
    Added support for || , && and ! in preprocessor expressions. #646 (closed)
    Added support for names of preprocessor macros with parameters to be used. #693 (closed)
    Added union syntax and support for very simple unions. Still need some work to support passing as parameters and more. #197

CPUs and Systems

    Added support for CPU HUC6280 used on PC Engine. See https://gitlab.com/jespergravgaard/kickassembler65ce02
    Updated LDQ z-indexing for CPU 45GS02 used in the MEGA65.
    Added support for VIC20 targets with +3k and +8k memory expansion. #728 (closed)
    Added ISR for VIC20 and Plus/4.

Commandline

    Added ``-vfixlongbranch` to give more info about the fix long branch pass.
    Added commandline option -Onolongbranchfix to disable long branch fixing. This is relevant when using the PCEAS assembler. #744 (closed)
    Added commandline option -struct_model to specify the struct model. #707 (closed)
    Improved error message when passing unknown platform to -t. #732 (closed)
    Fixed the problem with -o not being honored always. #644 (closed)

Standard Library and Example Programs

    Added strncmp() and strcmp(), memcmp(), memchr() and strncpy() to <string.h> #700 (closed) #699 (closed)
    Added support for snprintf() and sprintf(). #715 (closed) #698 (closed)
    Rewrote printf() to use a putc() function pointer. #698 (closed)
    Added NULL pointer to standard library. #647 (closed)
    Added doxygen standard library documentation https://camelot.gitlab.io/kickc/files.html #672 (closed)
    Added Improved VERA-lib for CX16 platform by Sven de Velde.
    Re-arranged example programs into platform folders.
    Added example of how to code a ROM in KickC using a linker file and a segment that is compiled but thrown away by the linker. #621 (closed)

Improvements and Fixes

    Added support for zeropage overflow to main memory when zeropage is exhausted. Allocation of zp/memory to variables is prioritized by the calculated weight of the variable. This ensures that the most used variables are kept on zeropage when variables spill over into main memory. #712 (closed) #753 (closed)
    Added a lot of missing ASM fragments. Thanks to Eric Majikeyric, Sven de Velde, Sebastian Palm, @IcePic, @CheekyBug.
    Fixed multiplication rewriting to shift/add to also support const*var. #201 (closed)
    Added support for passing NULL-parameters. #706 (closed)
    Added #pragma resource() for resource files not referenced in inline KickAsm (for instance in the linker file). #664 (closed)
    Updated to KickAss 5.24
    Added address-of handling for procedures converting them to stack call if they have parameters. #121 (closed)
    Added support for indirect calls to advanced expressions through a new fragment type. #708 (closed)
    Reserved ved tmp zeropage addresses (fc−fc−
    ff) on all target platforms. #737 (closed)
    Added support for non-relocatable main memory variables. #712 (closed)
    Improved sign extension in fragments.
    Improved error message during preprocessor expansion. #683 (closed)
    Added support for advanced indirect calls. Calls are now fragments. Added support for @outside_flow ASM tag placing ASM at the end of the current scope. Added support for expanding label names in ASM fragments. #708 (closed)
    Now synthesizing _deref_p..c. fragments using v..m. #674 (closed)
    Added proper error message on unknown struct member. #638 (closed)
    Intermediate variables are now affected by the var_model. #666 (closed)
    Added fallback to ZP-addressing if inline ASM instruction does not support absolute addressing. #673 (closed)
    ASM directives are no longer keywords (resource/uses/clobbers/bytes/cycles). #696 (closed)
    Added support for structs larger than 256 bytes. sizeof() now also changes to word when >256 bytes. #588 (closed)
    Pointers hard-coded to be located on zeropage (eg. char * const _s1 = (char*)0xee;) will now generate ZP-addressing mode ASM. #731 (closed)
    Added struct_model to platform .TGT-file. #716 (closed)
    Struct Array problems fixed with #pragma struct_model(classic). #590 (closed)
    #pragma struct_model(classic) fixes problem with variable instances of structs with array members. #587 (closed)
    Improved error on unfinished hex escape at end of string. #729 (closed)
    Improved parameter type errors to show expected and actual types. #703 (closed)
    Implemented OutputFileManager which ensures that the output directory, basename and extension follows well-defined rules. #663 (closed)
    Improved clobber handling in inline kickasm.
    Improved error message when using unknown variable. #622
    Fixed problem with macros with empty parameter lists. #688 (closed)
    Fixed problem where Variable used inside ASM is optimized to a constant. #618 (closed)
    Fixed problem with erroneously coalescing structs of same size/type affected by address-of. #632 (closed)
    Fixed missing include in conio on cx16. #616 (closed)
    Fixed error where identical strings could produce infinite loop. #626 (closed)
    Fixed problem with typedef enum. #686 (closed) #586 (closed)
    Fixed problem with constantifying struct initializers. #653 (closed)
    Fixed problem with escaping double quotes correctly in chars. #645 (closed)
    Fixed support for address-of on arrays. #662 (closed)
    Fixed problem with auto-casting parameters. #299 (closed)
    Fixed problem where constant bool return causes ASM compile error. #719 (closed)
    Fixed literal strings initializing char* in array or struct. #297 (closed)
    Fixed cast of reference to constant string. #298 (closed)
    Fixed problem with illegal call giving exception. #689 (closed)
    Fixed problem with struct containing char* member. #397 (closed)
    Fixed problem where pointer addition and constant consolidation could produce error "Type inference case not handled byte* + byte*". #669 (closed)
    Fixed NPE when compiling in the local directory. #671 (closed)
    Fixed exception "Block referenced, but not found in program" when encountering complex if(&&). #676 (closed)
    Fixed problem where SymbolTypeInference gave error messages without any line number.
    Fixed problem where mixing stack calls and phi calls mixes up variable versions. #745 (closed)
    Fixed problem with automatic C-file loading included the same file twice. #697 (closed)


Release notes

Version 0.8.5 Download release

This release adds support for the Commander X16 platform, improved XEX-binaries for the Atari XE/XL platform and a bunch of new features and fixes. There are a few breaking changes, but they are very minor such as adding a double underscore prefix to directive names.

This release contains very kind contributions by several people. Thank you very much for helping improve KickC!

    The Commander X16 VERA-library and conio-support was kindly contributed by Sven Van de Velde (@Flight_Control).
    Atari XEX-file support was created with significant contributions from Mark Fisher (@mark.j.fisher).
    A fix for literal number type resolving was kindly contributed by Travis Fisher (@travisfisher).
    GCC-compatible error output was contributed by Roy Jacobs (@RoyJacobs).
    Support for expressions in __address() directive was contributed by Andrzej Śliwa (@andrzejsliwa).
    A fix to a compiler exception was contributed by Sijmen Schoon (@SijmenSchoon)
    Improved and missing asm-fragments were supplied by Janne Johansson (@IcePic), Travis Fisher (@travisfisher), Mark Fisher (@mark.j.fisher) and G. B. (@agpxnet).

Changes

    Added Commander X16 platform target #pragma target(cx16) including linker-files, header-files and example programs. #581 (closed)
    Added <conio.h> support and <veralib.h> for Commander X16 platform. Thanks to @Flight_Control. #606 (closed)
    Added Atari XEX-file support to the Atari XE/XL platforms. Thanks to @mark.j.fisher #614 (closed)
    Included kickass-plugin-atari-xex to support Atari XEX format. See https://gitlab.com/jespergravgaard/kickass-plugin-atari-xex #614 (closed)
    Added <mega65-dma.h> library with DMA-based memcpy()/memset() methods.
    Added support for ROM and hardware interrupts on the different platforms. #599 (closed)
    Added support for interrupts that only save/restore clobbered registers. #599 (closed)
    Changed the align() directive to __align() for better standard C compliance. #600 (closed)
    Added __address() directive supporting placement of arrays at fixed memory addresses. #217 (closed) #211 (closed)
    Allowed constant expressions in __address() directive. Thanks to @andrzejsliwa #596 (closed)
    Changed #pragma pc to #pragma start_address. Platform linker files respect the program start address. Default start address added to platform target files. #574 (closed)
    Embraced KickAss segments (removed support for ASM without segments.) #465 (closed)
    Included kickass-cruncher-plugins to support crunching and decruncing. See https://github.com/p-a/kickass-cruncher-plugins #603 (closed)
    Added examples programs demonstrating ByteBoozer and Exomizer crunchers and decrunchers. #603 (closed)
    Added string suffixes for ASCII, ATASCII and SCREENCODE_ATARI encodings. #575 (closed)
    Changed C64 VIC II constant names in <mos6569.h> header file.
    Now Generating GCC compatible error output giving clickable errors in VS.code. Thanks to @RoyJacobs. #551 (closed)
    Upgraded to KickAsm 5.17 #609 (closed)
    Added -Xassembler commandline option that passes options to the assembler. #530 (closed)
    Added support for @nooptimize ASM tag instructing the compiler to not optimize the ASM. #599 (closed)
    Improved error message when the emulator cannot be found. #506 (closed)
    Improved support for structs containing arrays treat them like pointers. #312 (closed)
    Improved fragment synthesizer to generate more optimal fragments. #578 (closed)
    Fixed problem with literal integer types not resolved to fixed size integer type. Thanks to @travisfisher #594 (closed) #334 (closed) #199 (closed)
    Fixed problem where local variables were not shadowing global functions with the same name. #597 (closed)
    Fixed problem where ASM resources were not updated in the output-dir when the source file is modified. #495 (closed)
    Fixed problem with absolute file names not working on command line. #576 (closed)
    Fixed exception when declaring array with a constant that does not exist. Thanks to @SijmenSchoon #607 (closed)
    Fixed error in pointer fragment. Thanks to @mark.j.fisher. #591 (closed)
    Fixed error in right shift fragments. Thanks to @travisfisher. #604 (closed)
    Improved fragment for if(0!=x). Thanks the @IcePic #514 (closed) #598 (closed)
    Added missing fragments. Thanks to @travisfisher, @IcePic, @agpxnet #293 (closed) #577 (closed) #585 (closed) #449 (closed)

Release notes

Version 0.8.4 Download release

This release adds conio.h support for Atari XL/XE and improves conio.h on Commodore platforms. It fixes a lot of bugs and and adds a lot of new/improved ASM fragments.

    Added Atari XL conio.h implemented by @mark.j.fisher. #546 (closed)
    Initializing conio.h/stdio.h cursor position on C64/VIC20/PLUS4/MEGA65. #521 (closed)
    Renamed sinus.h to sine.h. #565 (closed)
    Added __KICKC__ define always set by compiler. #523 (closed)
    Added command line option -Xassembler for passing options to the assembler. #530 (closed)
    Added support for declaring a const pointer placed at a hardcoded zeropage-address __address(0xfc) char * zp2 = 0x0400;. #563 (closed)
    Variables used in ASM is now automatically converted to volatile if they are not const. Beware that char * const var; and char * volatile var; will behave quite differently when used in ASM. #554 (closed)
    Fixed ATASCII newline encoding. #526 (closed)
    Fixed preprocessor handling of #define with a body starting with left parenthesis. #518 (closed)
    Fixed problem with inner compound assignment using arrays with elements with size>1 resulting in bad code. #519 (closed)
    Fixed problem with constant references causing a Java exception. #540 (closed)
    Fixed problem with post-incrementing an expression causing a Java exception. #538 (closed)
    Fixed problem with using the same resource in two inline kickasm statements causing compiler failure. #537 (closed)
    Fixed problem with block sequence problem in nested infinite loop. #547 (closed)
    Fixed problem with using variables and parameters in inline asm by preventing them from being allocated to registers. #554 (closed) #553 (closed)
    Fixed problem where a constant parameter can cause exception. #561 (closed)
    Fixed problem where zp_reserve was not being honoured after using __address. #550 (closed)
    Fixed problem with deleting temporary directories on Windows. #493 (closed)
    Fixed problem with boolean constant comparison (false!=false). #527 (closed)
    Optimized reuse of index*sizeof() when used multiple times inside a loop. #525 (closed)
    Optimized reuse of balls + i*SIZEOF_STRUCT_BALL when using ball[i] and a 16bit i. #525 (closed)
    Added Makefile for ease of compilation. #520 (closed)
    Improved error message when assuming type of symbol. #517 (closed)
    Improved readability of command line option -v. #534 (closed)
    Improved error message when the emulator cannot be found. #506 (closed)
    A lot of new and improved ASM fragments. Thanks @mark.j.fisher, @ubik, @Wraithchild and @Memblers #555 (closed) #553 (closed) #550 (closed) #544 (closed) #543 (closed) #542 (closed) #539 (closed)

Release notes

Version 0.8.3 Download release

This release adds support for MEGA65 and Atari XE/XL platforms. It also adds support for 65CE02 and 45GS02 CPU's and ASCII and ATASCII charset encodings.

    Added mega65 platform target which generates a MEGA65 executable PRG. Use #pragma target(mega65) or commandline option -t mega65 to select it. #507 (closed)
    Added mega65_c64 platform target which generates a MEGA65 executable PRG starting in go64-mode. #pragma target(mega65_c64) or commandline option -t mega65_c64 to select it. #507 (closed)
    Added H-files for mega65 platform chipset, including DMAgic, VIC-III/IV. Use #include <mega65.h>.
    Added a rewrite of the mega65 demo raster65 in KickC to /examples/mega65/.
    Added examples of DMA and memory bank remapping to to /examples/mega65/.
    Added MEGA65 conio support. #507 (closed)
    Added Atari XL/XE platform target generating a binary XEX-file. Use #pragma target(atarixl) or commandline option -t atarixl to select it. Also added a few example programs in /examples/atarixl/. #499 (closed)
    Added H-files for Atari 8-bit chipset ANTIC/GTIA/POKEY. Use #include <atari-xl.h>. #501 (closed)
    Added Atari 8bit string encodings ATASCII and screencoce_atari. Use #pragma encoding(atascii) or #pragma encoding(screencode_atari) to select them. #500 (closed)
    Added string encoding ASCII support. Use #pragma encoding(atascii) or #pragma encoding(ascii) to select it. #263 (closed)
    Added support for specifying default string encoding in platform definition. Added default encoding to supported platforms. #503 (closed)
    Improved program initialization. Now using __start() which calls __init() and main(). #257 (closed)
    Added #pragma constructor_for(constructor, proc1, proc2, ...) useable for defining init-code in libraries which is called during program start-up before main(). #416 (closed)
    Added support for __address() on arrays for specifying a hardcoded memory address. Removed support for pc parameter on inline kickasm. #480 (closed)
    Updated to KickAssembler 5.16-65CE02 (my own hacked version). This adds support for CPU's 65CE02 and 45GS02. Use #pragma cpu(csg65ce02) or #pragma cpu(mega45gs02) to select them. See https://gitlab.com/jespergravgaard/kickassembler65ce02
    Added some fragments for 65CE02 and 45GS02 utilizing the new Z register and addressing modes.
    Added support for CPU 65C02. Use #pragma cpu(wdc65c02) to select it.
    Added support for specifying default CPU in platform definition. Added default CPU to supported platforms.
    Removed support for inline kickasm in the global scope. Now only kickasm inside functions (code) or kickasm as initializer for arrays is supported. #479 (closed)
    #pragma now unknown pragmas. #324 (closed)
    #pragmas can now both be parenthesized or non-parenthesized. For instance #pragma target vic20 is now the same as #pragma target(vic20) #512 (closed)
    Added support for empty statements including loops with just a semicolon for body. #395 (closed) #267 (closed)
    Added support for trailing commas in initializer lists. #393 (closed)
    Added support for ranged for-loop with an undeclared loop variable. #333 (closed)
    Fixed problem where functions without body produced an empty block.
    Fixed problem with post increment inside conditions. #486 (closed)
    Fixed problem with empty for() condition and non-empty increment. #488 (closed)
    Fixed problem with casting negative 8-bit numbers to 16-bit. #496 (closed)
    Fixed wrong size of padding for non-byte arrays. #497 (closed)
    Compiling the KickC compiler can now be done using OpenJDK. #477 (closed) #358 (closed)
    Updated java libraries used for compiling the KickC compiler.
    Added fragment system handling of CR / CRLF to make fragment cache platform independent. #490 (closed)
    Improved ASM fragments for pointer to pointer by retaining type information. #484 (closed)
    Added missing ASM fragments and improved others. Thanks to @steph72 and @IcePic.
    Fixed error in fragment vbuaa=vbuaa_ror_6. Thanks to @agpxnet

Release notes

Version 0.8.2 Download release

This release significantly improves support for different target platforms with 6502-based CPU. This includes linker-files, header-files and examples for Atari 2600, Nintendo Entertainment System (NES), Commodore Plus/4, Commodore VIC 20 and Commodore 64. The release also optimizes the ASM generation by using a cache (10%-30% faster compilation).

    #pragma target(xxx) now reads the target platform configuration from a .tgt-file in JSON (from the new /target-folder). The .tgt platform configuration file defines the CPU, linker configuration, #defines, output-file extension, emulator, reserved zeropage and variable memory model.
    Added a CPU-specific fragment cache. The fragment cache increases performance by 10%-30%. The CPU-specific fragment cache is included in the release, automatically adds any fragments your local code uses and is automatically rebuilt if any local fragment file is edited/added. #469 (closed)
    Added Plus/4 target platform and headers containing all IC's and I/O addresses. (Thanks to Carrion of Bonzai!) #436 (closed)
    Added VIC 20 target platform and headers containing all IC's and I/O addresses.
    Added Atari 2600 target platform and headers containing all IC's and I/O addresses.
    Added NES target platform and headers containing all IC's and I/O addresses.
    Added sample Atari 2600 programs.
    Added sample NES programs. #456 (closed)
    Added sample Plus/4 program.
    Added pseuso random number generator rand() and srand() to <stdlib.h>. #434 (closed)
    <conio.h> and <stdio.h> now work together (printf() now uses conio output routines).
    Added several improvements to the <conio.h> implementation
    Added <conio.h> support for Plus/4 and VIC 20.
    Added support for #pragma emulator() specifying which emulator to execute.
    Added support for -emu command-line option specifying which emulator to execute.
    Added support for controlling output file extension using #pragma extension("xxx"), property "extension" in the target platform file or command-line option -oext. #446 (closed)
    Added support for reserving ZP ranges using ..-syntax #pragma zp_reserve(0x00..0x1f, 0x22). Changed name of #pragma and function directive to zp_reserve() and __zp_reserve(). #238 (closed)
    Added support for reserved ZP variables in the target platform .tgt file. #447 (closed)
    Added -Dname=body and -Dname command-line option for defining macros on the command line.
    Upgraded to KickAss 5.15. #459 (closed)
    Added support for #error. #440 (closed)
    Moved #include to the preprocessor. Fixed problem where #include does not respect #if. #442 (closed)
    Introduces void-pointer ASM fragment synthesis. This enables removal of a lot of pointer fragments. #449 (closed) #467 (closed)
    Added missing ASM fragments and improved some existing ASM fragments. Thanks to Janne Johansson @IcePic and G. B. @agpxnet. #449 (closed), #349 (closed)
    Optimized some of the compiler data structures.
    Fixed problem where tmp-folders were not deleted properly. #370 (closed)
    Fixed String consolidation problem with local labels shadowing global labels. #472 (closed)
    Fixed problem with size calculation of arrays inside structs. #458 (closed)
    Fixed problem with incorrect parenthesising of non-associative binary operators in constant expressions. #450 (closed)
    Fixed exception when using a return value from a void function.
    Fixed problem where anonymous structs failed.
    Fixed error in fragment. #462 (closed)
    Fixed bug when using 2 function pointers in one block. #463 (closed)
    Fixed problem where an unused assigned variable is not taken properly into account when deciding whether it is possible to coalesce two variable live range equivalence classes. #464 (closed)
    Fixed the a parenthesis issue in fragments. #470