1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-11 17:29:39 +00:00
Commit Graph

13 Commits

Author SHA1 Message Date
Flight_Control
1a53d6a913 - Refer .asm library imported global variables to the the namespace where the global variable resides.
- Generalized the AsmLibrary procedures to symbols, to also allow exporting variables.
- Removed the initialization part of .asm library header generation for global exported variables.
- The directive __asm_export can now also be used to indicate global variables exporting within C libraries (for potential .asm library generation).
- Converted the usage of typedef to struct for __conio global variable in cx16_conio.c
- Updated example code.
- Fixed a bug where for exported structs and imported structs, the variables were defined as volatile to non-volatile.
- VariableBuilder constructor now also received the program variable to refer to program level configurations defined.
- Remove to declare string constants as .asm library exported global variables.
- Removed the optimization PassNAsmLibraryGlobalVarsExport. It is not needed. Each global variable export must be explicitly declared using asm_export or __asm_export.
- Improved naming of variables and procedures to retrieve and manage import and export libraries within the program.
2024-04-26 12:44:28 +03:00
Flight_Control
00df07b7bf - Fixed test cases. Full retest of all test cases.
- Treat global variables of libraries, as part of the .asm library .namespace.
- Fix bugs.
- Assign meaningful struct names to .asm internal variables and labels. (Remove the $x notation).
2024-04-20 07:03:31 +03:00
Sven Van de Velde
e371d304f6 - Fixed test cases. Full retest of all test cases.
- Create the possibility of forward declaration of structs as part of the language.
- Generation of forward declarations in the .asm header files.
- Treat global variables as part of global memory, even in libraries. Ensure that globals are not overwritten when importing.
- Ensure that the various compilation models (stack, var, phi) in combination with the memory models (zp, mem) result in proper execution of code and proper memory allocation etc, etc.
- Added the lru-cache logic to properly test the compilation and memory model combinations. (A lot of bugfixes as a result!)
2024-01-16 08:06:14 +03:00
Sven Van de Velde
fab740f797 - Fix earlier manual merge mistakes.
- Fixed a couple of issues with AsmIdentifier.
- Global variables exported are volatile.
- Created proper generation of the protypes for exported global variables in _asm.h.
- Created new test cases.
- Struggled with the proper export of global struct variables, first version of it implemented but this will require rework ...
- There are issues with "types" of structures, will need more work in the future and a strategy for it...
- Made AsmLibrary functions as AsmExportLibrary to make the code more clear.
- Created isAsmExportLibraryGlobal and isAsmImportLibrary global functions.
2024-01-02 19:41:03 +01:00
Sven Van de Velde
d477cb9eae - New AsmImportLibrary class, for generating the #import statements.
- New AsmIdentifier class that replaces unallowed kickasm characters to an _.
- New AsmIgnoredImportInlinedKickAsm class, for creating the construct to ignore the body lines when the library is imported (used), and removed the #else clause (was confusing).
- Export of global variable in .asm Libraries (first version).
- Removal of constructor_for in .asm libraries.
- Reworked the way in assembler generation how link files are treated.
- Reworked all `replace("-","_")` areas using AsmIdentifier properly.
2024-01-01 16:57:48 +01:00
Sven Van de Velde
88dfeec3de - Now nesting of libraries works. Had to take care of the zero-page usage of nested procedures. The _asm.h file, containing the exported procedures contains the full zero-page usage, including the used (nested) procedures in the call graph of each exported procedure.
- Proper import mechanisms and naming.
- Ensure that .asm library files are imported only once!
- Added a new asm directory in kc folder, that contains library stub C files for .asm library generation.
- Fixed library startup initialization. .asm libraries are now also calling correctly the library init routines etc.
- Added new test cases.
2023-12-30 20:33:13 +01:00
Sven Van de Velde
5ac5eb159e - Added a new -A or -asmLibdir option to specify the path where to find the .asm files for import during pass4.
- Validate that an .asm library can be actually found within the path specifications of -A or in the current folder when importing a library using #pragma asm_import pre-processor command or __asm_import directive. If the .asm file cannot be found, throw a compile error with a very descriptive and helping message.
- Optimized the Program class, now containing a currentPath variable.
-
2023-12-19 09:58:08 +01:00
Sven Van de Velde
d75d96473c - Fixed a clobber test issue with alive variables that are in libraries (as parameters) and do not need a clobber test, as the library tested full clobber issues. The issue was fixed by not generating memory, zp or register usage for procedure parameters imported from .asm libraries. 2023-12-17 11:38:59 +01:00
Sven Van de Velde
30e6aff441 - Documentation for .asm libraries fixes.
- Asm library code debug fixes.
- Added test programs as explained in the documentation.
2023-12-15 14:51:18 +01:00
Sven Van de Velde
b9472afb31 - zeropages allocated for local variables, used in procedures exported to .Asm libraries, are also added as part of the function prototype using the directive __zp_reserve. 2023-12-13 17:19:01 +01:00
Sven Van de Velde
5436877fa0 Many Fixes and Additions:
- #820/29 - ensure that during pass4, namespaces are correctly labelled for variables.
- #820/30 - added option to only having to specify #pragma asm_library and the source file name will be used as the library name.
- #820/31 - remove the need for link files for libraries.
- #820/1 - Lots of optimizations
- Added lru-cache as a library in the library tests. It works!
- Added many tests
- Added conio example
- Added eightqueens example.
2023-12-12 08:21:28 +01:00
Sven Van de Velde
f98424ed97 - First well improved version for exporting and importing .asm library functions.
- Full documentation in the new manual directory containing the kickc.md markup manual file.
- library folder containing a concrete example.
2023-11-24 16:05:02 +01:00
Sven Van de Velde
1209353803 - Successful export and import of conio.
- TODO: Create header file for import.
- TODO: Resolve coalesce of exported procedure parameters.
- TODO: Remove constant optimizations for exported procedure parameters.
2023-11-18 10:40:50 +01:00