DigiTekXplorer
Home
Capstone Project
abCore16 Folder
  • abCore16 Project
  • Instruction Set
  • Our Toolchain
  • abCore16 User Guide
  • FPGA Implementation
AI Case Studies
UART Design Folder
  • UART Design
RP Pico Folder
  • Raspberry Pi Pico
  • Pico VGA Project
  • Pico Audio Project
Android App Folder
  • Android App Development
  • BLE Basics
  • Android Studio
  • BLE App User Guide
  • The Gemini Prompt
FPGAs
Coding Basics
Embedded Systems
Basic Concepts
DigiTekXplorer
Home
Capstone Project
abCore16 Folder
  • abCore16 Project
  • Instruction Set
  • Our Toolchain
  • abCore16 User Guide
  • FPGA Implementation
AI Case Studies
UART Design Folder
  • UART Design
RP Pico Folder
  • Raspberry Pi Pico
  • Pico VGA Project
  • Pico Audio Project
Android App Folder
  • Android App Development
  • BLE Basics
  • Android Studio
  • BLE App User Guide
  • The Gemini Prompt
FPGAs
Coding Basics
Embedded Systems
Basic Concepts
More
  • Home
  • Capstone Project
  • abCore16 Folder
    • abCore16 Project
    • Instruction Set
    • Our Toolchain
    • abCore16 User Guide
    • FPGA Implementation
  • AI Case Studies
  • UART Design Folder
    • UART Design
  • RP Pico Folder
    • Raspberry Pi Pico
    • Pico VGA Project
    • Pico Audio Project
  • Android App Folder
    • Android App Development
    • BLE Basics
    • Android Studio
    • BLE App User Guide
    • The Gemini Prompt
  • FPGAs
  • Coding Basics
  • Embedded Systems
  • Basic Concepts
  • Home
  • Capstone Project
  • abCore16 Folder
    • abCore16 Project
    • Instruction Set
    • Our Toolchain
    • abCore16 User Guide
    • FPGA Implementation
  • AI Case Studies
  • UART Design Folder
    • UART Design
  • RP Pico Folder
    • Raspberry Pi Pico
    • Pico VGA Project
    • Pico Audio Project
  • Android App Folder
    • Android App Development
    • BLE Basics
    • Android Studio
    • BLE App User Guide
    • The Gemini Prompt
  • FPGAs
  • Coding Basics
  • Embedded Systems
  • Basic Concepts

DigiTekXplorer - abCore16 Project

Getting Started with abCore16

abCore16 Project: From C-like Code to a Custom CPU

The abCore16 project is a complete 16-bit microprocessor ecosystem designed and implemented through a collaborative development process with Gemini Pro. It features a custom CPU architecture and a comprehensive software development toolchain built entirely in Python within a PyCharm environment.


The ecosystem enables software development for the abCore16 CPU through two distinct compilation paths:

  1. A simple, direct-to-assembly language.
  2. A more powerful, C-like high-level language (SSL). This language supports modern programming constructs including functions with local variables, if/else, for, and while loops, and global one-dimensional arrays.


The toolchain provides a seamless workflow from high-level code to execution:

  • A PLY-based C-like Compiler parses the source, builds an Abstract Syntax Tree (AST), and generates assembly code.
  • An Assembler converts the assembly code into 16-bit binary machine code.
  • A Simulator executes the binary code on a detailed model of the abCore16 CPU, providing cycle-by-cycle logging and state inspection.
  • A Disassembler can reverse-engineer the binary back into human-readable assembly for verification and debugging.


The entire project serves as a practical, hands-on platform for exploring and implementing concepts in computer architecture and compiler design.

Project Overview

The abCore16 project is your gateway to a complete, custom-designed 16-bit computer system built entirely from the ground up in Python.


What is abCore16?

The abCore16 is more than just a CPU simulation; it's a full-stack hardware and software ecosystem. It includes:

  • A Custom 16-bit CPU Architecture: A complete specification for a 16-bit processor with its own unique Instruction Set Architecture (ISA).
  • A Powerful C-like Language: A high-level language designed for the abCore16 that      supports functions, variables, loops, and arrays.
  • A Complete Software Toolchain: A sophisticated compiler, assembler, and disassembler that transform high-level code into executable binary.
  • A Detailed Microprocessor Simulator: A Python program that faithfully executes binary code, modeling the CPU's registers, memory, stack, and I/O operations.


This project is a practical journey into the heart of how computers work, from the logic gates of the CPU to the grammar of a high-level programming language.

abCore16 System Architecture and Workflow

The abCore16 system follows a structured toolchain pipeline:

  1. Simple Source Language (SSL) Programming: Users write programs in SSL, a custom language designed for clarity and ease of use with the 16-bit abCore16      architecture. Programs are typically stored in .ssl files. SSL supports both decimal and hexadecimal (0x...) numeric literals.
  2. Compilation (SSL to SAL): The C-Like Compiler (Python) takes the SSL source code as input. It parses each SSL statement, performs validation (including for 16-bit      values and R0-R7 registers), and translates it into an equivalent Simple Assembly Language (SAL) representation. SAL output uses decimal for immediates and prefixed hex (0x...) for 16-bit addresses.
  3. Disassembly (Machine Code to SAL - Verification): The SimpleDisassembler (Python) takes the generated .bin machine code file and translates it back into a human-readable SAL format (e.g., _disassembled.sal). This helps verify the assembler's output and understand the machine code. It formats 16-bit immediates as #0xHEX and 16-bit addresses as 0xHEX.
  4. Simulation (Machine Code Execution): The MicroprocessorSimulator (Python) loads the .bin file.  It emulates the abCore16 CPU by fetching multi-byte instructions, decoding them, and executing operations using its 16-bit internal architecture.
  5. Assembly (SAL to Machine Code): The SimpleAssembler (Python) processes the SAL code. It employs a two-pass mechanism:
    • First Pass: Builds a symbol table by identifying all labels and calculating their 16-bit byte offsets. It determines the byte length of each instruction (1 to 4 bytes, accounting for 16-bit immediates/addresses).
    • Second Pass: Translates each SAL instruction into its numerical 8-bit machine code       equivalent. Opcodes, register codes (for R0-R7), 8-bit immediates, 16-bit       immediates (for LOAD), and 16-bit addresses (for memory operations, jumps, calls) are encoded into their respective byte sequences (using Little Endian for multi-byte values).
    • An assembly listing (.asm) file is generated showing SAL alongside 16-bit byte offsets and the symbol table.

abCore16 Python Source Files

  1. main.py: The master orchestrator script.
  2. abcore16_defs.py: The central definitions for the ISA.
  3. simple_translator.py: The translator for the original Simple Source Language (SSL).
  4. c_ply_compiler.py: The PLY-based parser for the C-like SSL.
  5. ast_nodes.py: The class definitions for the Abstract Syntax Tree.
  6. code_generator.py: The visitor that traverses the AST to generate SAL code.
  7. simple_assembler.py: The assembler for SAL to binary machine code.
  8. simple_disassembler.py: The disassembler for binary back to SAL.
  9. microprocessor_simulator.py:  The cycle-accurate CPU simulator.

About abCore16

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA)

The abCore16 instruction set supports both the original simple translator and the more advanced C-Like compiler.

Xplorer More

Our Toolchain

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA)

The abCore16 toolchain is written entirely in Python.  The toolchain consists of a translator, a C-Like compiler, an assembler, a disassembler, and a CPU simulator.

Learn More

abCore16 Hardware Implementation

abCore16 Hardware Implementation

abCore16 Hardware Implementation

We are working on a hardware implementation of the abCore16 targeting an AMD (Xilinx) FPGA.

Learn More

abCore16 User Guide

abCore16 Hardware Implementation

abCore16 Hardware Implementation

Press the link to see a comprehensive user guide for the abCore16.

Xplorer More

Copyright © 2025 DigiTekXplorer - All Rights Reserved.


Powered by

This website uses cookies.

We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.

Accept