Hello Taco, See the answers below.
> I've used the standard crt0.s as startup but when the call to GSINIT is made > the program doesn't work. All code should start from an embedded rom memory > located at 0x0000 to 0x2000 address space. And I make the file with > > $(PROGRAM).ihx : $(PROGRAM).c test_crt0.o > $(CC) --no-std-crt0 --codeseg 0x100 --code-loc 0x100 --data-loc 0x410 > $^ > ihex2rom.py $(PROGRAM).ihx testrom.v > > First question: What's the difference between the --codeseg and --code-loc > option? Name and number. With --codeseg you can give the code segment a different name. With --codeloc you can tell the linker to put the code at a different address. > Second question: If I set the code location to 0x100 I would presume that > code > really starts at 0x100, but my mapping file shows: > Hexadecimal > > Area Addr Size Decimal Bytes (Attributes) > -------------------------------- ---- ---- ------- ----- ------------ > _GSINIT 0410 0000 = 0. bytes (REL,CON) > > Value Global > -------- -------------------------------- > 0410 gsinit > > > Hexadecimal > > Area Addr Size Decimal Bytes (Attributes) > -------------------------------- ---- ---- ------- ----- ------------ > _0x100 0411 0008 = 8. bytes (REL,CON) > > Value Global > -------- -------------------------------- > 0411 _main > 0411 _main_start > 0419 _main_end > > > So the assembler listing of the ld a,#33 out(led_port),a of the c program is > located at 0x410 which is the data segment. Are there any examples or is > there some basic documentation where all this gsinit, gsfinal home, etc. is > explained? > taco walstra You should not put the data segment in your ROM. The cpu has a hard time changing things there. Nonetheless this looks like something is wrong. GSINIT should probably not have started at 0x410. I suggest you leave out the "--codeseg 0x100" and use "- -dataloc 0x2000" or whereever your RAM is. Maarten ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user