Erik Petrich wrote:
On Sun, 22 May 2005, Héctor Biroli wrote:

Dear SDCC team:

Greetings from Argentina. My name is Héctor and I'm new in this world of 
so please excuse me if my questions are a bit silly (and for my bad 
Anyway, my problem is this: I wrote a C program, genhc.c, to use a 
Freescale 68HC908QY4
(128 bytes ram starting at 80h, 4k rom at EE00h) to generate a digitized 
sine wave or a ramp
with 32 steps, depending of the state of a port A pin.
When I compile it with sdcc, the code generated was nearly perfect, 
except two little 'fatal'
1) The code starts at 8000h. It should be EE00h
2) The two first executable instructions in the .asm file are:
    ldhx    #0x8000
Sets the stack pointer at 0FFFh, which in this case is an empty space. 
By default, HC08's
starts at 0FFh (ram's top) and in this case it's what I need, or change 
the 8000 by 0100h
and re-assemble and link, but I don't know how.
(By the way, it shouldn't be more useful if the #0x8000 were replaced 
for a variable, like
STACK_INIT or so?).  The data were assigned to 080h and it's correct.
I tried to use the --code-loc and --stack-loc options, but sdcc didn't 
recognized them.
Could you give me some help to get this fixed? I've attached all the 
files generated by the
compiler, assembler and linker.
I also want to tell you that your job is very good. Thanks for this 
wonderful compiler!!

This should work:

sdcc -mhc08 --code-loc 0xee00 --stack-loc 0xff genhc.c

What was the result when you tried --code-loc and --stack-loc before?


This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
Sdcc-user mailing list

And it surely works, I can assure you ;-).