I think you need to start you code at some low address C:0x0000H maybe(!?)..... Some compiler may start your code at very high address... That is the reason to waste the whole memory..... Check the hex file using notepad...you will see you code is not that big
Sincerely,
HaiB
HVB