-
released this
2026-02-07 11:02:18 +00:00 | 10 commits to main since this release⚠️ IMPORTANT
To make it work, you MUST run
setup.batas Administrator! (This adds PCC to your system PATH so the compiler can find the Standard Library).🚀 v0.0.5-beta - Preprocessor, Standard Library & x64 Assembly
This major update transforms PCC from a simple interpreter into a fully modular native compiler ecosystem. It introduces the Preprocessor (for
#include), a Standard Library, and expands mathematical capabilities using real x64 Assembly.✨ New Features
- Preprocessor System: Added support for
#include "file.pcc"(local files) and#include <lib.pcc>(system libraries). - PCC Standard Library (
std/): The compiler now ships with a built-instdfolder. Includedstd/math.pccprovides functions likemath_abs,power,cube, andsquare. - Expanded Math Operations: The compiler now natively generates Assembly for Multiplication (
*) and Subtraction (-), in addition to Addition. - Smart Path Resolution: The compiler automatically locates the
std/folder relative to thePCC.exelocation, allowing you to compile projects from any directory. - Function Arguments & Returns: Complete support for passing parameters (e.g.,
int add(int a, int b)) and returning values via the stack. - Recursion Support: Functions can now call themselves (e.g., the
powerfunction in std lib), thanks to proper stack frame management. - Interactive I/O: Added
input()function (wrapping systemgetchar) to pause execution and accept user input.
🛠 Architecture & Refactoring
- Modular Codebase: Split source code into distinct modules:
parser,codegen,preprocessor, andutils. - Local Scope & Stack Memory: Variables are now allocated on the stack (
[rbp-offset]) enabling true function scope. - Runtime Evaluation: Math expressions are translated to x64 Assembly instructions (
IMUL,SUB,ADD,CMP) executed by the CPU. - x64 Convention: Implemented Windows x64 calling convention elements (using
RCX,RDXfor argument passing).
🐛 Bug Fixes
- NASM Reserved Keywords: Fixed a crash where functions named
absorabsoluteconflicted with Assembly directives (renamed tomath_absin std). - Intermediate Variables: Fixed a critical bug where variables created during math operations (e.g.,
res = x * x) were not assigned stack memory correctly. - Parser Logic: Fixed issues with nested
ifblocks and function closing braces (}) that caused code to merge incorrectly. - Operand Size Mismatch: Fixed NASM errors by implementing
movsxdfor proper 32-bit to 64-bit integer promotion.
📦 How to use:
- Download the latest release from the Assets section below.
- Unzip the archive to
C:/PCC/. - Run
setup.batas Administrator. - Compile your code from anywhere:
PCC.exe game.pcc
Downloads
- Preprocessor System: Added support for