Drew DeVault | 30 Jul 04:16 2014

Supporting an odd ABI for a kernel that wasn't designed for C

Hi there! I am Drew DeVault, the primary maintainer of KnightOS:

https://github.com/KnightOS/kernel

It's a z80 operating system that runs on TI calculators. Currently, both
the kernel and userspace are written entirely in assembly. We would like
to provide support for C in userspace for the upcoming release of kernel
0.7.0, and we would like to use SDCC for this purpose. However, we have
some difficulty.

KnightOS relocates programs at runtime as they are executing, by means
of these macros:

	kcall(addr)		; RST 0x08 \ CALL addr
	kjp(addr)		; RST 0x08 \ JP addr
	kld(register, addr)	; RST 0x08 \ LD register, addr

The restart at 0x08 relocates these by modifying the code to read as such:

	NOP \ CALL absolute_address
	NOP \ JP absolute_address
	NOP \ LD register, absolute_address

Also supported is kjp(cc, addr) and kcall(cc, addr). Of course, this
only affects references that live inside the running executable.

The ideal solution to this problem would be for SDCC to be aware of this
paradigm and to directly emit compliant assembly. Since SDCC cannot
currently do that (or at least we don't think it can), we are
considering some alternative options. The one we currently have in mind
(Continue reading)

Joshua Lansford | 18 Jul 15:08 2014

uIP ported to PICDEM.net 2

Hey guys,
  I just got uIP .9 is working on MIcroChip's PICDEM.net 2 board being compiled by sdcc.  :-) The PICDEM.net 2 board uses the PIC18F9797J60 with an internal PHY.   Microchip's driver files are of course non-free but can be distributed as for a MicroChip uP or Ethernet controller.  No changes had to be made to uIP .9 code.
Hope this wasn't effort duplication... :-P
The uIP example program currently connected in is the one which responds with "ok" to any messages sent in on a TCP connection on port 1234.
~Joshua
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Ben Shi | 11 Jul 10:48 2014

Build SDCC on ARMv7

Hello,

I built SDCC (with only the STM8 port enabled) and did regression test on an ARMv7 machine, and the build procedure cost 40 minutes, the only stm8 regression test cost 3 hours.

Is there anybody has ever tried the same work, and how to improve the performance ? Or suggest a faster board to me.

My board is CubieBoard v2, http://cubieboard.com, with a Debian Wheezy installed.

1 GHz dual-core Cortex-a7
1 GB DDR3 RAM

Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14)

Ben
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Daniel Michalik | 10 Jul 11:24 2014
Picon

compiling 9043: right-hand operand of comma expression has no effect

Dear all,
I cannot compile the current version of sdcc. Problem seems identical to
what is described here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746906

| make
| [...]
| In file included from opncls.c:26:0:
| opncls.c: In function ‘bfd_fopen’:
| bfd.h:529:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
|  #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
|                                                                  ^
| opncls.c:261:5: note: in expansion of macro ‘bfd_set_cacheable’
|      bfd_set_cacheable (nbfd, TRUE);
|      ^
| cc1: all warnings being treated as errors

| $ gcc --version
| gcc (Debian 4.9.0-7) 4.9.0

I can of course disable the error on warnings, but maybe this should be fixed
in the repository? 

Kind regards,
Daniel

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Sdcc-user mailing list
Sdcc-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Joshua Lansford | 9 Jul 13:39 2014

Re: pic18

On Tue, Jul 8, 2014 at 4:03 PM, Unix Savvy Brian <bwitt <at> value.net> wrote:
Please provide some output with the error message you are getting.  You might want to add -v option to show the intermediate steps actually taken by the SDCC front-end.
 
that would be helpful.


Here is the command and the output of sdcc when compiling for the PIC.

====
user <at> enj:~/sdcc/proj/count$ ls
count.c
user <at> enj:~/sdcc/proj/count$ cat count.c
//#define __16f877
#include"pic16/pic18f97j60.h"

//word at 0x2007  __CONFIG = 0x3f72;

unsigned char count;

#pragma config XINST=OFF

void main(void) {

        TRISJ = 0;
        count = 0;
        while(1) {
                PORTJ = count;
                count ++;
        }

}
user <at> enj:~/sdcc/proj/count$ sdcc --std-c99 -mpic16 --use-non-free -p18f97j60 count.c
message: Using default linker script "/usr/local/share/gputils/lkr/18f97j60_g.lkr".
user <at> enj:~/sdcc/proj/count$ ls
count.asm  count.c  count.cod  count.hex  count.lst  count.o
user <at> enj:~/sdcc/proj/count$ sdcc --std-c99 -mpic16 --use-non-free -p18f97j60 count.c -v
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.4.1 #9036 (Jul  7 2014) (Linux)
published under GNU General Public License (GPL)
user <at> enj:~/sdcc/proj/count$ sdcc --std-c99 -mpic16 --use-non-free -p18f97j60 count.c --verbose
Processor: 18f97j60
sdcc: Calling preprocessor...
sdcc: Generating code...
sdcc: Calling assembler...
sdcc: Calling linker...
message: Using default linker script "/usr/local/share/gputils/lkr/18f97j60_g.lkr".
===
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Daniel Michalik | 9 Jul 12:42 2014
Picon

single precision - computing sidereal time

Dear all,
I'm trying to implement a conversion from solar (regular) time to
sidereal time for astronomical purposes on a PIC16F1938. As far as I
understand sdcc supports single precision only. I would like to ask for
advice how to proceed. For the calculations necessary for the time
conversion see http://aa.usno.navy.mil/faq/docs/GAST.php. 
I do not see how I could do this in single precision, but I'd love to
hear some advice of people more experienced with microprocessor
programming and sdcc. 

- Do I need to change to a different compiler than sdcc? 
- Can double precision floating point operations be emulated in a
  straight forward way within sdcc?
- Is there a way to reformulate the conversion to be correct with single
  precision calculations?

Kind regards,
Daniel

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Joshua Lansford | 8 Jul 21:40 2014

pic18

Hello folks.
  Are projects with multiple source files (section 3.2.3 p27) supported for the -mpic16 extension?
  When using the -mpic16 flag the compiler doesn't seem to produce rel files when -c is supplied.
~Joshua
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
JuanPi | 5 Jul 18:02 2014

Building a library

Hi all,

I managed to get the code compiled by sdcc now I ma trying to create a library.

I am using autotools and the problem I have is that when libtool calls
sddc I get

sdcc libio18f4550.lib libc18f.lib libsdcc.lib dwengoADC.lo  libdwengo.la
at 1: warning 119: don't know what to do with file 'dwengoADC.lo'.
file extension unsupported
at 1: warning 119: don't know what to do with file 'libdwengo.la'.
file extension unsupported

Any suggestion on how to build a library with sdcc? The manual uses
.lib files but I can't libtool to generate that extension

Any suggestion?

Thanks

--

-- 
Juan Pablo Carbajal
Engagement manager
www.dwengo.org

Follow us on:
Facebook: http://facebook.com/dwengo
Twitter:  <at> dwengo of http://twitter.com/dwengo
Youtube: http://www.youtube.com/user/Dwengovzw
Google RISE project: http://goo.gl/BD540
Chat: #dwengo in irc.freenode.net

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Kustaa Nyholm | 24 Jun 19:22 2014

Optimising a+=b;

Hi,

its me again ;)

Any idea how difficult it would be to add optimisation operators like
'+=' and company?

Here is a piece of compiled C from my project:

; .line 150; stepperirq.c MOTOR.nco += MOTOR.speed;
 MOVF (_g + 10), W, B
 ADDWF (_g + 4), W, B
 MOVWF r0x00
 MOVF (_g + 11), W, B
 ADDWFC (_g + 5), W, B
 MOVWF r0x01
 MOVF r0x00, W
 MOVWF (_g + 4), B
 MOVF r0x01, W
 MOVWF (_g + 5), B

This look rather long compared to this snipper I copied from the web:

movf    a,w
addwf   b,f
btfsc   STATUS,C
incf    b+1,f
movf    a+1,w
addwf   b+1,f

6 versus 10 instructions and a two one byte temp vars. I have a beef
with the temp vars especially as (unlike I thought before) these
get overlaid with temp vars (registers really for the compiler I guess)
which necessitates altogether four push/pull instructions in my
critical interrupt handler.

That [MOTOR.nco += MOTOR.speed] innocent looking C statement is responsible
for almost about 30% of my execution time!

Of course I could do this in in assembly but that would be more pain
as the compiler does a nice job of simplifying the MOTOR.xxxx variable
access which is a bit more complicated than it looks and if I go to
assembly then I'm on my own. OTH then I could take advantage of the
carry flag of this 16 bit add operation that would be useful for me
and further improve my execution speed.

Anyway would it be difficult to add this optimisation, in the peephole
optimiser or earlier in the pipeline?

Any other ideas how to optimise that piece of code?

br Kusti

This e-mail may contain confidential or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
We will not be liable for direct, indirect, special or consequential damages arising from alteration of
the contents of this message by a third party or as a result of any virus being passed on or as of transmission
of this e-mail in general.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Kustaa Nyholm | 24 Jun 10:59 2014

PIC reducing interrupt overhead

Hi

last night I was optimising my code and I noticed that SDCC
generated 'needless' code to save and restore some 'internal'
registers.

The interrupt servicer routine prologue contains

00002A C??? F???      00368         MOVFF   r0x00, POSTDEC1
00002E C??? F???      00369         MOVFF   r0x01, POSTDEC1

now as far as I understand r0x00,r0x01 just variables that
the compiler generated to hold temp values and as they are
not declared global in the assembler no one else can be
using them and thus there is no need to save/restore them?

How can I get rid of that?

How about taking advantage of the 'FAST REGISTER STACK' of
PIC16 architecture?

I guess I can declare the function naked and resort to
had crafter prologue/epilogue, but I'd rather have
the compiler take care of that of course, at least as
far as possible...

br Kusti

'

This e-mail may contain confidential or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
We will not be liable for direct, indirect, special or consequential damages arising from alteration of
the contents of this message by a third party or as a result of any virus being passed on or as of transmission
of this e-mail in general.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Kustaa Nyholm | 24 Jun 05:26 2014

Bug?

Good Morning,

I'm pruning some dead wood from my code and so I happened across this
this situation:

In the .h file I've got:

extern volatile stepperState __at( 0x0600 ) steppers[];

and in the  .c file:

volatile stepperState __at( 0x0600 ) steppers[NUM_OF_MOTORS];

the arrays/variable 'steppers' is no longer used anywhere
and that is when I get the following error from the
assembler:

../obj/stepperirq.asm:19:Error[113]   Symbol not previously defined
(_queues)

however if I touch the array like this, then everything compiles fine:

steppers[0].afield = 0;

I guess this is a bug?

br Kusti

This e-mail may contain confidential or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
We will not be liable for direct, indirect, special or consequential damages arising from alteration of
the contents of this message by a third party or as a result of any virus being passed on or as of transmission
of this e-mail in general.

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft

Gmane