Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 2.27 KB

README.md

File metadata and controls

50 lines (31 loc) · 2.27 KB

C--

This is the Compiler for my small C-- (formerly TempleLang) Programming Language. It compiles to x64 with Windows 10.

Usage

To get the CLI, download a release or build from source.

To use the CLI, run ./TempleLang.CLI --help for help.

TempleLang.CLI 1.0.0
Copyright (C) 2020 TempleLang.CLI

  -f, --file        Required. File to compile.

  -t, --target      Path to place the .exe in.

  -r, --run         Run the generated executable upon successful compilation.

  -i, --printIL     Output the intermediate language to the target directory.

  -a, --printASM    Output the assembler to the target directory.

  --help            Display this help screen.

  --version         Display version information.

Prerequisites

NASM needs to be installed and the executable needs to be in the PATH variable.

LINK.EXE needs to be installed and in in the PATH variable. LINK.EXE comes with MSVC Build Tools, which you can get using the Visual Studio installer, however it will not be in your PATH variable and you will need to add it manually. It is typically located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\<VERSION>\bin\Hostx64\x64\link.exe. Check if this is the right install path and add it to your PATH variable.

While not necessarily required, the Windows SDK is needed to interact with the Windows kernel. It is currently required to install the Windows SDK to C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64, even if you're using a different Windows version. You can change this to a different path in the source code. The reason for this is that windows doesn't seem to properly add the SDK to the path and this is a "temporary" fix.

Example

See QuickSort for a small example of C-- code.

To compile it run ./TempleLang.CLI --file QuickSort.tl. The QuickSort example requires the Windows SDK to be installed. See Prerequisites for more info.