David Lucena schrieb:
> I am using SDCC to program a z80 machine. When I create this code:
> 
> unsigned char test = 0;
> 
> It is assembled as follows:
> 
>       ld      iy,#_test
>       ld      0(iy),#0x00
> 
> But I would like that it could be initialized as its done in assembler:
> 
> test:
> .db 0
> 
> Is there any way of forcing this behavior?

const unsigned char test = 0;

will do if test is a global variable. sdcc assumes that your program
resides in ROM, so it can use .db only for read-only stuff.

Philipp


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to