DEV Community

Cover image for Introducing CDNEE — Control Dynamic Native Execution Engine
Divyanshu Sinha
Divyanshu Sinha

Posted on

Introducing CDNEE — Control Dynamic Native Execution Engine

Author: Divyanshu Sinha  ·  Date: May 30, 2026

Release: v1.0.0 — Initial Release  ·  Platform: Windows 10 / 11 (x86-64)

GitHub: github.com/DivyanshuSinha136/CDNEE


Overview

A high-level assembly-oriented programming language that gives developers direct, explicit control over native execution. Write structured, readable code. Get bare-metal x86-64 performance. No runtime overhead. No abstraction tax.

Programs compile through NASM (assembler) → GCC (linker) → native Windows executable. Every step is transparent and inspectable. What you write is what runs.

Metric Value
Native math operations (Tier 1) 50+
Execution tiers 3
Architecture target x86-64
Platform Windows 10 / 11

The Problem CDNEE Solves

Writing at a low level has always meant choosing between two uncomfortable extremes: the raw power of assembly with its steep complexity, or the convenience of high-level languages that hide what the CPU is actually doing.

CDNEE sits exactly in between — structured syntax you can read at a glance, with the ability to drop into inline NASM, benchmark cycle-by-cycle, patch memory live, and call system libraries directly, all in one coherent source file.


Three Execution Tiers

Tier 1 — Built-in Native Math Library

50+ operations covering scalar math, number theory, bit operations, hashing, modular arithmetic, safe arithmetic, and sort and search. All backed by NASM-compiled routines via the DNEE engine. No compilation step required — available in every program immediately.

Tier 2 — JIT / MEX Engine (Machine Execution Engine)

Compile inline NASM or .asm files into executable memory regions. Benchmark with RDTSC cycle-accurate timing. Hot-patch live regions. Snapshot, restore, and clone compiled memory. Export compiled binaries to disk and reload them across sessions — skipping the assembly step entirely on subsequent runs.

Tier 3 — OS Development

Write real-mode MBR bootloaders and 64-bit freestanding ELF64 kernels from the same language. High-level OS opcodes compile to exact hardware instructions. Test OS logic in interpreter simulation mode without QEMU using --os-sim.


Hello, CDNEE

; hello.cdnee
@entry main

main:
    PRINTLN "Hello, CDNEE!"
    EXIT
Enter fullscreen mode Exit fullscreen mode

JIT compilation — inline assembly compiled to executable memory and called like any function:

JIT_COMPILE_INLINE """
BITS 64
mov  rax, rdi
imul rax, rsi
ret
""", tag=mul, argtypes=i64:i64, rettype=i64

SET r, CALL mul, 6, 7
PRINTLN r             ; → 42
BENCHMARK mul, 6, 7, iterations=1000000
Enter fullscreen mode Exit fullscreen mode

What Ships in v1.0.0

50+ Native Math Operations (Tier 1)

Scalar, integer, bit, number theory, hashing, modular, and safe arithmetic — all NASM-compiled. Cycle-accurate timing via RDTSC.

ADD  SUB  MUL  DIV  MOD  POW  ABS  NEG  SIGN  ISQRT
GCD  LCM  FACTORIAL  FIBONACCI  COLLATZ  TOTIENT
IS_PRIME  NEXT_PRIME  PREV_PRIME
POPCOUNT  NLZ  NTZ  ROL64  ROR64  BIT_REV  BSWAP64
SAFE_ADD  SAFE_SUB  SAFE_MUL  DIVMOD
HASH_FNV64  HASH_MURMUR64  MULMOD64  POWMOD64  MODINV64
SORT_NET4  BIN_SEARCH  LIN_SEARCH  LOWER_BOUND
RDTSC_START  RDTSC_STOP  CPUID
Enter fullscreen mode Exit fullscreen mode

Full JIT / MEX Engine (Tier 2)

  • CompileJIT_COMPILE, JIT_COMPILE_INLINE, JIT_COMPILE_MANY
  • Export / ImportEXPORT_BIN, IMPORT_BIN, CALL_BIN, BIN_CONTEXT
  • Memory controlFREEZE, THAW, SNAPSHOT, RESTORE, CLONE, COPY_ON_WRITE
  • Hot patchingPATCH_NOP, PATCH_INT64, PATCH_FILL, PATCH_REPLACE, PATCH_BYTES, TRAMPOLINE, PATCH_REVERT, PATCH_REVERT_ALL
  • InspectionDISASM, DUMP, FIND, CHECKSUM, REGION_INFO, PATCH_HISTORY
  • ProfilingBENCHMARK, PROFILE_BLOCK, JIT_STATS, CACHE_STATS
  • Type systemi8 u8 i16 u16 i32 u32 i64 u64 f32 f64 ptr bool void

FFI — Foreign Function Interface

Import .cdneef function header files with alias_prefix namespacing. Bind any shared library symbol via EXTERN_FUNC with full typed ctypes signatures. Portable short library names supported across Windows (kernel32, user32, ws2_32, d3d11) and POSIX (c, m, pthread, ssl).

OS Development Tier

Full bare-metal OS development from high-level source:

Opcode Description
OS_BITS 16/32/64 Set NASM instruction width
OS_ORG addr Set origin address (0x7C00 for MBR)
OS_BOOT_SIG Pad to 510 bytes + emit 0xAA55
OS_MULTIBOOT Emit Multiboot 1 header for GRUB
OS_VGA_CLEAR / PUTC / PUTS 80×25 VGA text output
OS_SERIAL_INIT / PUTC / PUTS 16550 UART serial I/O
OS_GDT_ENTRY / OS_LGDT GDT descriptor and load
OS_IDT_ENTRY / OS_LIDT IDT gate descriptor and load
OS_MAP_PAGE / OS_UNMAP_PAGE 4 KiB page mapping (present/write/user flags)
OS_PHYS_ALLOC / OS_PHYS_FREE Physical frame allocation
OS_SET_ISR Dynamically patch running IDT entry
OS_DB / DW / DD / DQ Raw data directives
OS_CLI / STI / HLT / NOP / IRET CPU control

Compile to flat binary (MBR/COM):

CDNEE-CC boot.cdnee --flat
qemu-system-i386 -drive format=raw,file=boot.bin -nographic
Enter fullscreen mode Exit fullscreen mode

Compile to freestanding ELF64 kernel:

CDNEE-CC kernel.cdnee --os --load-addr 0x100000
qemu-system-x86_64 -kernel kernel.elf -serial stdio -nographic
Enter fullscreen mode Exit fullscreen mode

Two CLI Tools

CDNEE — interpreter, REPL, linter, and formatter.

CDNEE program.cdnee               run a source file
CDNEE --repl                      interactive REPL
CDNEE --check program.cdnee       syntax check only
CDNEE --lex / --ast / --fmt       tokenise, parse, or format
CDNEE --disasm TAG                disassemble JIT region after run
CDNEE --bench TAG --bench-iters N benchmark a JIT region
CDNEE --os-sim --os-vga           OS simulation mode
CDNEE --stats                     print JIT and cache statistics
Enter fullscreen mode Exit fullscreen mode

CDNEE-CC — ahead-of-time compiler.

CDNEE-CC program.cdnee            compile to shared library
CDNEE-CC program.cdnee --exe      compile to executable
CDNEE-CC program.cdnee --exe --run           compile + run immediately
CDNEE-CC program.cdnee --asm-only            emit NASM source only
CDNEE-CC program.cdnee --opt 2               peephole + strength reduction
CDNEE-CC boot.cdnee   --flat --qemu          MBR flat binary + QEMU
CDNEE-CC kernel.cdnee --os   --qemu          ELF64 kernel + QEMU
Enter fullscreen mode Exit fullscreen mode

Four File Types

Extension Purpose
.cdnee Source program. Entry point declared with @entry.
.cdneef Function definition file. Imported with EXTERN, supports alias_prefix.
.asm NASM assembly source for JIT_COMPILE. Must begin with BITS 64.
.bin Precompiled binary export. Reloaded by IMPORT_BIN / CALL_BIN.

System Requirements

Component Detail Status
Platform Windows 10 / 11 (x86-64) Required
NASM Assembler — v2.15 or later, must be on PATH Required
GCC Linker — MinGW-w64 or TDM-GCC, must be on PATH Required

Verify before installing:

nasm -v
gcc --version
Enter fullscreen mode Exit fullscreen mode

The installer detects both tools automatically. If either is missing, setup pauses and tells you exactly which one is absent before proceeding.

Download NASM: nasm.us

Download GCC (MinGW-w64): winlibs.com or TDM-GCC


Installation

  1. Download CDNEE-Setup-v1.0.0.exe from the Releases page.
  2. Run the installer — no administrator rights required for the default install path.
  3. The installer checks for NASM and GCC automatically:
    • Detected — installation proceeds, showing the detected version.
    • Missing — installer pauses and identifies the absent tool. Install it, then re-run.
  4. Follow the on-screen prompts to complete installation.
  5. Both cdnee and cdnee-cc will be available from any terminal window.

Tags

programming-language assembly x86-64 JIT native NASM GCC OS-development bare-metal Windows low-level systems-programming compiler v1.0.0


Links


CDNEE v1.0.0 — Control Dynamic Native Execution Engine

Powered by Pythonaibrain-NASM / DNEE

© 2026 Divyanshu Sinha — divyanshu.sinha631@gmail.com

Top comments (0)