Re: [Sdcc-user] Adresses wider than 16 bits in the z80 port and related?

2025-08-18 Thread Bodo Wenzel via Sdcc-user
Well, I hope that the result of #(_symbolname >> 16) is always the upper byte of a 24-bit address, independent of endianness. Anything else I'd call a bug. Bodo Am 11.08.25 um 15:29 schrieb Philipp Klaus Krause: While on stm8, I can get the upper byte of a 24-bit address via #(_symbolname >>

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

2021-11-11 Thread Bodo Wenzel
Pragmatically, if there is something to check endianness, make a working chance for all targets, or at least non-breaking for little-endian systems. I see not much value in finding by whom or why this little-endian-only solution was written, because for me it is a clear error. The implementation-

Re: [Sdcc-user] finding conflicting address space usage

2015-09-24 Thread Bodo Wenzel
Hi Rich, Maarten already said it in some way and I just like to add my thoughts to this issue: The linker usually doesn't know anything about data types and memory modifiers and such. Having said this, it is the object file (*.o or *.rel) that misses this information. Actually, most linkers and C

Re: [Sdcc-user] Dropping support for omitting integer promotion on arguments of vararg functions

2015-01-19 Thread Bodo Wenzel
Even though we're using the Keil C51 for most projects we have at least one project with SDCC. It needs to be compiled with different compilers for security reasons. Therefore I consider myself as a professional user of MCS51 compilers with an interest in SDCC. I'd prefer if char arguments use onl

Re: [Sdcc-user] error sdcc 2.9

2014-10-14 Thread Bodo Wenzel
Hi Ricardo, If you multiply 25586 by 4, you would get 102344... if your calculation is done with "long". But you're using "int", so the intermediate result is cut to 16 bits width, giving 102344 % (1 << 16) = 36808. This results after the division by 5 to 7361. HTH, Bodo

Re: [Sdcc-user] PIC programmer support

2014-06-08 Thread Bodo Wenzel
> I used the supplied software on > Windows, which drove the programmer via an RS232C port. Did you try to run the Windows software with WINE? The capabilities of WINE are quite amazing, though I never tried to use the RS232 port this way. Good luck! Bodo ---

Re: [Sdcc-user] Simple program to work on pic 16f872

2014-01-22 Thread Bodo Wenzel
Hi Ael, Assuming that you are trying to gain some experience, I'd recommend to look into the assembler listings of both programs. If there is no listing you have to disassemble. Armed with the datasheet you will be able to investigate the problem. Good luck! Bodo ---

Re: [Sdcc-user] How to Convert Intel Hex to Binary

2013-12-29 Thread Bodo Wenzel
Well, this is not a direct answer to the OP's question, but I found a surprisingly featured tool. Its name is misleading, many formats are supported. Just my €0.02... Bodo -- Rapidly tr

Re: [Sdcc-user] Makefile multiple targets with define variable

2011-10-23 Thread Bodo Wenzel
Hi Gerard, Right, something like this (I left out packihx): libs = file1 file2 file3 all: target1.hex target2.hex target3.hex $(libs:%=%_target1.rel) : %_target1.rel : %.c $(CC) $(CFLAGS) -c -DTARGET1 $< -o $@ $(libs:%=%_target2.rel) : %_target2.rel : %.c $(CC) $(CFLAGS) -c -D

Re: [Sdcc-user] Makefile multiple targets with define variable

2011-10-22 Thread Bodo Wenzel
Hi Gerard, > But actually I want that the define is also passed at compile time to > the lib files (file1,file2 and file3). Because of obvious reasons. ;-) > Can anyone point me to an example of a Makefile for SDCC with such a > construction or a hint on how this can be solved? In my Makefiles I

Re: [Sdcc-user] Accessing sfr with pointer

2011-08-10 Thread Bodo Wenzel
Hi Mike, > I am trying to access a sfr with a pointer (mcs51 P2, P2MDOUT, ...) It's not a question of the compiler. It is not possible because of the opcodes of the MCS51. There is no machine instruction to access SFR through a pointer. The only solution I once found was to write a function that

Re: [Sdcc-user] PIC: joining asm and sdcc

2011-05-26 Thread Bodo Wenzel
> disp_digits="0123"; IIRC, this works if disp_digits is a pointer to char. And "0123" as an expression is a pointer to five chars. You could only use it with an initialized array as such: char disp_digits[] = "0123"; Cheers, Bodo --

Re: [Sdcc-user] official SDCC forum

2011-05-14 Thread Bodo Wenzel
As one just reading this list and not contributing anything, presumably I'm one of the targeted audience. And as such: > SDCC already has a forum on sourceforge. I see no reason to have > another one at a location that has nothing to do with the project. Me too. Bodo -

Re: [Sdcc-user] pointer problem

2010-10-08 Thread Bodo Wenzel
Hi Jan, > data.h > extern __code unsigned char *config_desc; Just my 0.02€. This is a pointer to code memory but it resides in data memory. You might like to try extern __code unsigned char config_desc[]; which declares an array in code memory as you intended. Anyway, the type of config_desc i

Re: [Sdcc-user] debug in C

2010-07-16 Thread Bodo Wenzel
I once used Hades to develop a PIC application; though Hades doesn't know anything about C or symbol tables, it just runs the machine code for a 16F84... But you can model the environment. Bodo

Re: [Sdcc-user] makebin generating gb binary format

2010-02-21 Thread Bodo Wenzel
Sure, I would do that, too. You can even use objcopy from any port or cross-binutils! But many developers working on Windows don't have any objcopy at hand... :-( So if SDCC provides makebin, why not use it? Bodo -- D

Re: [Sdcc-user] makebin generating gb binary format

2010-02-21 Thread Bodo Wenzel
Hi Borut, > in the first place those using sdcc for GameBoy target (is there anybody > using it at all?): Well, not currently, but I used it few years ago. I see no reasons against your idea. Any non-dummy developer should use make or at least a batch to generate her application, so the little p

Re: [Sdcc-user] Value of symbol differs on second pass -error

2010-02-20 Thread Bodo Wenzel
Sorry, on the first part I can't help you. > static data unsigned char at 0x100 *out_ptr; Without any try I think the "at" should be placed between the type and the symbol: static data unsigned char * at 0x100 out_ptr; HTH, Bodo

Re: [Sdcc-user] 8052 pointer seems to quit.

2010-01-04 Thread Bodo Wenzel
Putu, > so, *abs_ptr++ is equal to *(abs_ptr++) not (*abs_ptr)++. Hit, and sunk! You are so right, and I'm the idiot! :-} Bodo -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Veriz

Re: [Sdcc-user] 8052 pointer seems to quit.

2010-01-03 Thread Bodo Wenzel
> if( a = a + 1024 ) // strangely this makes the > pointer work for 21 bytes Well, this is a bad code; do you really mean: if( ( a = a + 1024 ) != 0) The other proposal "(a == a + 1024)" will never be true. ;-) > *abs_ptr++ ; // Mak

Re: [Sdcc-user] pointer reference stays empty

2009-07-04 Thread Bodo Wenzel
Hi Bart, Your analysis is well done, and I appreciate your assembler knowledge. However, I'm not sure that I do understand what you mean by "Gives nothing on the output port P2." For the moment I assume that each line of P2 doesn't change its level, i.e. it stays at "1" which is the default aft

Re: [Sdcc-user] pointer reference stays empty

2009-07-02 Thread Bodo Wenzel
> if(stream == NULL) > return NULL; Are you sure that malloc() returned a valid pointer? For debugging I would change this code into: if (stream == NULL) { P2 = 0xAA; return NULL; } Or, as I know assembler, I would look into the machine code to check it does The Right Thing(TM). HTH,

Re: [Sdcc-user] PIC not executing using any power supply other than the computer USB port

2007-09-30 Thread Bodo Wenzel
> Sorry for the additional spam, but I have a few more questions about the > Makefile as I am on the way of switching away from using piklab ide and > more towards using the Makefile. > [...] Please do a simple Google search with "make tutorial", and read at least two or three of them. It might he

Re: [Sdcc-user] Error

2007-06-06 Thread Bodo Wenzel
/* Just a suggestion: compile this little source and use it instead of SDCC. You'll see what your IDE gives the compiler, and I'm sure the error will be apparent in the file written. */ #include int main(int argc, char *argv[]) { FILE *dump; dump = fopen("ide2sdcc.log", "w"); if (dump !

Re: [Sdcc-user] How to pass address of SFR register as parameter to a function

2007-03-17 Thread Bodo Wenzel
> I want to know how address of SFR register can be passed as parameter to > a function. Assuming that you target an 8051 system: you can't address SFR registers via "pointer". The processor distinguishes SFR from IDATA by the access type inherent in the opcode. SFR can only be accessed directly,

Re: [Sdcc-user] binary representation of integer?

2007-02-17 Thread Bodo Wenzel
> That's not what I asked. In Microchip asm, I can type an integer > constant in binary as b''. I was wondering if SDCC supports > something similar. Oh, sorry, you're prefectly right. Anyway, there is no prefix or suffix for binary constants in C, either. ;-) It's on my wish list, too.

Re: [Sdcc-user] binary representation of integer?

2007-02-17 Thread Bodo Wenzel
There is no printf format specifier for binary in C... You have to write such a function yourself. Bodo - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to

Re: [Sdcc-user] Executing code from a specific address

2007-02-04 Thread Bodo Wenzel
Try "( ( void (*)(void) ) 0x1F00 ) ()" to call with pure C. Explanation: "void (*)(void)" is a type definition for a pointer to a function with no parameter and no return value. For clarification you might like to hide it in a 'typedef'. This definition is used to cast the value 0x1F00. And (

Re: [Sdcc-user] Error

2006-11-13 Thread Bodo Wenzel
> In fact, this must be quoted: > -Wl,"-s /usr/share/gputils/lkr/18f442.lkr" > or replaced with > -Wl,-s -Wl,/usr/share/gputils/lkr/18f442.lkr > as both -s and the path need to become arguments to the linker. Or separated by commas: -Wl,-s,/usr/share/gputils/lkr/18f442.lkr -