多彩编程 多彩编程MZPH · CODE BLOG
ARTICLE DETAIL

文章详情

深耕前端与后端开发技术的一线实战笔记与踩坑复盘。

STC32G12K128开源编译器:SDCC

STC32G12K128开源编译器:SDCC 【SDCC开源编译器】基本背景SDCC简介SDCC is a retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11, ISO C23) compiler suite that targets 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, 4000, SM83, TLCS-90, eZ80, R800), Padauk (pdk14, pdk15), STMicroelectronics STM8, MOS 6502 and WDC 65C02. Work is in progress on supporting the Rabbit 5000, 6000, Padauk pdk13 and the f8 and f8l targets; Microchip PIC16 and PIC18 targets are unmaintained. SDCC can be retargeted for other microprocessors.SDCC suite is a collection of several components derived from different sources with different FOSS licenses. SDCC compiler suite include:sdas and sdld, a retargettable assembler and linker, based on ASXXXX, written by Alan Baldwin; (GPL).sdcpp preprocessor, based on GCC cpp; (GPL).ucsim simulators, originally written by Daniel Drotos; (GPL).sdcdb source level debugger, originally written by Sandeep Dutta; (GPL).sdbinutils library archive utilities, including sdar, sdranlib and sdnm, derived from GNU Binutils; (GPL)SDCC run-time libraries; (GPLLE). Pic device libraries and header files are derived from Microchip header (.inc) and linker script (.lkr) files. Microchip requires that “The header files should state that they are only to be used with authentic Microchip devices” which would make them incompatible with the GPL.gcc-test regression tests, derived from gcc-testsuite; (no license explicitely specified, but since it is a part of GCC is probably GPL licensed)packihx; (public domain)makebin; (zlib/libpng License)sdcc C compiler, originally written by Sandeep Dutta; (GPL). Some of the features include:extensive MCU specific language extensions, allowing effective use of the underlying hardware.a host of standard optimizations such as global subexpression elimination, loop optimizations (loop invariant, strength reduction of induction variables and loop reversing), constant folding and propagation, copy propagation, dead code elimination and jump tables for ‘switch’ statements.MCU specific optimizations, including a global register allocator.adaptable MCU specific backend that should be well suited for other 8 bit MCUsindependent rule based peep hole optimizer.a full range of data types: char (8 bits, 1 byte), short (16 bits, 2 bytes), int (16 bits, 2 bytes), long (32 bit, 4 bytes), long long (64 bit, 8 bytes), float (4 byte IEEE), _Bool/bool and _BitInt.the ability to add inline assembler code anywhere in a function.the ability to report on the complexity of a function to help decide what should be re-written in assembler.a good selection of automated regression tests.对应连接https://sdcc.sourceforge.net/STC32G12K128 开源编译器最优起步路线先明确硬件核心STC32G 是 80251C251扩展架构不是传统 8 位 MCS51只有 SDCC 是目前唯一成熟、可用的开源编译器没有原生 GCC/LLVM C251 后端。首选起步SDCCSmall Device C Compiler【唯一可行】为什么从 SDCC 出发唯一标准答案STC官方 提供 RMB5万的辛苦费下载信息SDCC 使用手册SDCC 下载连接
返回列表