User Activity

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Is there a description for the numbers of cyclomatic? I got this numbers for example: main.c:183: info 121: function 'main', # edges 181 , # nodes 129 , cyclomatic complexity 54 main.c:740: info 121: function 'timer_isr', # edges 1 , # nodes 2 , cyclomatic complexity 1 main.c:754: info 121: function 'rom_off', # edges 1 , # nodes 2 , cyclomatic complexity 1 main.c:761: info 121: function 'rom_on', # edges 1 , # nodes 2 , cyclomatic complexity 1

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Just test it (I added a volatile): void main(void) { volatile int a = 116; a = a / 16; // This should equal "a >> 4" volatile int b = 73; b = b % 64; // This should equal "b & 63" } Compile for Z80: sdcc -mz80 -Wall -S test.c -o test.asm Check assembler result for a: ;test.c:7: volatile int a = 116; ld hl, #0x0074 ex (sp), hl ;test.c:8: a = a / 16; // This should equal "a >> 4" pop de push de bit 7, d jr Z, 00103$ ld hl, #0x000f add hl, de ex de, hl 00103$: inc sp inc sp push de ld iy, #0 add iy,...

  • Modified a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Hi folks! I wish to access global symbols from my main: void main( void) { extern uint16_t l__GSINIT; printf( "gsinit: %04X\n", l__GSINIT); } But at linker stage I got an error: sdldz80 -n -mwx -m1 -u -b _CODE=0x200 -l stuff.lib -l printf.lib -i build/stuff.ihx build/crt0.rel build/stuff.rel ?ASlink-Warning-Undefined Global '_l__GSINIT' referenced by module 'main' The compiler(?) will add an underscore, because in the map file I can find the symbol: ASxxxx Linker V03.00/V05.40 + sdld, page 1. Hexadecimal...

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Ok, thanks Benedikt. This will do: uint16_t val; // need to be global (or use static and find the internal name) void main( void) { __asm ld hl, #(l__GSINIT) ld (_val), hl __endasm; printf( "l_gsinit: %04X\n", val); } regards, Bert

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Hi folks! I wish to access global symbols from my main: void main( void) { extern uint16_t l__GSINIT; printf( "gsinit: %04X\n", l__GSINIT); } But at linker stage I got an error: sdldz80 -n -mwx -m1 -u -b _CODE=0x200 -l stuff.lib -l printf.lib -i build/stuff.ihx build/crt0.rel build/stuff.rel ?ASlink-Warning-Undefined Global '_l__GSINIT' referenced by module 'main' The compiler(?) will add an underscore, because in the map file I can find the symbol: ASxxxx Linker V03.00/V05.40 + sdld, page 1. Hexadecimal...

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Hi folks! I need to rewrite my Z80 library to the new calling convention. In the following function the simple 'ret' doesnt work anymore: extern void colorup( unsigned char argn, unsigned char foreground, unsigned char background); .globl _colorup _colorup:: ; bring parameters to correct mem/registers ld (#ARGN), a push hl ; save L ld hl, #6 add hl, sp ld e, (hl) pop hl ; retore L call PV1 ; system call .db FNCOLORUP ret Now it is necessary to change the 'ret' to this code pop hl inc sp jp (hl) to...

  • Posted a comment on ticket #3730 on Small Device C Compiler (SDCC)

    Great, it works! Thank you!

  • Posted a comment on ticket #3730 on Small Device C Compiler (SDCC)

    Ok, with myprintf( "%x %x %x", (char)a, (char)b, (char)c); variant 1 works. And also the workaround with c = va_arg( arg, unsigned); does help. But my second compile with the compile option '--fomit-frame-pointer' is still completly garbled up. Can anyone give a hint in which sdcc source files a can search for the problem? thanks & regards, Bert

View All

Personal Data

Username:
bartfax
Joined:
2001-10-17 20:04:37

Projects

  • No projects to display.

Personal Tools

MongoDB Logo MongoDB