Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Asm externs in iwram   Message List  
Reply | Forward Message #9721 of 15019 |
Hi all,
I've been trying to compile GASS also, and found that all data that was
supposed to be loaded into IWRAM isn't. What's weirder is that the data isn't
even at the ROM load address.
A simple test has shown me that Jeff's lnkscrpt will load data into IWRAM
correctly if there are C constants being loaded also, but incorrectly if the
only external data is loaded through an asm file. Not a big deal I guess, but it
might be something to fix in the next revision... :)

Ben

here's the test:

asm.s:
.section .iwram
.global AsmExternInIWRAM
AsmExternInIWRAM:
.word 0xDEADC0DE

c.c:
// const unsigned int CInIWRAM __attribute__ ((section (".iwram")))=
0xDEADC0DE;
// when this is commented Mappy prints 0.
// Uncommented Mappy prints 0xDEADC0DE

test.c:

extern unsigned int AsmExternInIWRAM;
extern const unsigned int CInIWRAM;
extern int __printf(char *, ...);

int AgbMain()
{
__printf("%x", AsmExternInIWRAM);
while (1);
return 0;
}

debug.c:

void dprint(const char *sz)
{
asm volatile
(" \
mov r2, %0 \n\
mov r0, %1 \n\
mov r1, #0 \n\
and r0, r0, r0 \n\
"
: : "r" (sz), "r" (0xC0DED00D) : "r0", "r1", "r2"
);
}

int __printf(char *fmt, ...)
{
char s[256];
va_list marker;
va_start(marker, fmt);
int r = vsprintf(s, fmt, marker);
va_end(marker);
dprint(s);
return r;
}




[Non-text portions of this message have been removed]





Fri Feb 1, 2002 5:00 am

bsmith2@...
Send Email Send Email

Forward
Message #9721 of 15019 |
Expand Messages Author Sort by Date

Hi all, I've been trying to compile GASS also, and found that all data that was supposed to be loaded into IWRAM isn't. What's weirder is that the data isn't...
Ben Smith
bsmith2@...
Send Email
Feb 1, 2002
8:44 am

... This is due to the way GAS works it appears. I just added this to the GBA Dev FAQs: http://www.devrs.com/gba/files/gbadevfaqs.php#EmptyBits GAS Assembly...
Jeff Frohwein
jfrohwei
Offline Send Email
Feb 1, 2002
2:18 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help