Re: [Sdcc-user] Emergency help... linker memory error with DSEG

2008-09-09 Thread Maarten Brock
Jesse, It might also help to spread your functions over multiple source files. Every source file generates one object file and all allocations in a segment (e.g. DSEG which gets the slocs) are placed by the linker in one chunk. The only way to subdivide the chunk into smaller ones is to split

Re: [Sdcc-user] use of XRAM with the AT89C51ED2

2008-09-09 Thread Maarten Brock
Forwarded message follows: Marteen, I just ran across the multiple file info in the SDCC user's manual, which explained the linking of multiple files. I now seem to be able to use more than 256 bytes of XDATA in my program--I set up for 1024 bytes of XRAM. I'll test the XRAM more rigorously

Re: [Sdcc-user] Emergency help... linker memory error with DSEG

2008-09-10 Thread Maarten Brock
Jesse, > unsigned long var32; > unsigned short var16; > > If I do this: > > var32= var16 * 60; > > I get a 16-bit multiply, not a 32-bit. This caused an overflow and a > bug. doing this: > > var32= *(unsigned long)var16) * 60; > > solves that. > > But, I thought that there was automatic t

Re: [Sdcc-user] ___fsdiv_PARM_2 and 8051

2008-10-18 Thread Maarten Brock
I guess it isn't there because this only holds true for mcs51 and not necessarily for the other targets. And besides, these functions are helper functions for SDCC to perform floating point arithmetic. They were not created to be used directly. > Hi Maarten > > > > IIRC the __fs floating poin

Re: [Sdcc-user] Lib vs rel

2008-10-22 Thread Maarten Brock
Hello Dennis, You are right. The linker only includes objects from a library if it is referenced. The solution is to either put something in the object that you can explicitly reference or to use the .rel file directly. HTH, Maarten > I've created a little custom assembly for an interrupt au

Re: [Sdcc-user] Memory Weirdness

2008-11-02 Thread Maarten Brock
Dennis, Initially you had --xram-loc=0x4000, but the FX2 has only 16kB RAM so there is nothing at 0x4000 unless you have external RAM connected. Without any --xram-loc SDCC puts xdata at 0x but unless you have external ROM and EA=1 this memory is shared with code memory. So any write to x

Re: [Sdcc-user] I2C on 87C751?

2008-12-05 Thread Maarten Brock
I suggest you try Code Architect free from www.esacademy.org > >Has anyone written any general-purpose routines for SDCC to deal > with the on-chip I2C controller in the 87C751 that they'd be willing > to share? > > Thanks, > -Dave > > -- > Dave McGuire > Port

Re: [Sdcc-user] SDCC internal compiler error

2008-12-16 Thread Maarten Brock
Colin, Please file this as a bug report in our SourceForge tracker system. On a mailing list it will simply be forgotten and on this USER mailing list I doubt there are any users who can help you with this. Greets, Maarten > I have encountered an internal compiler error when compiling > a pa

Re: [Sdcc-user] TUSB3210 and TUSB2136 (8051 with USB) headers, library and demo programs

2008-12-31 Thread Maarten Brock
Hello Hansi, I'm not sure what to do with the library. SDCC currently has almost no library code for 8051 derivatives and I'm not sure if we want to start to. Most library functionality can be found on the SDCC OKR, on www.8052.com or on the website of the manufacturer. But I'm just one vote s

Re: [Sdcc-user] Differences between large and medium model for mcs51

2009-01-02 Thread Maarten Brock
Happy New Year Mark, The difference is that medium model puts the variables in pdata and large in xdata. Pdata (max. 256 bytes) is smaller than xdata (max. 64kB) but can be accessed with two pointers (r0,r1) what might result in smaller code than xdata which only can use dptr. Maarten > What

Re: [Sdcc-user] Differences between large and medium model for mcs51

2009-01-02 Thread Maarten Brock
anual. I still think it's a good idea though and maybe one day in the future... Sorry for the bad news, Maarten > On Fri, 02 Jan 2009 14:54:26 +0100 > Frieder Ferlemann wrote: > > > Hi Mark, > > > > Maarten Brock schrieb: > > > The difference is that m

Re: [Sdcc-user] LCD print("string") function?

2009-01-04 Thread Maarten Brock
If you don't need a full printf, you can also use puts which also uses putchar. > Thanks for the reply. On your reccomendation, I looked at some print > examples, but didn't need anything as powerful as printf. > I just created a print_LCD (unsigned char* message). function. Here's the > worki

Re: [Sdcc-user] PIC18F4550 pointer performance

2009-01-08 Thread Maarten Brock
Raphael, Kustaa, > Assignments to the pointer should not need special attention, except > for casts: > ptr = (struct something *)&blob; > might need to be rewritten to > ptr = (__data struct something *)&blob; With my change last week (and fix just a minute ago) this should not be necess

Re: [Sdcc-user] TUSB3210 and TUSB2136 (8051 with USB) headers, library and demo programs

2009-01-11 Thread Maarten Brock
Hansi, > Am Mittwoch, den 31.12.2008, 17:43 +0100 schrieb Maarten Brock: > > The headers could be included and I'm glad you already used > > compiler.h. But I do not like anything I see in uctypes.h. NULL, > > bool and the int's are all already defined in stdlib

Re: [Sdcc-user] New TinyOS 8051 platform results in non zero exit code

2009-01-16 Thread Maarten Brock
But it looks like Martin uses it on an unsigned char and not on a bit variable. I doubt it will create a problem here. Probably not even suboptimal code. Maarten > In SDCC, use ! instead of ~ to flip a bit. > > > -Original Message- > From: Martin Leopold > To: sdcc-user@lists.sourcef

Re: [Sdcc-user] Function addressing

2009-01-18 Thread Maarten Brock
Or in C void (*fp)(void) = 0xfff0; fp(); > Try: > > _asm lcall 0xfff0 _endasm; > > > At 10:59 AM 18/01/2009, Gudjon I. Gudjonsson wrote: > > >Hi > > Sorry once again if the question is silly but I am trying to call the > >PGM_MTP at address 0xFFF0 > >function in the in application bootlo

Re: [Sdcc-user] Function addressing

2009-01-19 Thread Maarten Brock
Ok, make it a const function pointer then. And to get rid of the warning add a cast too: void (* const fp)(void) = (void (*)(void))0xFFF0; fp(); Now it's as small as the inline asm. Maarten > The resulting code using the C version generates this assembly instructions: > > mov _fp,#0xF0 >

Re: [Sdcc-user] __critical does nothing with PIC18F4550 ?

2009-01-20 Thread Maarten Brock
Hi, > > Do we need to protect the prologue/epilogue? > > Not sure, probably not, though __critical attached to the function > probably would. For other targets the prologue and epilogue aren't protected either. The idea was to keep interrupts off as short as possible. But there is an RFE for i

Re: [Sdcc-user] Help with code-banking

2009-01-23 Thread Maarten Brock
Andy, SDCC generates a so-called extended intel-hex file. This also contains records to indicate the start of a new segment/bank. If your bootloader or whatever you use to program the chip(s) does not understand extended hex- files you can use srecord to split the file into several hex-files f

Re: [Sdcc-user] printf_large floating support in libsdcc.lib

2009-01-25 Thread Maarten Brock
g the library for the regression tests only. I still would like to see more responses. Maarten > Borut Razem schrieb: > > I and Maarten Brock had a discussion and agreed to enable the floating > > point support in printf_large() function included in libsdcc.lib > > librar

Re: [Sdcc-user] Help with code-banking

2009-01-28 Thread Maarten Brock
> Thanks in advance, > Andy > > > > > > > > Message: 4 > > Date: Fri, 23 Jan 2009 20:28:49 +0100 > > From: "Maarten Brock" > > Subject: Re: [Sdcc-user] Help with code-banking > > To: sdcc-user@lists.sourceforge.net > > Message-

Re: [Sdcc-user] Sdcc-user Digest, Vol 32, Issue 24

2009-01-31 Thread Maarten Brock
Hi Andy, Please send me the files to reproduce this error. I'll see if I can do something about it. Maarten > Maarten, > > Many thanks for the excellent response so far. > Please bear with the following lengthy explanation > >

Re: [Sdcc-user] Help with code-banking

2009-02-06 Thread Maarten Brock
Overrun = overrun; > hexRecord(addr, rtvalIndex); > return; > } > > I've tried to compress the app even further, to get something small > enough to submit as a how-to-reproduce sample. However the problem goes > away if I get it any smaller

Re: [Sdcc-user] sprintf function and float and int (pic16)

2009-02-10 Thread Maarten Brock
Hi Alexandre, Please look in the manual under "Library Routines". It explains why floating point support is disabled in printf by default and how to turn it on. Greets, Maarten > Hello everyone. > > I had a problem working with float and integer numbers in SDCC using the > sprintf function. > >

Re: [Sdcc-user] How to make default pointer type xdata

2009-02-11 Thread Maarten Brock
Peter, That is currently impossible because how would you otherwise create a generic pointer? There is no 'generic' keyword. Maarten > Hi, > > How to make a default pointer type xdata pointer and not generic as it is > currently. > > > Cheers, > Peter Kuhar > > > http://www.pkuhar.com/ >

Re: [Sdcc-user] How to make default pointer type xdata

2009-02-15 Thread Maarten Brock
ding an option to make unqulified > pointers xdata. > > Cheers, > Peter > > http://www.pkuhar.com/ > http://www.modula.si > skype: pkuhar > > > On Wed, Feb 11, 2009 at 9:39 AM, Maarten Brock > wrote: > > > Peter, > > > > That is currently

Re: [Sdcc-user] sdcc compiler syntax

2009-02-16 Thread Maarten Brock
Hello, You're compiling for mcs51 (default) and this has a harvard architecture. So the compiler needs to know what memory type the pointer should point to (code/data/xdata?). C was created with a VonNeumann architecture in mind. Maarten > Hi, > > Code in main.c : > > int main() > { > unsi

Re: [Sdcc-user] Using --model-large, IRAM full unless I use --stack-auto

2009-02-20 Thread Maarten Brock
Andy, You're right. The combination --model-large and --stack-auto is not pre-built for SDCC. And when using --model-large you'll find a lot of intermediate temperary results (sloc) are located in data memory. More info is in the .map file, but library locals do not show up. Maarten > I've t

Re: [Sdcc-user] SDCC interrupt woes

2009-03-01 Thread Maarten Brock
Ronny, If the registers are not used in the ISR they do not need to be saved and restored. The compiler does check that. And without a clue what the source and generated asm looks like we cannot help you more. Maarten > I have a small routine that uses an interrupt to reset a timer. It appe

Re: [Sdcc-user] Bug in printf?

2009-03-02 Thread Maarten Brock
Andy, Good catch. I think you are right and I programmed the bug. Borut, Shall we fix this before the release? Maarten > To those in the know, > > The code for printf (printf_large.c) is as follows. My question is, > should the space conditions be '>=' rather than just '>' ? (I did some > ra

Re: [Sdcc-user] Help building the test program

2009-03-04 Thread Maarten Brock
To install SDCC you probably used a linux package which contains the FREE parts only. The NONFREE parts as they were labeled contain the mcs51 target. I guess they forgot to change the default target (mcs51) even though they disabled it. Maarten > It would be useful to know the actual command tha

Re: [Sdcc-user] Dual DPTR on 8051

2009-03-10 Thread Maarten Brock
Sorry, this is currently not possible. > Hi, > > Is is possible to enable dual dptr support without selecting -mds390? > > The chip is cc2430 and has: > DPH0 (0x83) – Data Pointer 0 High Byte > DPL0 (0x82) – Data Pointer 0 Low Byte > DPH1 (0x85) – Data Pointer 1 High Byte > DPL1 (0x84) –

Re: [Sdcc-user] Reserving an area on code memory segment

2009-03-10 Thread Maarten Brock
Peter, Please include SDCC version and target for which you compile. For mcs51 this should work I think. Maarten > Hi, > > Is it possible to make linker skip a part of code memory? > > I'd like to use a segment of flash in the middle the whole flash for data. > > Ex. flash segments are 2k.

Re: [Sdcc-user] syntax error

2009-03-24 Thread Maarten Brock
Hello, Currently I cannot verify but have you used the latest version of SDCC? If so please file it as a bug in the tracker system. I also recommend to try: xdata PBYTE xptr; Greets, Maarten > Hi, > > Code in main.c : > > typedef unsigned char * PBYTE; > > int main() > { > PBYTE xdata xptr; >

Re: [Sdcc-user] SDCC-2.8.0 and AT89C2051

2009-05-05 Thread Maarten Brock
Ricardo, Are you by any chance using SDCC on debian linux? If so, be warned that it comes with pic support only unless you install the *-nf (non-free) package. Otherwise, it might be useful to tell us what "error" you get. Maarten > Hi: > > Am using an AT89C2051 with a very simple program i

Re: [Sdcc-user] Request about adding a new micro support

2009-05-10 Thread Maarten Brock
Hi, There is no manual for it, but there is some info on the SDCC wiki under "SDCC internals and porting". And if after that you have questions, just ask. Greets, Maarten > Hi All, > > Sorry for my bad english. > How can I add to sdcc support for a 8-bit micro (Harvard architecture)? > An RT

Re: [Sdcc-user] [function pointer bug]The function pointer in struct located in code segment cannot work.

2009-07-06 Thread Maarten Brock
Hi, It looks like you think you've found a bug. Posting it in the user mailing list might get you a quick answer. But if not, it is bound to be forgotten. Bugs should be reported in the bug tracker system. Please repost. Maarten > Hi all, > > We use SDCC with our project and we encountered some

Re: [Sdcc-user] pointer reference stays empty

2009-07-06 Thread Maarten Brock
Hello Bart, I agree with Bodo. Xdata is probably not set up correctly. Does your mcu have internal xdata? And do you need to enable it? Otherwise I expect your real external ram not to be working. You should not need to initialize malloc, it's probably ok. Greets, Maarten > Hi Bart, > > Your an

Re: [Sdcc-user] [BUG] bad code generation for array of code pointers

2009-07-10 Thread Maarten Brock
Lv Zheng, If you think you found a bug please file it in SDCC's bug tracker at sourceforge. On the mailinglist it is bound to be forgotten. Greets, Maarten Brock > Hi, all > > We post this message for someone who might be put in a great > quandary like us. > > Please l

Re: [Sdcc-user] Porting old SDCC-application to new 2.9.0

2009-07-18 Thread Maarten Brock
Hi, Are you using absolutely located bits? And are they declared in multiple source files (possibly through a .h file)? And why don't you like what --pack-iram gives? Maarten > Hello. > > I'm trying to port an application to SDCC 2.9.0 from SDCC 2.3.8. > Compiling using the old Makefile that i

Re: [Sdcc-user] Porting old SDCC-application to new 2.9.0

2009-07-18 Thread Maarten Brock
to do with it, but it's an > obvious thing I noted that is different. > > Greetings, > > Christian "BC" Svensson > Codelead Systems - http://www.codelead.se > > > On Sat, Jul 18, 2009 at 10:57 PM, Maarten Brock > wrote: > >> Hi, >> >

Re: [Sdcc-user] Porting old SDCC-application to new 2.9.0

2009-07-19 Thread Maarten Brock
re indeed declared in header files. > > Christian "BC" Svensson > Codelead Systems - http://www.codelead.se > > > On Sun, Jul 19, 2009 at 8:25 AM, Maarten Brock > wrote: > >> Search for the keyword "at" that is used to absolutely locate variables. &g

Re: [Sdcc-user] pointer reference stays empty

2009-07-21 Thread Maarten Brock
Bart, Did you ever mention which mcu you're using? You say it has 2kB of internal ram. But have you checked if you need to enable it? SDCC will not do that for you! The best place to do it is in _sdcc_external_startup(). Maarten > Hello Bodo & Maarten > > My apologies for the very late reply, i

Re: [Sdcc-user] Trying to use compiler.h for 8051

2009-07-23 Thread Maarten Brock
Instead of FSR you should enter its address 0xF8. > I'm trying to use the macros in compiler.h to port some headers from Keil. > So I have stuff like... > > SFR(FSR, 0xF8); > SBIT(MCDIS, FSR, 7); > > And sdcc is telling me "Initializer element is not constant". What am I > doing wrong?

Re: [Sdcc-user] Linker error: "memory overlap at 0x0 for RSEG0"

2009-09-05 Thread Maarten Brock
Miles, You probably have sfr definitions in Keil notation in there. Maarten > Ralph, > > Thanks very much. You were right, the .rel files were just preprocessed > source code (which I noticed before and was confused about). I'm using sdcc > to compile now, and after some tweaking of flags an

Re: [Sdcc-user] Moving const area to begining of program memory

2009-09-19 Thread Maarten Brock
Hello Peter, This method only works for z80 I think. For mcs51 the best option is to absolutely locate the CONST area while linking. Remember that the lowest address is used by the reset and interrupt vectors, so stay above them. Example: sdcc main.rel others.rel -Wl-bCONST=0x0400 HTH, Maart

Re: [Sdcc-user] local bit variable in remote function or main not assigned.

2009-10-13 Thread Maarten Brock
Hi Kurt, It looks like you found a bug. The reason it only complains about the flag in main is because it's optimized away in test. Somehow SDCC forgets to allocate the space for the local bit variable. If you make it static or volatile it does get an address. And as you found out also when i

Re: [Sdcc-user] SDCC copiler error

2009-10-14 Thread Maarten Brock
Hi Tebogo, SDCC cannot pass structs as parameters. You probably got a warning too about the struct being converted to a pointer. I changed that recently because that really did not work, so SDCC 2.9.3 now throws an error. Passing a pointer to the struct should work though. Greets, Maarten >

Re: [Sdcc-user] Serial Port reception- SDCC

2009-10-18 Thread Maarten Brock
Hi Prateek, I don't see anything wrong with your code or the generated assembly. Those pops belong to the prior pushes to save your values. Maarten > Hello, > > > > We are using SDCC for compiling a code for 8051 core from Oregano Systems > target. > We are facing an issue with serial por

Re: [Sdcc-user] Support for C99 designated initializers?

2009-10-27 Thread Maarten Brock
C99 support is very incomplete and this is one of the unsupported parts. > I tried to do something like > > struct {int a, b;} mystruct = { .a=1, .b=1 }; > > and it didn't work, even though I used the --std-c99 option. Did I do > something wrong or is this unsupported? > > The error message w

Re: [Sdcc-user] SDCC 2.8, 2.9 Signal 11 - SIGSEGV

2009-10-27 Thread Maarten Brock
In the meantime, Graham, I'm already trying to fix this bug. Maarten > > LOL > Thanks very much for that, Im glad it was that easy, my stupid typo has cost > me hours of wasted time :-) > Keep up the good work. > > Graham > > -Original Message- > From: Jesus Calvino-Fraga [mailto:jes.

Re: [Sdcc-user] SDCC 2.8, 2.9 Signal 11 - SIGSEGV

2009-10-27 Thread Maarten Brock
Hi Jesus, So I noticed. I should have addressed you too in my reply I guess. To both of you (and the rest), I think I have it fixed already, but still have to run regression tests. I'll let it do that while I get my sleep :) Hopefully tomorrow evening after work I can commit. Greets, Maarte

Re: [Sdcc-user] Fw: Support for C99 designated initializers?

2009-10-28 Thread Maarten Brock
Kurt, If you had read 4.1.1 too, you would have realized that it was enough to declare _XPAGE as an alias for MPAGE to make xdata initialization work. And it probably saves a lot of code memory. Maarten > Brandon; > > In this case I would try initializing your structure within your main > s

Re: [Sdcc-user] sdcc: SDCCopt.c:707 convilong: Assertion `0' failed.

2009-10-29 Thread Maarten Brock
Anthony, There are still header files missing. At least these, but maybe more: 8051def.h log.h timetable-aggregate.h Maarten > I located the source of the problem in timetable.h. > > * int i;* >int t1, t2; > >t1 = t2 = t->size; >for(i = *t->ptr - 1; i >= 0; --i) { > *if(t->t

[Sdcc-user] [Fwd: Re: Fw: Support for C99 designated initializers?]

2009-10-29 Thread Maarten Brock
r does invoke a paged memory access it wouldn't > corrupt P2 which is mapped to IOC (0xA0) of the CY7C68013. I had tested > for paging by decompiling the hex code and searching for P2 in the output > listing prior to redefining _XPAGE. > > > SDCCMan.pdf V2.9.2 Section 4.1.1 for ref

Re: [Sdcc-user] hex vs. ihx

2009-10-30 Thread Maarten Brock
Yes, you can specify it on the command line using the -o option. The .ihx is already an intel hex-file, though not necessarily in ascending order. > Is there some way to output a .hex file instead if the .ihx that SDCC > creates by default? > Thanks, > Ron >

Re: [Sdcc-user] help! very small change in code causes output to not load at all.

2009-11-04 Thread Maarten Brock
Anthony, Are you linking the file that contains main() as the first object? It looks like the linker has put sdcc_call_dptr() at the address of the reset vector which makes it jump to whatever A+DPTR is after reset. Maarten > another strange observation. If I move the actual declaration of t

Re: [Sdcc-user] Next release and Debian package

2009-11-08 Thread Maarten Brock
Gudjon, > Here is one bug in the Debian bug reporting system that I don't know if it > has > been reported to upstream but I know that it still exists in the SVN version > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422599 AFAIK we were unaware of it and unless it is added to our bugtrack

Re: [Sdcc-user] Problem with 8051 and SDCC xdata initialization.

2009-11-09 Thread Maarten Brock
John, Your mcu has its watchdog enabled by default and it bites before you can kick it in main(). Create your own _sdcc_external_startup() function and setup the watchdog there by either kicking it, setting a longer timeout or disabling it. Happy programming, Maarten > My problem seems to be

Re: [Sdcc-user] Next release and Debian package

2009-11-09 Thread Maarten Brock
make an advertisement on the > mailing list. > > Best regards > Gudjon > > On Monday 09 November 2009 22:22:11 Maarten Brock wrote: > > Gudjon, > > > > I think I understood you allright. I fully understand > > that you do not want to create a package of an > &

Re: [Sdcc-user] Next release and Debian package

2009-11-10 Thread Maarten Brock
Borut, I did not advise to use the snapshot for the package, merely to use it to verify fast and simple if the bug indeed was fixed. Then use the fix to backpatch the original 2.9.0. I'm glad Gudjon already took on this approach. Maarten > Borut wrote: >>I'm not very happy with the decision to t

Re: [Sdcc-user] USB CDC or HID implementation on SDCC

2009-11-12 Thread Maarten Brock
Bruno, Have you considered using one of the USB-UART converters from FTDI, SiLabs or Prolific? Much easier than augmenting your application with a complete USB stack just for debug output. And what if your MCU doesn't have USB, only UART? Maarten > Hi guys, I'm playing with SDCC for a while, alw

Re: [Sdcc-user] LCD library

2009-11-12 Thread Maarten Brock
Marcos, SDCC does not have any libraries for any hardware that can be attached to any microcontroller. I don't think we want to take this up either. Such an implementation is usually highly mcu dependant and totally compiler independant. Good places to publish this kind of stuff could be the

Re: [Sdcc-user] LCD library

2009-11-12 Thread Maarten Brock
Roel, > I've been thinking that a site with diferent libraries for SDCC would be a > nice idea. Need to have a bit of quality control, and the diferent > architectures probably need diferent hardware files. But, a collection of > some (hardware)-libs would be nice. Others have thought the same t

Re: [Sdcc-user] Another compiler function oddity... ?

2009-11-13 Thread Maarten Brock
Raphael, I think you are right and that this is a bug. Maarten > Hi, > > >void delay (uint32_t delay) > >{ > > setCounter (delay) ; > > while (!counterTriggered ()) > >; > >} > > > > Gives the error: > > > >dross.c:435: error 98: conflict with previous definiti

Re: [Sdcc-user] Status of SDCC inline support and fixes to review

2009-12-01 Thread Maarten Brock
fixing as many bugs when I find the time. Thanks for your patience (I hope) Maarten Brock > Dear SDCC developers and users, > > because of I have stuck on the broken SDCC inline support years > ago and we still maintain compatibility for MCS51 in our project > we cannot keep hac

Re: [Sdcc-user] Internal XRAM AT89C51ED2

2009-12-11 Thread Maarten Brock
Hi, Just put it in xdata. But also check in the datasheet if this XRAM is enabled by default, otherwise you need to enable it in _sdcc_external_startup(). Maarten > Good morning, everyone > > I need to use the internal XRAM AT89C51ED2. > Can anyone give me guidance on how to set a variable in

Re: [Sdcc-user] mcs51 bankswitching, does anyone have it working based on crtbank.asm example trampoline?

2009-12-14 Thread Maarten Brock
Hi Anthony, It seems bankswitching is broken. And you also found why already: the startup routine should be at 0x and __sdcc_banked_call at some higher address. Does it help if you put the .rel which contains main() as the first object to link? Programmers that cannot handle unsorted hex-

Re: [Sdcc-user] ASlink-Error-Insufficient space in data memory and iram-size limit?

2009-12-14 Thread Maarten Brock
Hi Kurt, I think you misunderstand the keywords data and idata and did not fully graps the (im)possibilities of the 8051 internal ram. Data memory is only 128 bytes big and it shares space with the registers and bit variables. In the upper 128 bytes you can only have idata variables and stack

Re: [Sdcc-user] ASlink-Error-Insufficient space in data memory and iram-size limit?

2009-12-15 Thread Maarten Brock
Kurt, Remove the --iram-size 128 so you can still use the high internal ram for idata variables and stack. Otherwise everything must be crammed into the first 128 bytes. Maarten > Maarten; > > Thanks. I had remembered reading that the stack used idata and could be > mapped into the upper

Re: [Sdcc-user] more bank switching questions...

2009-12-22 Thread Maarten Brock
Hi Anthony, Currently all C-library code is compiled without any bankswitching directive which places the code in CSEG. The linker will put CSEG in the common bank (0x-0x7FFF) so there is no banking problem. Instead of preprocessing your source code I think what you want is a pragma or comman

Re: [Sdcc-user] more bank switching questions...

2010-01-03 Thread Maarten Brock
someone else in testing a new feature? > > > anthony* > > > Maarten Brock wrote: > > Hi Anthony, > > > > Currently all C-library code is compiled without any bankswitching > > directive which places the code in CSEG. The linker will put CSEG in the > > c

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-07 Thread Maarten Brock
Anthony, I see no problem with payload being sent through DPL/DPH/B. It is properly assigned when sending in cc2430_rf_send() and properly read and put on stack when receiving in cc2430_rf_send_b(). Are you messing up DPTR or B or the stack in your adapted __sdcc_banked_call except the one pu

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-07 Thread Maarten Brock
send_b > doesn't find payload_len in the correct position. No, rf_send_b wants payload at SP+1 (plus 1) and it puts it there itself at the start of the function when receiving DPL/DPH/B. It treats payload as a local variable. > Maarten Brock wrote: > > Anthony, > > > &g

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-07 Thread Maarten Brock
end_b wants payload at SP+1 (plus 1) and it puts it there > > itself at the start of the function when receiving DPL/DPH/B. It > > treats payload as a local variable. > > > > > >>Maarten Brock wrote: > >> > >>> Anthony, > >>> > &

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-07 Thread Maarten Brock
029C F8 1136 mov r0,a > 029D E6 1137 mov a,@r0 > 029E C0 E0 1138 pushacc > 02A0 08 1139 inc r0 > 02A1 E6 1140 mov a,@r0 > 02A2 C0 E

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-11 Thread Maarten Brock
Anthony, > Maarten Brock wrote: > >> It should be a stack overflow. The stack supports up to 256 bytes. (?) > >> The SP is at 0x78, so less than half full. > >> > > > > Yes, the stackpointer can go upto address 255. With these values I > > d

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-14 Thread Maarten Brock
Anthony, I think I've found the bug. In mcs51/main.c(795) banked_overhead should be set to 1. And in SDCCast.c(6514) the following should be added: if (IFFUNC_ISBANKEDCALL (name->type)) stackPtr -= port->stack.direction * port->stack.banked_overhead; When I fully have --model-huge working

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-01-18 Thread Maarten Brock
t; #if 0 >if (FUNC_ISINLINE (name->type) && !IS_EXTERN (fetype)) > goto skipall; > #else >/* Temporary hack: always generate code for static inline functions. */ >/* Ideally static inline functions should only be generated if needed. */ >if (FUNC_ISINLINE (name-&

[Sdcc-user] MCS51 model huge

2010-01-30 Thread Maarten Brock
Hello everyone, A new memory model was introduced today for the mcs51 called huge (-- model-huge). It uses bankswitching to call all functions. It passes our regression test suite, but without any real bankswitching in the simulator, so it might still be buggy. It also creates quite some overhe

Re: [Sdcc-user] how to define a bit in a sfr?

2010-02-01 Thread Maarten Brock
Hi, I wanted to reply: __sbit __at (&PSW + 7) CY; But that also doesn't seem to work. So the only option is to do the math yourself. Maarten > hi, > what about: > > __sbit__ at (0xD7) CY; > > ? > > On Sun, Jan 31, 2010 at 10:16 AM, Grissiom wrote: > >> Hello all, >> >> I want to define a sbit

Re: [Sdcc-user] OT: programming Silicon Labs C8051F530

2010-02-04 Thread Maarten Brock
Hi, I assume since you ask on the SDCC user list that you don't ask about writing and compiling the program, but about downloading it to the mcu. For the latter you can try ec2drv. http://sourceforge.net/projects/ec2drv/ Hope this helps, Maarten > I have to write a new project using Silicon Lab

Re: [Sdcc-user] more problems with the latest snapshot

2010-02-07 Thread Maarten Brock
Jan and Borut, I just tried on my old Win98 laptop and cannot complete the installer either. I get the same error as Jan. And if I instead use the zip-file which can be read ok by 7-zip, I get the same warnings about -y, -Y, PSEG and l_IRAM. I don't have Visual C installed on it or any other

Re: [Sdcc-user] Default linker script for mcs51?

2010-02-11 Thread Maarten Brock
Brendan, SDCC does not accept a linker script, but it creates one (extension .lnk) when calling the linker. You can adapt it (or write it yourself) and then call the linker manually instead of through SDCC. Use sdcc -V --verbose to see how the linker is called. To relocate only the code and not t

Re: [Sdcc-user] Default linker script for mcs51?

2010-02-11 Thread Maarten Brock
Brandon, You could also rename your main() to mymain() and generate the necessary startup code yourself in assembly. (Sorry for misspelling your name earlier.) Maarten > > On Feb 11, 2010, at 20:04 , Peter Van Epp wrote: > > > On Thu, Feb 11, 2010 at 12:27:04PM +0100, Brandon Fosdick wrote:

Re: [Sdcc-user] xdata parameters

2010-02-18 Thread Maarten Brock
Hi, You've found a bug that I think I fixed already some time ago. Please try again with the latest snapshot. Maarten > Hello, > > I'm using an 8051-derivative with the 2.9.0 version of SDCC. I am > trying to pass parameters in xdata like this: > > void WriteLEDByte( BYTE iOutput, BYTE

Re: [Sdcc-user] Default linker script for mcs51?

2010-02-21 Thread Maarten Brock
Hi Brandon, You sure know how to make life difficult. Had you asked right away how to create a bootloader instead of how to relocate this and that I would have given totally different advice. First, a bootloader that doesn't redirect the interrupt vectors runs the risk of selfdestruction. If

Re: [Sdcc-user] Default linker script for mcs51?

2010-02-21 Thread Maarten Brock
oing something > obviously wrong, but I couldn't see it at the time. > > Thanks for the advice. Feel free to kill that wiki page if you think it's > inappropriate. I thought I was helping. > > > On Feb 21, 2010, at 17:40 , Maarten Brock wrote: > > >

Re: [Sdcc-user] strange problem with passing variables on stack (mcs51, --auto-stack, large memory model, w/ bank switching)

2010-02-26 Thread Maarten Brock
if there was a way to > make this all much more flexible. > > a* > > Anthony Asterisk wrote: > > Thanks Maarten, your fix has helped! I look forward to your full > > release. Let me know if you need any assistance with testing. > > > > Anthony > >

Re: [Sdcc-user] huge memory model, get_lib_suffix missing HUGE

2010-03-02 Thread Maarten Brock
Thanks Anthony, it's in revision 5722 now. > I downloaded the latest version and noticed a small issue with the huge > memory model. the get_lib_suffix routine is missing the HUGE option... > > case MODEL_MEDIUM: >if (options.stackAuto) > c = "medium-stack-auto

Re: [Sdcc-user] How do I rebuild my standard device libraries on Windows?

2010-03-15 Thread Maarten Brock
Mark, > So, if I build a Linux compatible SDCC on Linux, can I use it to compile > the libraries and drop them into my windows environment? Or will I end > up in some CRLF related purgatory? No, it should work ok. > What ./configure options do I need to use to enable the huge mode > build?

Re: [Sdcc-user] A question on 8051 --stack-auto

2010-03-16 Thread Maarten Brock
Peter, > I'm compiling stuff for the Wiznet W7100 8051 varient and hit the > dreaded "can't allocate DSEG" error. A search through the forum indicates > that --stack-auto and/or large model may fix this. Large model alone didn't > seem to so I rebuilt from source (vi Cygwin) from a recent snap a

Re: [Sdcc-user] A question on 8051 --stack-auto

2010-03-16 Thread Maarten Brock
Peter, > The overflow in DSEG is all > sloc variables and I don't know how to move those (thats what stack-auto > is supposed to do I think?) out of the internal ram. Yes, stack-auto puts the sloc's on stack too. And you cannot move slocs to any other memory, because then SDCC would need sloc'

Re: [Sdcc-user] A question on 8051 --stack-auto

2010-03-17 Thread Maarten Brock
Peter, >> Yes, stack-auto puts the sloc's on stack too. And you >> cannot move slocs to any other memory, because then SDCC >> would need sloc's to access those sloc's. >> > Does that then imply a severe limit on arguments to functions? Using > both --model-large and --stack-auto makes the failing

Re: [Sdcc-user] mpic14: overflow in pointer into array calculation.

2010-03-18 Thread Maarten Brock
Hi Raphael, Can you please verify this also with a larger array? IIRC sdcc checks the array size (in bytes) and then decides if it can get away with 8 bit calculations. Greets, Maarten > Hi, > > SDCC (not restricted to the pic ports) seems to be buggy with array > indices; > the problem is visib

Re: [Sdcc-user] Error in model-huge when calling _sdcc_external_startup plus work around.

2010-03-18 Thread Maarten Brock
Peter, If you look at the latest _startup.c you'll see that _sdcc_external_startup() is now marked __nonbanked. This is a requirement (or naked) for it to work as you found out. Maarten > Thanks to Maarten and Borut's help I was able to get --model-huge code > working on my system. > > I did ru

Re: [Sdcc-user] Error in model-huge when calling _sdcc_external_startup plus work around.

2010-03-18 Thread Maarten Brock
Oops, I should have addressed Mark instead of Peter. > Peter, > > If you look at the latest _startup.c you'll see that > _sdcc_external_startup() is now marked __nonbanked. This is a requirement > (or naked) for it to work as you found out. > > Maarten ---

Re: [Sdcc-user] Error linking a --model-huge project that exceed 64k in code size.

2010-03-20 Thread Maarten Brock
Mark, You need to put the code and consts in named segments and locate these somewhere in the banks. See 4.1.3 in the manual. Maarten > I am continuing to experiment with the new --model-huge option. > > When I try to link files that exceed 64 of code, I get an insufficient > memory error f

Re: [Sdcc-user] What is the efficient way to get the high/low byte of a 16bit int?

2010-03-30 Thread Maarten Brock
Why do you use the cast to unsigned int? That inserts a new intermediate operand. Maarten > On Tue, Mar 30, 2010 at 4:28 PM, Sébastien Lorquet > wrote: > >> Hi, >> >> Aren't the (shortValue&0xFF) and (shortValue>>8) optimized ? I think >> they >> are, at least for pic16. >> >> > Yes they are opt

Re: [Sdcc-user] placing __code 'variables' in higher code banks with mcs51

2010-04-11 Thread Maarten Brock
Anthony, You can change _gptrget.c and _gprtput.c to make it select the bank. Then use a generic pointer to your variables. As long as these functions are in the common bank it should work. IIRC there is no support for direct access yet (even though that would also use _gptrget/put). Directl

  1   2   3   4   5   6   >