yes there is a problem with yahoo groups..
#include <stdlib.h>
/* Mapped to Read-Only Data Section (.rodata) */
const char Text[] =
"This is a dummy text which will be loaded into the
.rodata section.";
const unsigned short TableS[16] = {
0x0123, 0x4567, 0x89ab, 0xcdef, 0xfedc, 0xba98,
0x7654, 0x3210,
0x0011, 0x2233, 0x4455, 0x6677, 0x8899, 0xaabb,
0xccdd, 0xeeff
};
const unsigned long TableL[8] = {
0x01234567, 0x89abcdef, 0xfedcba98, 0x76543210,
0x00112233, 0x44556677, 0x8899aabb, 0xccddeeff
};
/* Mapped to Intialized Data Section (.data) in
Internal RAM */
unsigned char FillVal = 0x00;
/* Mapped to Uninitialized Data Section (.bss) in
External RAM */
unsigned char Buffer[32768];
struct {
unsigned short us[16];
unsigned long ul[8];
} Table;
/* Mapped to Read-Only Code Section (.text) */
int main (void) {
char *m, *p, *t;
int i;
for (i = 0; i < 16; i++) {
Table.us[i] = TableS[i]; /* Load TableS */
}
for (i = 0; i < 8; i++) {
Table.ul[i] = TableL[i]; /* Load TableL */
}
for (i = 0; i < sizeof(Buffer); i++) {
Buffer[i] = FillVal; /* Fill Buffer */
}
m = malloc(1024); /* Allocate Memory on Heap */
if (m == NULL) return (1);
p = m;
t = (char *)&Text[0];
while (*t) {
*p++ = *t++; /* Copy Text to Heap
*/
}
*p = 0; /* Terminate String */
free(m); /* Free Allocated Memory */
return (0);
}
=====
Taner Mutlu
Elektronik M\ufffdh.
GLOBAL Bilgisayar ve Kontrol Sistemleri
taner@...
www.tanermutlu.5u.com
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mailMessage
Re: [lpc2000] memory allocation..
2004-07-13 by Taner Mutlu
Attachments
- No local attachments were found for this message.