Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
<p class="site-description">{{ site.description | escape }}</p>
<nav class="site-nav" aria-label="Documentation">
<a href="{{ '/' | relative_url }}"{% if page.url == '/' or page.url == '/index.html' %} aria-current="page"{% endif %}>Overview</a>
<a href="{{ '/zasm-reference.html' | relative_url }}"{% if page.url == '/zasm-reference.html' %} aria-current="page"{% endif %}>Language reference</a>
<a href="{{ '/zasm-examples.html' | relative_url }}"{% if page.url == '/zasm-examples.html' %} aria-current="page"{% endif %}>Examples</a>
<a href="{{ '/zasm-coming-soon.html' | relative_url }}"{% if page.url == '/zasm-coming-soon.html' %} aria-current="page"{% endif %}>Roadmap</a>
<a href="{{ '/zasm/ZASM-Reference.html' | relative_url }}"{% if page.url == '/zasm/ZASM-Reference.html' %} aria-current="page"{% endif %}>Language reference</a>
<a href="{{ '/zasm/ZASM-Mnemonics.html' | relative_url }}"{% if page.url == '/zasm/ZASM-Mnemonics.html' %} aria-current="page"{% endif %}>Mnemonics</a>
<a href="{{ '/zasm/ZASM-Examples.html' | relative_url }}"{% if page.url == '/zasm/ZASM-Examples.html' %} aria-current="page"{% endif %}>Examples</a>
<a href="{{ '/zasm/ZASM-Coming-Soon.html' | relative_url }}"{% if page.url == '/zasm/ZASM-Coming-Soon.html' %} aria-current="page"{% endif %}>Roadmap</a>
<a href="{{ '/building.html' | relative_url }}"{% if page.url == '/building.html' %} aria-current="page"{% endif %}>Build from source</a>
</nav>
</header>
Expand Down
2 changes: 1 addition & 1 deletion docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The build fails if any sample fails. Generated sample executables go to
compiled without launching them, so MessageBox samples require no interaction.
The validator supplies the repository's `include` directory to the managed
compiler with `-I`. Tests copy the shared headers beside their compiler output.
See [Using included files](Zero-Assembly-Include-Files.md) for syntax and search order.
See [Using included files](zasm/ZASM-Include-Files.md) for syntax and search order.

After building the solution, run the validator separately with:

Expand Down
2 changes: 1 addition & 1 deletion docs/designs/ZSRC-v0.3-POC-Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> **Coming Soon: higher-level Zero.** This page explores proposed `.zsrc`, `.zero`
> syntax; it is not a runnable example for the current compiler.
> See the [documentation home](../index.md) and [working ZASM examples](../zasm-examples.md).
> See the [documentation home](../index.md) and [working ZASM examples](../zasm/ZASM-Examples.md).

In the next generation of Zero, we are re-aligning with the original design specifications and proof-of-concept.

Expand Down
60 changes: 47 additions & 13 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,46 @@ title: Zero Compiler
Zero is a compiler project for the Zero programming language and **Zero Assembly
(ZASM)**. ZASM is the working assembly language today: write x86 instructions,
define data, share headers, call Windows DLL functions, or use Linux syscalls.
The higher-level Zero language is under design; see [Coming Soon](#coming-soon).

![](images/zero-logo.png)

> Higher-level Zero language (`.zsrc`) is under redesign.\
> See, [Coming Soon](#coming-soon).

[Download Zero](https://github.com/SuessLabs/ZeroCompiler/releases/latest) ·
[Getting started](#getting-started-with-zasm) ·
[Language reference](zasm-reference.md) ·
[Examples](zasm-examples.md) ·
[Language reference](zasm/ZASM-Reference.md) ·
[Mnemonic support](zasm/ZASM-Mnemonics.md) ·
[Examples](zasm/ZASM-Examples.md) ·
[Debugger](debugger/index.md) ·
[Source code](https://github.com/SuessLabs/ZeroCompiler)

## About

The Zero programming language and compiler project (_AKA: Null Compiler_). **Zero** is a simple, fast, and efficient programming language for the x86-64 architecture.

The compiler generates Windows x86 PE32 console executables (including programs
that create Windows GUI controls) and static Linux x86-64 ELF64 executables using
syscalls. Shared-library ELF linking, DLL output, additional architectures, macOS,
and STM32 remain future work. See [Linux x86-64 support](docs/linux64.md).

## Zero Language Suite

* **Zero** - _Zero Assembly and command line compiler tooling (Zero.Cli)_
* **Zero.Ide** - _Integrated Development Environment with debugger support_
* **Zero.Dbg** - _Debugger_

![ZIDE](images/Zero.IDE-Sample-1.png)

### File Types

| Ext | File Type |
|-|-|
| `.zasm` | Zero assembly source file |
| `.zh` | Zero (_assembly_) header file |
| `.zsrc` | Zero language source file (_coming soon_) |
| `.zero`, `.zproj` | Zero project/workspace file (_coming soon_) |

## What Zero Supports Today

| Feature | Current support |
Expand Down Expand Up @@ -156,7 +187,7 @@ requires the caller to remove the argument with `add esp, 4`.

Use `-h` or `--help` for help. `--include` is an alternative to `-I`.
A compilation failure prevents `run` from executing an older output file.
See the [reference for command options and error codes](zasm-reference.md#command-line-and-errors).
See the [reference for command options and error codes](zasm/ZASM-Reference.md#command-line-and-errors).

## ZASM Language at a Glance

Expand All @@ -167,6 +198,9 @@ Semicolons start comments outside quoted strings; they are not required terminat

### Mnemonics

See the [mnemonic support inventory](zasm/ZASM-Mnemonics.md) for categories,
supported operand forms, and missing instructions across Windows PE and Linux ELF.

| Group | Supported mnemonics | Example |
| --- | --- | --- |
| Data and addresses | `MOV`, `LEA` | `mov eax, 42` |
Expand All @@ -180,7 +214,7 @@ Semicolons start comments outside quoted strings; they are not required terminat

The table above summarizes Windows x86. See [Linux x64 instruction forms](linux64.md#essential-amd64-instructions)
for 64-bit registers, memory stores, indirect calls, and `SYSCALL`.
Only the operand forms listed in the [instruction reference](zasm-reference.md#instruction-reference)
Only the operand forms listed in the [instruction reference](zasm/ZASM-Reference.md#instruction-reference)
are supported. For example, `mov eax, 42` and `mov eax, [value]` work;
register-to-register `MOV` and memory stores are Coming Soon.

Expand All @@ -197,7 +231,7 @@ register-to-register `MOV` and memory stores are Coming Soon.

The current instruction forms use the 32-bit registers **EAX, EBX, ECX, EDX,
ESI, EDI, EBP, and ESP**. Other widths and SIMD registers are future work.
See [register roles and memory addressing](zasm-reference.md#registers).
See [register roles and memory addressing](zasm/ZASM-Reference.md#registers).

### Directives, Labels, and Statements

Expand All @@ -218,15 +252,15 @@ The first emitted byte is the entry point; the name `start` has no special meani

Include search order is the current working directory, then each `-I` directory,
then `include` beside the compiler. Nested headers use the same search order.
See [Using included files](Zero-Assembly-Include-Files.md) for nested headers,
See [Using included files](zasm/ZASM-Include-Files.md) for nested headers,
cycle detection, source locations, and library integration.

Read the [full ZASM reference](zasm-reference.md) for strings, labels, instruction
Read the [full ZASM reference](zasm/ZASM-Reference.md) for strings, labels, instruction
forms, imports, calling conventions, and current limitations.

## Examples and Tutorials

Start with the [complete basic examples](zasm-examples.md): console text, integer
Start with the [complete basic examples](zasm/ZASM-Examples.md): console text, integer
addition with formatted output, and a Windows MessageBox. Each includes a command
and expected behavior.

Expand All @@ -246,7 +280,7 @@ From the release folder, also try:
- [Linux x86-64 and ELF64](linux64.md): compile and run a syscall-based Linux console application.
- [Linux header drafts](linux-headers.md): future glibc interfaces and architecture-specific syscall references.
- [Header catalog](https://github.com/SuessLabs/ZeroCompiler/blob/master/include/readme.md): all shipped `.zh` files and calling rules.
- [Assembly overview and opcodes](Zero-Assembly-Intro.md): a compact companion to the language reference.
- [Assembly overview and opcodes](zasm/ZASM-Intro.md): a compact companion to the language reference.

## Build and Contribute

Expand All @@ -259,14 +293,14 @@ validates every ZASM sample, and publishes `zero.exe`, `include`, and
- [Project background and original language ideas](readme.md): history and proposed higher-level syntax.
- [Future formats and architectures](designs/Future-Formats-and-Targets.md): shared parsing with separate target backends.
- [ZSRC console proof of concept](designs/ZSRC-v0.3-POC-Console.md): a future high-level language example.
- [Assembly syntax sandbox](Zero-Assembly-PoC-Sandbox.md): experimental proposals, including directives that are not implemented.
- [Assembly syntax sandbox](zasm/ZASM-vNext-Sandbox.md): experimental proposals, including directives that are not implemented.

The reference describes the current compiler. Historical examples and design
proposals are labeled separately so they can evolve without implying support today.

## Coming Soon

See the [ZASM feature roadmap](zasm-coming-soon.md) for implemented assembly
See the [ZASM feature roadmap](zasm/ZASM-Coming-Soon.md) for implemented assembly
features, proposed key features, and nice-to-have improvements.

These are documentation placeholders and development ideas, with no promised release date.
Expand All @@ -286,5 +320,5 @@ They are not current compiler capabilities.
| More tutorials | **Coming Soon:** loops, reusable procedures, stack frames, and a step-by-step controls application. |

Contributors can replace these placeholders with tested syntax and examples as
features become available. See the [reference's limitations](zasm-reference.md#current-limitations)
features become available. See the [reference's limitations](zasm/ZASM-Reference.md#current-limitations)
before adapting assembly from another assembler.
2 changes: 1 addition & 1 deletion docs/linux-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ The build ships both platform directories. Windows samples use
`using "windows/..."`; `linux64-cli-01-hello.zasm` uses direct syscalls and no libc
header. For fuller notes, see the
[Linux header README](https://github.com/SuessLabs/ZeroCompiler/blob/master/include/linux/readme.md)
and [ZASM roadmap](zasm-coming-soon.md).
and [ZASM roadmap](zasm/ZASM-Coming-Soon.md).
2 changes: 1 addition & 1 deletion docs/linux64.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Linux x86-64 and ELF64
# Linux x86-64 and ELF64

[Documentation home](index.md) · [Linux header drafts](linux-headers.md) ·
[ZASM reference](zasm-reference.md)
[ZASM reference](zasm/ZASM-Reference.md) · [Mnemonic support](zasm/ZASM-Mnemonics.md#linux-elf-x64)

Zero can generate static Linux x86-64 ELF64 executables from Windows or Linux.
This first backend uses Linux syscalls directly: no libc, dynamic interpreter,
Expand Down
4 changes: 2 additions & 2 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

> **Background and design notes:** the examples below include proposed syntax
> that is not implemented. For working ZASM syntax, start with the
> [documentation home](index.md), [language reference](zasm-reference.md), and
> [basic examples](zasm-examples.md). Higher-level `.zsrc` compilation is Coming Soon.
> [documentation home](index.md), [language reference](zasm/ZASM-Reference.md), and
> [basic examples](zasm/ZASM-Examples.md). Higher-level `.zsrc` compilation is Coming Soon.

Welcome to the Zero Compiler

Expand Down
3 changes: 3 additions & 0 deletions docs/tutorial-zasm-concat.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Joining strings in Zero Assembly

[Documentation home](index.md) · [Language reference](zasm/ZASM-Reference.md) ·
[Mnemonic support](zasm/ZASM-Mnemonics.md)

[win-cli-05-string-concat.zasm](../samples/Windows/win-cli-05-string-concat.zasm) prints two pieces of text, then
joins them with a space. Joining strings is called **concatenation**.

Expand Down
6 changes: 3 additions & 3 deletions docs/windows-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ title: Windows API Headers

# Windows API Headers

[Documentation home](index.md) · [Include syntax](Zero-Assembly-Include-Files.md) ·
[Language reference](zasm-reference.md)
[Documentation home](index.md) · [Include syntax](zasm/ZASM-Include-Files.md) ·
[Language reference](zasm/ZASM-Reference.md)

ZASM ships curated `.zh` headers for common Windows DLLs. They contain `#IMPORT`
declarations, so your program can share library imports instead of repeating them.
Expand Down Expand Up @@ -133,4 +133,4 @@ export tables without calling any of those APIs.
- Manifest/resource support for common-controls version 6 visual styles.

These headers supply imports today; they do not implement the language features
listed above. Track those separately in the [ZASM roadmap](zasm-coming-soon.md).
listed above. Track those separately in the [ZASM roadmap](zasm/ZASM-Coming-Soon.md).
22 changes: 11 additions & 11 deletions docs/zasm-coming-soon.md → docs/zasm/ZASM-Coming-Soon.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ title: ZASM Feature Roadmap

# ZASM Feature Roadmap

[Documentation home](index.md) · [Language reference](zasm-reference.md) ·
[Basic examples](zasm-examples.md)
[Documentation home](../index.md) · [Language reference](ZASM-Reference.md) ·
[Basic examples](ZASM-Examples.md) · [Mnemonic support](ZASM-Mnemonics.md)

This page tracks what Zero Assembly can do today and the features to consider
next. **Implemented** describes working capabilities. **What's Next** lists
Expand All @@ -16,13 +16,13 @@ commitments; their syntax and implementation order still need to be decided.

## Implemented

Support applies to the operand forms in the [language reference](zasm-reference.md),
Support applies to the operand forms in the [language reference](ZASM-Reference.md),
not every form offered by other x86 assemblers. A mnemonic or register constant
in the compiler source does not by itself mean its instruction encoding works.

### Instructions and Registers

- [x] [Linux x86-64 ELF64 backend](linux64.md): static executables, essential 32/64-bit AMD64 encodings, extended registers, RIP-relative addresses, stores, and `SYSCALL`.
- [x] [Linux x86-64 ELF64 backend](../linux64.md): static executables, essential 32/64-bit AMD64 encodings, extended registers, RIP-relative addresses, stores, and `SYSCALL`.
- [x] Shared parser with separate architecture encoders and PE/ELF writers; explicit target selection and host compatibility checks.

- [x] Windows x86 (32-bit) instruction encoding and PE32 executable output.
Expand Down Expand Up @@ -56,16 +56,16 @@ emitted byte is the program entry point.
- [x] Include search order: working directory, ordered `-I`/`--include` paths, then `include` beside the compiler.
- [x] Include-cycle diagnostics, searched-path errors, and original filename/line reporting for included source.
- [x] Shipped `windows/console.zh` and `windows/windows.zh` headers.
- [x] [DLL-specific Windows API headers](windows-headers.md) for controls/dialogs, drawing, core OS services, shell, sockets, security, COM, HTTP, and other utilities.
- [x] [DLL-specific Windows API headers](../windows-headers.md) for controls/dialogs, drawing, core OS services, shell, sockets, security, COM, HTTP, and other utilities.
- [x] Platform folders: working Windows imports under `include/windows`; draft glibc headers and comment-only syscall references under `include/linux`.
- [x] `#IMPORT dll, function[, ...]` declarations and PE import table generation.
- [x] Plain imported function names such as `call [puts]`, with backward-compatible and DLL-qualified aliases.
- [x] `zero.exe`, compile-only mode, and compile-and-execute `run` mode.
- [x] Native AOT publishing with headers and samples beside the compiler.
- [x] Build-time sample compilation, sample discovery in unit tests, and selected Windows runtime checks.

See the [include guide](Zero-Assembly-Include-Files.md),
[build guide](building.md), and [sample guide](https://github.com/SuessLabs/ZeroCompiler/blob/master/samples/readme.md).
See the [include guide](ZASM-Include-Files.md),
[build guide](../building.md), and [sample guide](https://github.com/SuessLabs/ZeroCompiler/blob/master/samples/readme.md).

## What's Next

Expand Down Expand Up @@ -145,7 +145,7 @@ These ideas can follow the core assembler work or be developed independently.

### More Targets and Executable Formats

[Linux libc drafts](linux-headers.md) are available for planning. Static syscall-only
[Linux libc drafts](../linux-headers.md) are available for planning. Static syscall-only
Linux ELF64 output is implemented; shared-library linking remains future work.

- [ ] **Windows x64:** PE32+ output and the Windows x64 ABI; essential AMD64 encoding exists for Linux x64.
Expand All @@ -154,17 +154,17 @@ Linux ELF64 output is implemented; shared-library linking remains future work.
- [ ] **Additional platforms:** define supported architecture, format, and ABI combinations before exposing target options.

Changing the compiler's own host runtime does not change its generated target.
See [Future formats and architectures](designs/Future-Formats-and-Targets.md)
See [Future formats and architectures](../designs/Future-Formats-and-Targets.md)
for the shared-parser design direction.

## Updating This Roadmap

When a feature is ready, move it into Implemented, describe its supported forms
in the [reference](zasm-reference.md), and link a working example. A feature can
in the [reference](ZASM-Reference.md), and link a working example. A feature can
be partially implemented: state which forms work and leave the remaining forms
unchecked. Proposed names such as constants, section directives, and procedure
helpers need a syntax decision; this page does not establish their spelling.

Higher-level Zero (`.zsrc`) has its own language-design work and is outside this
assembly checklist. The [homepage's Coming Soon section](index.md#coming-soon)
assembly checklist. The [homepage's Coming Soon section](../index.md#coming-soon)
also tracks broader language and documentation topics.
9 changes: 5 additions & 4 deletions docs/zasm-examples.md → docs/zasm/ZASM-Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ title: ZASM Basic Examples

# ZASM Basic Examples

[Documentation home](index.md) · [Language reference](zasm-reference.md)
[Documentation home](../index.md) · [Language reference](ZASM-Reference.md) ·
[Mnemonic support](ZASM-Mnemonics.md)

Save each complete program under the suggested filename. Run the commands from
the extracted compiler folder, keeping `include` beside the `zero` compiler executable.
Expand Down Expand Up @@ -115,10 +116,10 @@ console subsystem; this example does not select a separate GUI subsystem.

## Next Steps

- [Include guide](Zero-Assembly-Include-Files.md): put shared source in `.zh` files and use custom `-I` paths.
- [String concatenation tutorial](tutorial-zasm-concat.md): print separate strings, then join them with a space.
- [Include guide](ZASM-Include-Files.md): put shared source in `.zh` files and use custom `-I` paths.
- [String concatenation tutorial](../tutorial-zasm-concat.md): print separate strings, then join them with a space.
- [Sample guide](https://github.com/SuessLabs/ZeroCompiler/blob/master/samples/readme.md): explore the full sample collection, including editable Windows controls.
- [Instruction reference](zasm-reference.md#instruction-reference): choose supported operand forms.
- [Instruction reference](ZASM-Reference.md#instruction-reference): choose supported operand forms.

## Coming Soon

Expand Down
Loading