From 23a1a80890966d0faf8989bb5151c16a2ffc5829 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 21 Aug 2023 22:03:21 +0800 Subject: [PATCH] more options for sdcc compiler --- RedPandaIDE/compiler/compilerinfo.cpp | 9 +++++ RedPandaIDE/compiler/compilerinfo.h | 2 ++ RedPandaIDE/translations/RedPandaIDE_pt_BR.ts | 8 +++++ RedPandaIDE/translations/RedPandaIDE_zh_CN.ts | 36 ++++++++++++------- RedPandaIDE/translations/RedPandaIDE_zh_TW.ts | 8 +++++ 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/RedPandaIDE/compiler/compilerinfo.cpp b/RedPandaIDE/compiler/compilerinfo.cpp index d2a7a5f5..907beddc 100644 --- a/RedPandaIDE/compiler/compilerinfo.cpp +++ b/RedPandaIDE/compiler/compilerinfo.cpp @@ -446,8 +446,17 @@ void SDCCCompilerInfo::prepareCompilerOptions() sl.append(QPair("SDCC C2x","sdcc2x")); addOption(SDCC_CMD_OPT_STD, QObject::tr("Language standard (--std)"), groupName, true, false, false, "--std-", CompilerOptionType::Choice,sl); + // Memory Model + sl.clear(); + sl.append(QPair("Small","-small")); + sl.append(QPair("Medium","-medium")); + sl.append(QPair("Large","-large")); + sl.append(QPair("Huge","-huge")); + addOption(SDCC_OPT_MEMORY_MODEL, QObject::tr("Memory model (--model)"), groupName, true, false, false, "--model", CompilerOptionType::Choice,sl); + addOption(SDCC_OPT_XSTACK, QObject::tr("Use external stack"),groupName,true,false,false,"--xstack"); addOption(SDCC_OPT_XRAM_MOVC, QObject::tr("Use movc instead of movx to read from external ram"),groupName,true,false,false,"--xram-movc"); + addOption(SDCC_OPT_ACALL_AJMP, QObject::tr("Replaces lcall/ljmp with acall/ajmp"),groupName,true,false,false,"--acall-ajmp"); addOption(SDCC_OPT_NO_XINIT_OPT, QObject::tr("Don't memcpy initialized xram from code"),groupName,true,false,false,"--no-xinit-opt"); addOption(SDCC_OPT_NOSTARTUP, QObject::tr("Don't generate startup code"),groupName,false,false,false,"nostartup"); diff --git a/RedPandaIDE/compiler/compilerinfo.h b/RedPandaIDE/compiler/compilerinfo.h index 13240eea..863039e3 100644 --- a/RedPandaIDE/compiler/compilerinfo.h +++ b/RedPandaIDE/compiler/compilerinfo.h @@ -51,8 +51,10 @@ #ifdef ENABLE_SDCC #define SDCC_CMD_OPT_PROCESSOR "sdcc_cmd_opt_processor" #define SDCC_CMD_OPT_STD "sdcc_cmd_opt_std" +#define SDCC_OPT_MEMORY_MODEL "sdcc_opt_memory_model" #define SDCC_OPT_XSTACK "sdcc_opt_xstack" #define SDCC_OPT_XRAM_MOVC "sdcc_opt_xram_movc" +#define SDCC_OPT_ACALL_AJMP "sdcc_opt_acall_ajmp" #define SDCC_OPT_NO_XINIT_OPT "sdcc_opt_no_xinit_opt" #define SDCC_OPT_NOSTARTUP "sdcc_opt_nostartup" diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index 079a0ce0..9be4beb1 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -7017,6 +7017,14 @@ Code segment size + + Memory model (--model) + + + + Replaces lcall/ljmp with acall/ajmp + + RegisterModel diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index 7ee06c2d..68787dff 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -8981,67 +8981,77 @@ Are you really want to continue? C语言标准(--std) - + + Memory model (--model) + 内存模型(--model) + + + Use external stack 使用外部栈空间 - + Use movc instead of movx to read from external ram 使用movc代替movx访问外部RAM - + + Replaces lcall/ljmp with acall/ajmp + 用acall/ajmp代替lcall/ljmp + + + Don't memcpy initialized xram from code Don't memcpy initialized xram from code - + Don't generate startup code 无main函数时不生成起始代码(用于edsim51模拟器) - + MCU Specification 微处理器参数 - + Internal ram size 内部RAM大小 - + External ram start location 外部RAM起始地址 - + External ram size 外部RAM大小 - + Stack pointer initial value 栈指针寄存器初始地址 - + External stack start location 外部栈空间起始地址 - + Direct data start location 内部数据区起始地址 - + Code segment location 代码段起始地址 - + Code segment size 代码段大小 diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index bd1b3827..fad4ec7e 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -6542,6 +6542,14 @@ Code segment size + + Memory model (--model) + + + + Replaces lcall/ljmp with acall/ajmp + + RegisterModel