Re: [Sdcc-user] _Optional

2025-03-05 Thread Maarten Brock
Philipp Klaus Krause schreef op 2025-02-26 11:22: Dear SDCC users, would an _Optional qualifier (see N3422 - https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3422.pdf for details) be useful to you? Basically, it would be a way for programmers to explicitly specify that a pointer might be null.

Re: [Sdcc-user] Bug in sdas8051 comand line

2024-12-30 Thread Maarten Brock
Thomas Zepf via Sdcc-user wrote on 2024-12-30 03:34: SDCC v4.4 I need to add some lowlevel asm functions to my project. Since i dont like output files in my src directory i am using relative paths. All outputs go to my ./SDCC/ob/j sources are at ../src/ When i am doing "sdas8051 -losg .\obj\lowle

Re: [Sdcc-user] SDCC generated functions being called from legacy assembly code

2024-06-25 Thread Maarten Brock
Forest Darling wrote on 2024-06-25 15:00: Hello all! I am new to using SDCC, and I am working with some legacy 8051 codebase that is written in assembly. I would like to port one function at a time from assembly to C, eventually converting the entire codebase while testing it as I go. However,

Re: [Sdcc-user] Do we want --reserve-regs-iy variants of the standard library for z80-related ports

2024-06-24 Thread Maarten Brock
Philipp Klaus Krause schreef op 2024-06-24 11:25: Dear users of the z80 and related ports, we currently do have the --reserve-regs-iy option to make sdcc generate code that does not use the register pair iy. But we do not by default ship with a standard library compiled with --reserve-regs-iy.

Re: [Sdcc-user] sdas8051 bug?

2024-01-26 Thread Maarten Brock
Hello Fritz, Can you please file this as a bug in our Bug tracker on SourceForge? https://sourceforge.net/p/sdcc/bugs/ Thanks, Maarten Fritz Mueller schreef op 2024-01-25 23:13: Hi folks, I’ve run into what I think might be a bug in sdas8051 as distributed with cdcc 4.3.0. The following tes

Re: [Sdcc-user] differences in ELF and IHEX output

2023-09-04 Thread Maarten Brock
Maximilian Schneider schreef op 2023-09-02 16:06: While trying to create a custom IVT for a bootloader I noticed that the ELF and IHEX output differ when converted to binary. example: echo "int main() { }\n" > main.c sdcc -DF_CPU=1600UL -mstm8 --std-sdcc11 -c main.c -o main.c.rel sdcc -DF_C

Re: [Sdcc-user] Any way to eliminate unnecessary STM8 DIV workaround from an ISR?

2022-08-13 Thread Maarten Brock
Basil Hussain schreef op 2022-08-13 12:36: On 13/08/2022 07:24, Philipp Klaus Krause wrote: If SDCC can find out that there is no division in the ISR, it will omit the workaround. Can you show the code of your ISR here? Okay, this is confusing... Since my previous message, I changed some other

Re: [Sdcc-user] pragma disable_warning

2022-07-24 Thread Maarten Brock
Hello Tony, Tony Pavlov via Sdcc-user schreef op 2022-07-22 16:24: Hello Maarten, MB> I don't know which are "the inline functions" nor which are "those warnings". MB> Why not just fix what these warnings complain about? i am not a true C developer, but: inline uint8_t inline_some(uint8_t som

Re: [Sdcc-user] pragma disable_warning

2022-07-22 Thread Maarten Brock
Tony Pavlov via Sdcc-user schreef op 2022-07-22 14:33: Hello Maarten, Friday, July 22, 2022, 3:26:47 PM, you wrote: There is a pragma for disabling individual warnings by number. But seems like no pragma to restore its original state? pragma save/restore does not affect > warnings? MB> No it

Re: [Sdcc-user] Possible changes to inline assembler syntax

2022-07-22 Thread Maarten Brock
Tony Pavlov via Sdcc-user schreef op 2022-07-22 14:17: Hello All, There is a pragma for disabling individual warnings by number. But seems like no pragma to restore its original state? pragma save/restore does not affect warnings? Hello Tony, No it doesn't. The mechanism used internally by S

Re: [Sdcc-user] Is anyone using --fdollars-in-identifiers?

2022-07-18 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-07-18 18:06: Am 18.07.22 um 17:03 schrieb Tony Pavlov via Sdcc-user: Hello Philipp, Monday, July 18, 2022, 5:52:09 PM, you wrote: PKK> $ in identifiers is a somewhat disputed topic (C++ disallows them, C historically left it implementation-defined, future

Re: [Sdcc-user] Is anyone using -pedantic-parse-numbersor #pragma pedantic_parse_numbers?

2022-07-18 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-07-15 22:22: Are these two still in use by anyone? The enable a nonstandard behavior in the preprocessor wrt. parsing of "numbers" (apparently with the option / pragma, the preprocessor ignores what the standard says about "preprocessing-numbers" and instead t

Re: [Sdcc-user] Possible changes to inline assembler syntax

2022-07-15 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-07-15 16:45: Since people like form 1, I'd now think we should keep it, but drop #pragma sdcc_hash. That looks like a better way forward and also solves the issues. When this pragma is dropped does that mean it is no longer possible to use the # for an im

Re: [Sdcc-user] Possible changes to inline assembler syntax

2022-07-15 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-07-14 21:34: Am 14.07.22 um 14:46 schrieb Maarten Brock: Hi Philipp, Philipp Klaus Krause schreef op 2022-07-14 12:58: SDCC currently supports two forms of inline assembler: 1: __asm asm code here __endasm; and 2: __asm("asm code here"); Doe

Re: [Sdcc-user] Possible changes to inline assembler syntax

2022-07-14 Thread Maarten Brock
Hi Philipp, Philipp Klaus Krause schreef op 2022-07-14 12:58: SDCC currently supports two forms of inline assembler: 1: __asm asm code here __endasm; and 2: __asm("asm code here"); Does (or will) this second form also support multiple asm instructions? AFAIK it doesn't. And does it not mes

Re: [Sdcc-user] [sdcc-devel] Restricting support for __using __interrupt __at arguments

2022-06-23 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-06-22 17:38: Am 21.06.22 um 14:12 schrieb Maarten Brock: Philipp Klaus Krause schreef op 2022-06-21 14:00: Am 21.06.22 um 13:47 schrieb Maarten Brock: On a related note: is something specified for non-initialized variables? Currently SDCC creates no

Re: [Sdcc-user] [sdcc-devel] Restricting support for __using __interrupt __at arguments

2022-06-21 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-06-21 14:00: Am 21.06.22 um 13:47 schrieb Maarten Brock: On a related note: is something specified for non-initialized variables? Currently SDCC creates no implicit initializer to zero when __at is used and no explicit initializer is provided. int __at(10

Re: [Sdcc-user] [sdcc-devel] Restricting support for __using __interrupt __at arguments

2022-06-21 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-06-21 13:00: There might well be further changes, in particular to __at, ad where it can be. Currently, __at is handled both as a specifier and as an aspect of pointers. IMO, the __at would make more sense as an attribute on the identifier in a direct declarat

Re: [Sdcc-user] [sdcc-devel] Restricting support for __using __interrupt __at arguments

2022-06-20 Thread Maarten Brock
Philipp Klaus Krause schreef op 2022-06-18 14:11: Am 17.06.22 um 20:55 schrieb Sergey Belyashov: Imho, it is better to break the use of __at in favor of __at(). While that might be a clenaer solution, and was my first intuition, I think that this would break too much existing user code (and

Re: [Sdcc-user] STM8 how to access s_DATA/l_DATA in C

2022-06-14 Thread Maarten Brock
Hello Wlodzimierz, I just tried using inline asm, but could not get it working with .equ either. It does work however as a return value from a function. unsigned int get_l_data(void) __naked { __asm ldw x,#l_DATA __endasm; } Maarten Wlodzimierz Lipert schreef op 2022-06-13 08

Re: [Sdcc-user] SDCC for chinese holychip HC89S series

2022-04-27 Thread Maarten Brock
Wojciech Puchar schreef op 2022-04-27 11:29: will it work? Seems they are 8051 core based. Soon we will have devel board for it, but i would prefer not to use point and click "development environment" for programming it, just like i do for MIPS/ARM/AVR micros with gcc. It will probably work fi

Re: [Sdcc-user] Standard library printf() %p endianness

2021-11-14 Thread Maarten Brock
Philipp Klaus Krause schreef op 2021-11-11 19:58: Am 10.11.21 um 23:38 schrieb Basil Hussain: Hi all, Quick question: was the SDCC standard library printf() implementation for the %p conversion specifier written only with little-endian platforms (e.g. 8051) in mind? Sorry, bu, you are unlikel

Re: [Sdcc-user] Would it be useful to be able to call functions written for or compiled by other Z80 compilers?

2021-07-19 Thread Maarten Brock
Philipp Klaus Krause schreef op 2021-07-17 07:43: Am 17.07.21 um 00:38 schrieb Alan Cox: On Fri, 16 Jul 2021 09:49:59 +0200 Philipp Klaus Krause wrote: For the Z80, many different calling conventions exist. Recently, SDCC introduced keywords __raisonance, __cosmic, __iar for the stm8 port,

Re: [Sdcc-user] A possible new calling convention for stm8

2021-06-29 Thread Maarten Brock
Philipp Klaus Krause schreef op 2021-06-29 12:03: Am 29.06.21 um 10:22 schrieb Павел Бельтюков: It would be great if there was some macro definition indicating calling convention at compile time. In such case we could do something like that: void some_func() {     __asm #ifdef

Re: [Sdcc-user] A possible new calling convention for stm8

2021-06-28 Thread Maarten Brock
Basil Hussain wrote on 2021-06-25 21:01: Personally, my comments are that I think the proposed new calling convention will make life difficult when writing assembly code that is to be called by C code. In my opinion, the current STM8 calling convention suits that scenario just fine. In my exper

Re: [Sdcc-user] any way to get address of __sbit?

2021-03-08 Thread Maarten Brock
Ralph Doncaster schreef op 2021-03-06 18:47: On Sat, Mar 6, 2021 at 1:12 PM Maarten Brock wrote: Ralph Doncaster schreef op 2021-02-18 16:33: > If I have an sbit defined as follows: > __sbit __at (0x90) LED; > > How can I get the address? When I try &LED, I get an e

Re: [Sdcc-user] any way to get address of __sbit?

2021-03-06 Thread Maarten Brock
Ralph Doncaster schreef op 2021-02-18 16:33: If I have an sbit defined as follows: __sbit __at (0x90) LED; How can I get the address? When I try &LED, I get an error: error 35: '&' illegal operand, address of bit variable I need the address for a function that will configure the GPIO to push-

Re: [Sdcc-user] Interesting observation with SDCC (stm8)

2021-03-06 Thread Maarten Brock
Hello Georg, Georg Icking-Konert schreef op 2021-02-18 17:17: Hello Royce, I also found it inconvenient that SDCC provides no STM8 headers. Therefore I developed them and made them available as OSS under https://github.com/gicking/STM8_headers. There you also find examples how to use them. Hope

Re: [Sdcc-user] Order of external/internal rules

2020-07-28 Thread Maarten Brock
Sebastian 'basxto' Riedel schreef op 2020-07-24 18:23: In what order are internal and external rules executed? I get some confusing output from my rules, I supposed that internal rules are matched first and external ones last. What rules are you talking about? Peephole rules? Yes, internal peep

Re: [Sdcc-user] replacement for --stack-loc?

2020-07-27 Thread Maarten Brock
Ralph Doncaster schreef op 2020-07-26 04:06: I have been trying to change the default stack location for mcs51, with no luck. The .mem file shows no change to where the stack starts at when I use the --stack-loc option. I tried upgrading from 400 to 403, and now I get: at 1: warning 201: depre

Re: [Sdcc-user] __CODE and __DATA not set in linker

2020-07-23 Thread Maarten Brock
Sebastian 'basxto' Riedel wrote on 2020-07-23 15:02: On 23.07.20 14:35, Maarten Brock wrote: Sebastian 'basxto' Riedel wrote on 2020-07-23 13:02: Is there a reason why __CODE and __DATA aren't set to default values in the linker and instead the values defined in

Re: [Sdcc-user] __CODE and __DATA not set in linker

2020-07-23 Thread Maarten Brock
Sebastian 'basxto' Riedel wrote on 2020-07-23 13:02: Is there a reason why __CODE and __DATA aren't set to default values in the linker and instead the values defined in z80/main.c get passed via command line arguments when called via `bin/sdcc`? What default values would you expect? The z80 do

Re: [Sdcc-user] Does anyone rely on concatenating prefixed string literals?

2020-07-09 Thread Maarten Brock
Hi, USB descriptor strings must be UTF-16-LE encoded, but other than that I know of no use for anything but basic ascii on an 8 bit device. I too would go for rejecting mixed prefixes. Maarten Sergey Belyashov schreef op 2020-07-09 20:55: First, most of sdcc users uses basic ascii or anothe

Re: [Sdcc-user] sdasstm8 listing output - no. of cycles of DECW instruction wrong?

2020-07-02 Thread Maarten Brock
Hi Basil, Basil Hussain schreef op 2020-06-29 19:17: I think I found where the number of cycles for DECW is defined in sdasstm8. In stm8mch.c, there is a table named 'stm8pg'. Looking up the opcode value for DECW X, 0x5A, in the table gives 2. I'm not sure how the opcode for DECW Y, 0x905A, is

Re: [Sdcc-user] Crash of sdasstm8 with --debug, --out-fmt-elf and __naked functions

2020-07-02 Thread Maarten Brock
Hello Basil and Vahid, When you find what you believe to be a bug it's best to file it in the bug tracker at SF. If you only post about it in the mailing list(s) it will likely get lost in time. Maarten Vahid Bashiri schreef op 2020-05-12 19:06: I'v seen exactly the same problem with "--out

Re: [Sdcc-user] PDK t1sn t0sn as if statement

2020-06-16 Thread Maarten Brock
Sławomir Kawa schreef op 2020-06-16 00:45: pon., 15 cze 2020 o 11:05 Maarten Brock napisał(a): This sounds like an excellent job for the peephole optimizer. Are there restrictions on the operand that should be checked? Maarten I have created following peephole rule for my if statement

Re: [Sdcc-user] PDK t1sn t0sn as if statement

2020-06-15 Thread Maarten Brock
Philipp Klaus Krause schreef op 2020-06-15 14:58: Am 15.06.20 um 13:42 schrieb Maarten Brock: Philipp Klaus Krause schreef op 2020-06-15 11:34: Padauk t0sn and t1sn need an operand that is either an __sfr, and in the lower half of the __data address space. Is that "either ... or"

Re: [Sdcc-user] PDK t1sn t0sn as if statement

2020-06-15 Thread Maarten Brock
Philipp Klaus Krause schreef op 2020-06-15 11:34: Am 15.06.20 um 11:04 schrieb Maarten Brock: This sounds like an excellent job for the peephole optimizer. Are there restrictions on the operand that should be checked? Maarten Padauk t0sn and t1sn need an operand that is either an __sfr, and

Re: [Sdcc-user] PDK t1sn t0sn as if statement

2020-06-15 Thread Maarten Brock
Sławomir Kawa schreef op 2020-06-13 21:08: Hi, I have a question/advice request. Lately I have builded easy-pdk programmer and started playing with padauk uc and SDCC. I'm using PFS154 as it's MTP . When i wan't to check some register bit for example PIN state or interrupt flag for PA i'm usin

Re: [Sdcc-user] How to wrrite program onto EFM8?

2020-05-30 Thread Maarten Brock
Maarten Brock schreef op 2020-05-29 19:39: Maarten Brock schreef op 2020-05-23 10:53: Maarten Brock schreef op 2020-05-22 15:49: Hello Philipp, Philipp Klaus Krause schreef op 2020-05-21 16:23: How can I write a program onto an EFM8 * Bee Starter Kit Board? For my C8051 boards, I use an U

Re: [Sdcc-user] How to wrrite program onto EFM8?

2020-05-29 Thread Maarten Brock
Maarten Brock schreef op 2020-05-23 10:53: Maarten Brock schreef op 2020-05-22 15:49: Hello Philipp, Philipp Klaus Krause schreef op 2020-05-21 16:23: How can I write a program onto an EFM8 * Bee Starter Kit Board? For my C8051 boards, I use an U-EC6 with ec2-new, which mostly works fine

Re: [Sdcc-user] How to wrrite program onto EFM8?

2020-05-23 Thread Maarten Brock
Maarten Brock schreef op 2020-05-22 15:49: Hello Philipp, Philipp Klaus Krause schreef op 2020-05-21 16:23: How can I write a program onto an EFM8 * Bee Starter Kit Board? For my C8051 boards, I use an U-EC6 with ec2-new, which mostly works fine. But for an EFM8 Sleepy Bee Starter Kit board

Re: [Sdcc-user] How to wrrite program onto EFM8?

2020-05-22 Thread Maarten Brock
Hello Philipp, Philipp Klaus Krause schreef op 2020-05-21 16:23: How can I write a program onto an EFM8 * Bee Starter Kit Board? For my C8051 boards, I use an U-EC6 with ec2-new, which mostly works fine. But for an EFM8 Sleepy Bee Starter Kit board I tried, I got "MATCH FAILED, no suitable de

Re: [Sdcc-user] Packed structs

2019-07-05 Thread Maarten Brock
Hello Jacob, On an 8-bit processor structs usually are by packed by design as there is no reason for interspersed bytes to overcome alignment drawbacks. As such SDCC has no packing options/pragmas/language extensions. Maarten > Hello, > > I am fond of using __attribute__((packed)) to document re

Re: [Sdcc-user] Anyone returning expressions in functions returning void?

2019-03-01 Thread Maarten Brock
> Am 01.03.19 um 10:17 schrieb Philipp Klaus Krause: >> The C standard does not allow returning expressions in functions >> returning void. E.g. this >> >> static void attr_rtx(char *, char *); >> static char *attr_string(char *); >> >> static void >> attr_eq (char *name, char *

Re: [Sdcc-user] installation problem under Ubuntu 18.04

2018-10-14 Thread Maarten Brock
> hi Maarten, > > thanks for asking! Yes, that issue seems to be solved :-) Triggered by > your below mail I removed the apt install again, and re-installed the > binary from the Sourceforge "snapshot_builds". Now "sdcc -v" gives no > error message but "3.8.1 #10612 (Linux)". And a test-build of a

Re: [Sdcc-user] installation problem under Ubuntu 18.04

2018-10-14 Thread Maarten Brock
> hello all, > > after upgrading my PC from Ubuntu 16.04 to 18.04 I re-installed SDCC > from the the latest binary > (https://sourceforge.net/projects/sdcc/files/sdcc-linux-x86/3.6.0/sdcc-3.6.0-i386-unknown-linux2.5.tar.bz2/download). > Specifically I followed the instruction in INSTALL.txt, i.e. "

Re: [Sdcc-user] stm8 optimizaions

2018-10-12 Thread Maarten Brock
Konstantin, Please post this as a feature request to improve SDCC. It will get lost in the mailing list. Maarten > Actual TNZ peephole can be extended for one more > It should help to sdcc_divulong > > replace restart { > ld (%1, %2), a > tnz a > } by { > ld (%1, %2), a > } > > In 3.8.0 srl (x)

Re: [Sdcc-user] STM8 static variables inside functions gives Error: relocation error

2018-04-15 Thread Maarten Brock
> Hi Marteen. > > I am using the stable version 3.7.0. > I am on Linux and I can build some developent version and test before > write on bug tracker - what do you recommend? 3.7.0 is recent enough to file this as a bug. Maarten -

Re: [Sdcc-user] STM8 static variables inside functions gives Error: relocation error

2018-04-15 Thread Maarten Brock
Hello Jorge, Did you use a recent version of SDCC? If so, this looks like a bug so please post this to our bug tracker. Dot not forget to mention the SDCC version you're using. Regards, Maarten > Hi. > > I can't use static variables inside functions or I get "Error: > relocation error". My solu

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxx x?

2018-04-07 Thread Maarten Brock
> Am 07.04.2018 um 18:31 schrieb Maarten Brock: >>> Am 07.04.2018 um 15:50 schrieb Maarten Brock: >>> >>>> I see in the stm8-large regression that you fixed it by loading the >>>> least >>>> significant word into x and the most significant

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxx x?

2018-04-07 Thread Maarten Brock
> Am 07.04.2018 um 15:50 schrieb Maarten Brock: > >> I see in the stm8-large regression that you fixed it by loading the >> least >> significant word into x and the most significant byte into a and write >> those to the function pointer location as you need them. Is t

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxx x?

2018-04-07 Thread Maarten Brock
> Am 06.04.2018 um 14:12 schrieb Eric Rullens: >> Dear Philipp, >> >> Apologies for bumping into this conversation (and thank you very much >> for >> all the work!), but I think the assembler does what it should do. >> >> Please consider the following: >> >> […] >> >>

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxxx?

2018-04-02 Thread Maarten Brock
>> Am 31.03.2018 um 10:42 schrieb Erik Petrich: >>> >>> I have enabled the assembler to emit 24-bit addresses in the relocation >>> records for stm8 like it does for ds390 and mcs51 (even though mcs51 is >>> only using 16-bit addresses). So this should allow you to reference the >>> individual byte

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxxx?

2018-04-02 Thread Maarten Brock
> Am 31.03.2018 um 10:42 schrieb Erik Petrich: >> >> I have enabled the assembler to emit 24-bit addresses in the relocation >> records for stm8 like it does for ds390 and mcs51 (even though mcs51 is >> only using 16-bit addresses). So this should allow you to reference the >> individual bytes of t

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxxx?

2018-03-29 Thread Maarten Brock
> Am 24.03.2018 um 20:21 schrieb Philipp Klaus Krause: >> Am 24.03.2018 um 20:00 schrieb Maarten Brock: >>> How about what the mcs51 back end does: just shift right by 8: >>> ;genAssign >>> movdptr,#___fail_PARM_2 >>>

Re: [Sdcc-user] How to deal bytewise with 24-bit symbols in asxxxx?

2018-03-24 Thread Maarten Brock
How about what the mcs51 back end does: just shift right by 8: ;genAssign movdptr,#___fail_PARM_2 mova,#___str_3 movx@dptr,a mova,#(___str_3 >> 8) incdptr movx@dptr,a Maarten > as (and the

Re: [Sdcc-user] Why so few bug reports since 3.7.0?

2018-03-20 Thread Maarten Brock
Hi, At one time SiLabs adopted SDCC's (my) compiler.h to account for compiler differences. I'm not entirely sure they still do though. But with sfr definitions using the macros from compiler.h in device specific header files it should be easy to migrate. There is no such thing for assembler. Fu

Re: [Sdcc-user] jump with a macro

2018-03-18 Thread Maarten Brock
ro would be nice to have, because > counting the bytes of instructions is error prone... :) > Thx. > Bye > Arne > > Am Samstag, 17. März 2018, 12:54:48 UTC hat Maarten Brock > Folgendes geschrieben: > > Hello Arne, > > I believe you can use a relative offset like this:

Re: [Sdcc-user] jump with a macro

2018-03-17 Thread Maarten Brock
Hello Arne, I believe you can use a relative offset like this: mov A,(USB0ADR) jb (ACC+USBBUSY), .-2 ; . = address of this instruction Or you can use reusable symbols below 100 (SDCC uses above 100) 2$: mov A,(USB0ADR) jb (ACC+USBBUSY), 2$ ; . = address of this instruction Have loo

Re: [Sdcc-user] STM8 >32kB code fails...?

2018-02-22 Thread Maarten Brock
>> Am 19.02.2018 um 10:50 schrieb Maarten Brock: >> > >> > Do I understand correctly that your STM8 has code memory >> above 0x? >> > So the problem is that SDCC only generates 16 bit jump/call >> > instructions and thus cannot reach 0x1 an

Re: [Sdcc-user] STM8 >32kB code fails...?

2018-02-21 Thread Maarten Brock
> Am 18.02.2018 um 07:50 schrieb Georg Icking-Konert: >> hello all, >> >> following a discussion on the updated STM8 SPL license (see >> https://github.com/gicking/STM8-SPL_SDCC_patch/issues/1 ) I happened to >> notice something strange: >> >> 1) build example including all SPL modules, where a pin

Re: [Sdcc-user] SDCC 3.7.0 Release Candidate 1

2018-02-11 Thread Maarten Brock
> Am 11.02.2018 um 17:40 schrieb Alan Cox: >> >>> * New methods to obtain tree-decompositions of control-flow graphs >>> improve compilation time / code-quality trade-off (when SDCC is built >>> with support for the treedec library). >> >> Where do I find the treedec library ? >> >> > > https://git

Re: [Sdcc-user] Using idata for the stack on C8051

2018-02-08 Thread Maarten Brock
> According to the datasheet, the C8051F120 has 256 B __idata memory that > can be used for the stack. By default, SDCC uses the the 128B __data > memory (the lower part half of __idata) for the stack. And indeed, when > compiling a program using --model-large --stack-auto, it only uses > __data an

Re: [Sdcc-user] problem with volatile struct member

2017-10-22 Thread Maarten Brock
Hello, > Am 18.07.2017 um 16:59 schrieb Daniel Drotos: >> >> Hi, >> >> I'm using sdcc-stm8 with following code: >> >> struct FLASH_t { ... ; volatile uint8_t iapsr; ...}; >> #define FLASH ((struct FLASH_t *)BASE_ADDRESS_OF_FLASH_CONTROLLER) >> >> Program waits end of flash operation in a busy loop

Re: [Sdcc-user] SiLabs EFM8 Support

2017-08-18 Thread Maarten Brock
> On Fri, Aug 18, 2017 at 10:39 AM, R0b0t1 wrote: >> What is the status of EFM8 support? They are an 8051 based >> microcontroller, so I expect code generation to be a nonissue. What >> difficulties might I experience porting the manufacturer's device >> headers? >> > > Sorry list, I checked some

Re: [Sdcc-user] How to place some data at a specific location amidst some code?

2017-08-18 Thread Maarten Brock
Hello Philipp, > I haven't been using the keyword __at much. > But now I have a case where I want code to be placed in the 0x to 0x9fff range. > > However, at the specific location 0x1ff0 I want 16 specific header bytes. The linker should just put the code around the header (which might requi

Re: [Sdcc-user] Access to local variables from inline assembly (PIC14)

2017-08-06 Thread Maarten Brock
> Access to global variable is no problem, just use _varname, but how can > I access local variables? Is there no other way than using the > compiler-generated names (which may change if the code is changed)? > > BR > Erlo This highly depends on the target and compiler options. Local variables on

Re: [Sdcc-user] Can't figure out how to write interrupt handlers for Z80 using SDCC

2017-06-05 Thread Maarten Brock
Hello Adam, I think you're supposed to take our crt.s and modifiy it to your needs with the missing jumps. https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/device/lib/z80/crt0.s Assemble it and then link it with the rest of your application. Maarten > Hi, > > I'm developing a program in

Re: [Sdcc-user] Compiling SDCC with MSYS2/MINGW

2017-05-15 Thread Maarten Brock
compile of library file cause seg violation" > (that one also mentions _atof.rel). Would you like me to raise a ticket > for > it, start another email thread (given the issues are both mingw related, > but target different architectures) or shall we continue the discussion > he

Re: [Sdcc-user] Compiling SDCC with MSYS2/MINGW

2017-05-14 Thread Maarten Brock
> Hello everybody, > Running into a strange issue trying to compile SDCC with the msys2 > environment. > I've successfully downloaded gputils from source and compiled: > > $ gcc -v > > > gcc version 6.3.0 (Rev2, Built by MSYS2 project) >

Re: [Sdcc-user] Tutorials for STM8 and MCS-51 development using the Small Device C Compiler for various boards

2017-05-14 Thread Maarten Brock
> Based on my experience in getting started with various STM8 and MCS-51 > boards, I wrote a few simple tutorials to help others. They use free > tools only. For various evaluation boards there are three simple demos: > > 1) LED counter controlled by timer > 2) Serial output > 3) Dhrystone / Whetst

Re: [Sdcc-user] binary constants for STM8?

2017-05-06 Thread Maarten Brock
> again hello, > > in the SDCC manual I read "SDCC supports the use of binary constants, > such as 0b01100010. This feature is only enabled when the compiler is > invoked using –std-sdccxx" > > However, calling SDCC for stm8 with –std-sdccxx fails with "syntax > error" for the literal and a war

Re: [Sdcc-user] overloading functions (weak)?

2017-05-06 Thread Maarten Brock
> hello all, > > apparently it is possible to overload functions in SDCC for STM8, as > shown recently in the getchar() implementation in one of the previous > mails. Is this something that can also be done with C routines in a > project? If yes, is there something like a "__weak" attribute to tell

Re: [Sdcc-user] Local variable in mixed asm/c vs compiler warning

2017-04-30 Thread Maarten Brock
> Consider the following snippet: > > // override getchar from stdlib > int > getchar(void) > { > __asm > l1:in a,(I8251_STATUS)// get status >and #I8251_S_RXRDY // check RxRDY bit >jp z,l1// not ready, loop >in a,(

Re: [Sdcc-user] ask for errors when compiling with sdcc a pic 16f877a

2017-02-09 Thread Maarten Brock
Hi, Look for the pic header files in a non-free package of arch linux. Or else uninstall the sdcc package, download the source from our sourceforge page and compile and install from there. Maarten > Hi, I was wondering if im losing an step on trying to compile a > microchips pic 16f877a with s

Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-30 Thread Maarten Brock
> On 29.12.2016 23:16, Maarten Brock wrote: >> >> These values get you a 453 baudrate: >> 24.5MHz / 8 / (256-45) / 32 = 453 >> >> 300 baud is really low and impossible to achieve with T1 in 8-bit >> autoreload. Most USB-UARTs even have this as their lower le

Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-29 Thread Maarten Brock
> While LED blinking and timer interrupts re working now, I wasn't able to > get serial I/O to work yet. I only see garbage (all received bytes are > either 0x00 or 0x80). > I tried to port my "Hello, world!" that I already got working for many > other mcs51 variants: > > #include > > #include >

Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-27 Thread Maarten Brock
> On 26.12.2016 22:20, Maarten Brock wrote: >> Further, if you don't use our c8051f120.h> you will have to define >> _XPAGE yourself to let the xdata initialization succeed in the future. > > Shouldn't the default from crtpagessfr do, since the C8051F120 has >

Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-26 Thread Maarten Brock
Hi Philipp, On what SFRPAGE are P3MDOUT and XBR2 located? Is that also the default? Further, if you don't use our c8051f120.h> you will have to define _XPAGE yourself to let the xdata initialization succeed in the future. Maarten > To look into SDCC mcs51 performance, I wanted to run Whetstone,

Re: [Sdcc-user] Peephole rules

2016-12-17 Thread Maarten Brock
> >>I've loocked at this file (as I mentioned earlier). Some moments push me >> to ask questions. There are parameters like > > > >>notUsed('a'), >>notSame(%2 'push' 'pop'), >>notSame(%1 'xl' 'xh' 'yl' 'yh'), >>immdInRange(0 255 '+' %1 %2 %9), >>labelIsUncondJump(), >>labelRefCountChange >>and man

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread Maarten Brock
> Hello. Where I can read about writing peephole rules for sdcc? I > looked at sources and found one file, but its syntax is unclear for me. > Target platform is stm8 Start by looking at the peephole definition file in the sources that is automatically used. https://sourceforge.net/p/sdcc/code/HEA

Re: [Sdcc-user] Link external binary data into ROM image? (gbz80)

2016-11-28 Thread Maarten Brock
Hello, How about converting the blob to a constant initialized byte array in a C file? This something that e.g. http://srecord.sourceforge.net/ can do. Maarten > Hey there. > > I'm having a question. I'd need to include binary blobs (more precisely > image data) into my program. These should exp

Re: [Sdcc-user] Memory usage summary for STM8

2016-10-09 Thread Maarten Brock
> On 09-10-2016 17:00, Philipp Klaus Krause wrote: >> On 05.10.2016 14:11, Márton Miklós wrote: >>> Hello all, >>> >>> I am looking for an option/command for displaying the memory usage >>> statistic for the STM8 target. >>> I have seen on many places that a *.mem file is generated, but in my >>> c

Re: [Sdcc-user] getting started with C8051

2016-08-30 Thread Maarten Brock
> > On 2016-08-29 22:30, Philipp Klaus Krause wrote: >> On 29.08.2016 00:20, Benjamin Larsson wrote: >>> On 08/28/2016 11:30 PM, Philipp Klaus Krause wrote: On 28.08.2016 23:13, Benjamin Larsson wrote: > On 08/28/2016 11:03 PM, Philipp Klaus Krause wrote: >> Dear Benjamin, >> >

Re: [Sdcc-user] getting started with C8051

2016-08-28 Thread Maarten Brock
> Hi. > >> >> I have serial output on the C8051F330 board RDM6300 working via >> putchar() (see attached code). But whenever I try to use printf(), >> everything gets messed up: Garbage output on the serial line or the >> device resets. > > That is exactly the same behaviour I got on the F330. My c

Re: [Sdcc-user] C8051 clock and timers

2016-08-28 Thread Maarten Brock
> On 28.08.2016 10:48, Philipp Klaus Krause wrote: >> I have some trouble understanding the C8051 clock and timers. >> In the tutorial code at >> http://www.colecovision.eu/mcs51/C8051F340%20380%20LED.shtml I get a >> timer interrupt at 1000 Hz. But I got the values for configuring the >> timer exp

Re: [Sdcc-user] getting started with C8051

2016-08-22 Thread Maarten Brock
> >> Hello Benjamin, >> >> Using a delay loop counting a non-volatile variable is asking for >> trouble. >> This code has no side effects and can be completely removed by compiler >> optimizations. And with an F340 running twice as fast as as an F300 the >> delay won't be the same either. >> >> A p

Re: [Sdcc-user] getting started with C8051

2016-08-19 Thread Maarten Brock
>> I'm just trying to write my first C8051 program: >> >> __sfr __at(0xa0) P2; >> __sfr __at(0xa6) P2MDOUT; >> __sfr __at(0xe2) XBR1; >> >> unsigned long int u = 0; >> #define u 0ul >> >> void main(void) >> { >> // Enable port output >> XBR1 = 0x40; >> P2MDOUT = 0x0c; >> >> for(

Re: [Sdcc-user] getting started with C8051

2016-08-19 Thread Maarten Brock
> I'm just trying to write my first C8051 program: > > __sfr __at(0xa0) P2; > __sfr __at(0xa6) P2MDOUT; > __sfr __at(0xe2) XBR1; > > unsigned long int u = 0; > #define u 0ul > > void main(void) > { > // Enable port output > XBR1 = 0x40; > P2MDOUT = 0x0c; > > for(;;) >

Re: [Sdcc-user] Z80 Assembly Development

2016-08-17 Thread Maarten Brock
> Hello SDCC users, > > > I'm doing a project with the famous Z80 just for fun, and decided to use > the sdasz80 assembler. My project consists of multiple source files to > keep everything modular. I'm having a problem with the linking step. > I've 2 source files: boot.asm and numconv.asm: > > > ;

Re: [Sdcc-user] mcs51 / FX2LP performance - 0.0096 DMIPS / Mhz correct?

2016-08-16 Thread Maarten Brock
> I have proted Dhrystone to the FX2LP, and ran it at 48 Mhz. I get the > results below, which translates to 0.0096 DMIPS / Mhz (vs. 0.355 DMIPS / > Mhz for stm8 in current SDCC). So the STM8 is about 37 times faster per > Mhz than the FX2LP. Does that seem about right? > > For the FX2LP I Used --m

Re: [Sdcc-user] FX2LP timer 1 issue

2016-08-15 Thread Maarten Brock
> On 15.08.2016 20:54, Maarten Brock wrote: >>> On 15.08.2016 20:01, Philipp Klaus Krause wrote: >>>> Hello, >>>> >>>> I wrote my first little mcs51 program today, for the Cypress FX2LP. >>>> But >>>> I encountered a problem

Re: [Sdcc-user] FX2LP timer 1 issue

2016-08-15 Thread Maarten Brock
> On 15.08.2016 20:01, Philipp Klaus Krause wrote: >> Hello, >> >> I wrote my first little mcs51 program today, for the Cypress FX2LP. But >> I encountered a problem: Timer 1 runs too fast. When I set up Timer 0 >> and Timer 1 the same, Timer 1 runs about 4 times faster. >> >> I first noticed the p

Re: [Sdcc-user] Using SDCC with Linux to program the Silicon Labs EFM8

2016-08-09 Thread Maarten Brock
> On Tue, Aug 9, 2016 at 11:24 AM, Maarten Brock > wrote: > >> > Hello, >> > >> > Not directly related to SDCC but I am sure some people here can answer >> it. >> > I need to use the EFM8 MCU, the software itself will be compiled with >>

Re: [Sdcc-user] Using SDCC with Linux to program the Silicon Labs EFM8

2016-08-09 Thread Maarten Brock
> Hello, > > Not directly related to SDCC but I am sure some people here can answer it. > I need to use the EFM8 MCU, the software itself will be compiled with > SDCC. > My question is how to program the chip from Linux? > I did not find any solution neither on google nor on Silicon Labs web > site

Re: [Sdcc-user] [sdcc-devel] VS2010 Source Compatibility?

2016-07-29 Thread Maarten Brock
> On 29.07.2016 11:12, Philipp Klaus Krause wrote: > > On 29.07.2016 10:24, Maarten Brock wrote: > >> Hello all, > >> > >> We kept MSVC 6 support (and thus Windows 98 as development system) > >> for over 10 years before switching to MSVC 2010. I

Re: [Sdcc-user] [sdcc-devel] VS2010 Source Compatibility?

2016-07-29 Thread Maarten Brock
Hello all, We kept MSVC 6 support (and thus Windows 98 as development system) for over 10 years before switching to MSVC 2010. I'm not sure if this has set a precedent. MSVC 2013 seems to require a 64 bit Windows 7. Is there anyone compiling SDCC on Windows who cannot switch to at least MSVC 2

Re: [Sdcc-user] 8051-variant dev board recommendations

2016-07-09 Thread Maarten Brock
> On 08.07.2016 11:06, Maarten Brock wrote: >> Hello, >> >> SiLabs has no dual DPTR processors. >> >> The EMI0CN is the equivalent of P2 on a traditional 8051 for MOVX @Ri >> instructions. It is used by SDCC for pdata access. Mucking about with it >> in

Re: [Sdcc-user] 8051-variant dev board recommendations

2016-07-09 Thread Maarten Brock
> On 07.07.2016 05:42, Sab V wrote: >> This may not meet all your requirements, but you should look at the FX2 >> from cypress. > > FX2LP looks good: 16 KB shared data/code RAM. Free fxload tool (even > already in Debian GNU/Linux). Cheap (approx. 10 € dev boards). AMD > 80C521-like dual dptr. > >

  1   2   3   4   5   6   >