Compilers: Difference between revisions
From SpecNext Wiki
→SDCC: nicer |
m →VForth Next: nicer |
||
| (35 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
=== '' | == BASIC == | ||
: " | === ''[https://zxbasic.readthedocs.io/ ZX Basic]'' === | ||
: "zsdcc" | : A Basic to Z80 compiler with extensions added to Sinclair Basic. | ||
=== ''[https://github.com/em00k/NextBuild NextBuild v7]'' === | |||
: NextBuild is a suite of tools for Windows which uses Boriel's ZX Basic Compiler. It comes with a Next library of routines to take advantage of the Nexts hardware. Examples included. | |||
: See [[NextBuild:Main Page| NextBuild dedicated Wiki section]]. | |||
== C == | |||
=== ''z88dk-scc80'' and ''z88dk-zsdcc'' === | |||
: Via the "zcc", the [https://github.com/z88dk/z88dk Z88dk] toolchain's front end, two compilers could be invoked <ref> [https://github.com/z88dk/z88dk/wiki z88dk wiki] </ref>: | |||
: "z88dk-scc80", a small C derived C compiler that is nearly C90 compliant with a few notable exceptions. Emphasis is on small code. | |||
: "z88dk-zsdcc", a fork of [[#SDCC]]. | |||
: A Next target is present and under development. Output file types include tap, sna, and esxdos dot commands. | : A Next target is present and under development. Output file types include tap, sna, and esxdos dot commands. | ||
: [[Calling convention notes]] | : [[Calling convention notes]] | ||
| Line 8: | Line 20: | ||
=== ''SDCC'' === | === ''SDCC'' === | ||
[https://sdcc.sourceforge.net/ SDCC] is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors ( | : [https://sdcc.sourceforge.net/ Small Device C Compiler, SDCC] is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors <ref>[https://sdcc.sourceforge.net/ SDCC targets as of February 2026]: the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83, Rabbit 2000, 2000A, 3000A, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 4000, 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained. SDCC can be retargeted for other microprocessors.</ref> including a Z80N target. | ||
: The compiler, assembler and linker are GNU GPL <ref>[https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2] , [https://www.gnu.org/licenses/gpl-3.0.html GNU GPL 3]</ref> licensed and the compiler's libraries are GNU GPL licensed with a special exception. | |||
: Developed as separate projects there are: a development kit for SDCC for creating small NextZXOS DOT programs and a [https://github.com/retro-vault/libcpm3-z80 library for CP/M 3] | |||
: Firmware and loader sources in the tbblue repository were made to be compiled with SDCC. | |||
== C-like == | |||
=== ''[https://taylorza.itch.io/znc-compiler ZNC Native compiler]'' === | |||
: ZNC is a language and compiler for the ZX Spectrum Next. The language is closely modeled after the C programming language. | |||
: The language suite includes the compiler, an optimizer, assembler and text editor to support native development on the Next. It also include a frontend that makes managing source files and building your projects easier. | |||
== Forth == | |||
=== ''VForth Next'' === | |||
: [https://github.com/mattsteeldue/vforth-next VForth Next] is a Z80N Forth system suitable to run on the ZX Spectrum Next | |||
== Pascal == | |||
=== ''Pasta80'' === | |||
: [https://github.com/pleumann/pasta80 Pasta80] is a Turbo Pascal 3.0-compatible compiler that generates machine code for classic and modern Z80 machines (currently ZX Spectrum 48K/128K/Next and CP/M). | |||
: GNU GPL 3 license with a linking exception. | |||
=== ''[https:// | === ''OmniPas'' === | ||
: [https://syntaxerrorsoftware.itch.io/omnipas OmniPas] is a Windows‑based Pascal cross‑compiler that targets multiple platforms, including the ZX Spectrum and ZX Spectrum Next. | |||
=== | == Utilities == | ||
=== ''[https://github.com/speccyorg/bas2tap bas2tap | === ''[https://github.com/speccyorg/bas2tap bas2tap CLI]'' === | ||
: The utility to convert `BASIC in an ASCII file' to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program). | : The utility to convert `BASIC in an ASCII file' to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program). | ||
: Comes complete with portable C source. With full BASIC syntax checking! | : Comes complete with portable C source. With full BASIC syntax checking! | ||
| Line 32: | Line 57: | ||
: (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next) | : (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next) | ||
=== ''[https://github.com/remy/txt2bas txt2bas & bas2txt CLI | === ''[https://github.com/remy/txt2bas txt2bas & bas2txt CLI]'' === | ||
: Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text. | : Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text. | ||
: The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support | : The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support | ||
=== | |||
== References == | |||
Latest revision as of 17:41, 22 February 2026
BASIC
ZX Basic
- A Basic to Z80 compiler with extensions added to Sinclair Basic.
NextBuild v7
- NextBuild is a suite of tools for Windows which uses Boriel's ZX Basic Compiler. It comes with a Next library of routines to take advantage of the Nexts hardware. Examples included.
- See NextBuild dedicated Wiki section.
C
z88dk-scc80 and z88dk-zsdcc
- Via the "zcc", the Z88dk toolchain's front end, two compilers could be invoked [1]:
- "z88dk-scc80", a small C derived C compiler that is nearly C90 compliant with a few notable exceptions. Emphasis is on small code.
- "z88dk-zsdcc", a fork of #SDCC.
- A Next target is present and under development. Output file types include tap, sna, and esxdos dot commands.
- Calling convention notes
SDCC
- Small Device C Compiler, SDCC is an open-source retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets a lot of mostly 8-bit microprocessors [2] including a Z80N target.
- The compiler, assembler and linker are GNU GPL [3] licensed and the compiler's libraries are GNU GPL licensed with a special exception.
- Developed as separate projects there are: a development kit for SDCC for creating small NextZXOS DOT programs and a library for CP/M 3
- Firmware and loader sources in the tbblue repository were made to be compiled with SDCC.
C-like
ZNC Native compiler
- ZNC is a language and compiler for the ZX Spectrum Next. The language is closely modeled after the C programming language.
- The language suite includes the compiler, an optimizer, assembler and text editor to support native development on the Next. It also include a frontend that makes managing source files and building your projects easier.
Forth
VForth Next
- VForth Next is a Z80N Forth system suitable to run on the ZX Spectrum Next
Pascal
Pasta80
- Pasta80 is a Turbo Pascal 3.0-compatible compiler that generates machine code for classic and modern Z80 machines (currently ZX Spectrum 48K/128K/Next and CP/M).
- GNU GPL 3 license with a linking exception.
OmniPas
- OmniPas is a Windows‑based Pascal cross‑compiler that targets multiple platforms, including the ZX Spectrum and ZX Spectrum Next.
Utilities
bas2tap CLI
- The utility to convert `BASIC in an ASCII file' to a TAP tape image file (can be loaded by emulator or Next as regular BASIC program).
- Comes complete with portable C source. With full BASIC syntax checking!
- (does not support NextBASIC extensions)
- (for NextBASIC you can use the NextZXOS dot commands .txt2bas and .bas2txt directly on the Next)
txt2bas & bas2txt CLI
- Cross platform command line tool to convert NextBASIC to +3dos .bas file and convert .bas files to plain text.
- The tool also includes verbose validation, tap and 3dos, BANK compatible and headerless export and import support
References
- ↑ z88dk wiki
- ↑ SDCC targets as of February 2026: the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based (hc08, s08), Zilog Z80 based MCUs (Z80, Z80N, Z180, SM83, Rabbit 2000, 2000A, 3000A, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 4000, 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained. SDCC can be retargeted for other microprocessors.
- ↑ GNU GPL 2 , GNU GPL 3