Skip to content

Zpiler Windows x86_64 (emits MASM/GNU AS/ LLVM IR)

Latest

Choose a tag to compare

@LowLevelLore LowLevelLore released this 22 Jun 09:22
· 54 commits to main since this release
63b098d

Windows Release

Release v0.1 – Basic Compiler

Highlights:

  • Emit x86-64 (MASM (windows), GAS (linux), LLVM IR (linux)) Windows code from AST
  • Assemble with Microsoft’s ML64
  • Link with GCC (MinGW-w64)
  • Includes “Hello, World!” sample

Language Support

  • Support a variety of data types (builtins)
  • Supports various unary and binary operations
  • Supports various conditional operations
  • Supports user-defined functions
  • Supports linking to extern functions
  • Supports variadic extern functions
  • Functions implement canaries to detect stack corruption

Prerequisites

Usage

  1. Code

       extern fn printf(fmt: string, ...) -> int32_t;
    
       fn main() {
           printf("Hello Z!!\n");
       }
    
  2. Compile
    bash zpiler --format x86_64-mswin -o output.asm <path_to_source>

  3. Assemble
    bash ml64 /nologo /c <path_to_asm>

  4. Link
    bash gcc <path_to_object> -o temp.exe

  5. Run
    bash <path_to_exe>

Warning

By no means is this language perfect, it's just a toy project, use it at your own risk