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
GASS Help?   Message List  
Reply | Forward Message #9734 of 15019 |
Re: [gbadev] Re: GASS Help?


Jason,
The problem is that the use of the link register and pc have been
extended to determine what mode the processor should be in. By mode,
I mean THUMB or ARM (rather than supervisor etc).

So if your return address is in the middle of some thumb code and
your procedure is in ARM, then the processor state must be swapped to
thumb when you return. As far as I can work out without the docs, the
command bx changes the processor state depending on the flags in the
lr. The mov command does not. So basically you need to use bx if
you're jumping back into some code which you don't know whether it's
in thumb or arm, or if you KNOW that it's in tumb or arm and your
procedure is in arm or thumb!

This means that to do an LDMFD sp!,{r0-r12,pc} or whatever your more
complicated code is, then you need to do:

LDMFD sp!,{r0-r12,lr}
bl lr

Yes it's silly, but there you go. Hope that helps.
>>

Doh, you're right! I should have realized that it was switching back and forth,
but I didn't realize the branch instructions altered the CPU state as well.
Thought that required an explicit command, but then when I think about it
there's really no good alternative to having the state set 'automatically'.

Changing all the "mov pc,lr" instructions helps. In fact, aside from there not
being any way to test it just yet, most of the code appears to work then. I
know someone else suggested converting entirely to ARM, but I'd like to avoid
that in case of future problems, though it's an option.

Currently most things appear to work, though I'm wrangling with the main
interrupt which is giving out bad IO instructions. I wish the code was
documented. :)

If I -do- manage to get it working in -mthumb-interlink mode I should probably
send a version back to the GASS author. I've tested many of the demos and it
sounds quite nice compared to most of them.

Jason Emery
World Tree Games


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





Sat Feb 2, 2002 2:26 am

felix_draconis
Offline Offline
Send Email Send Email

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

Has anyone managed to get GASS compiling and running and would have the time to provide a few answers to questions? I think I'm pretty close, as everything now...
felix_draconis
Offline Send Email
Jan 31, 2002
5:38 pm

Hey, I just got GASS to compile. Seems as though the GASS example (and SoundEngine... files) expect the entire file to be running as arm. When I compiled...
Ben Smith
bsmith2@...
Send Email
Feb 1, 2002
8:44 am

Jason, The problem is that the use of the link register and pc have been extended to determine what mode the processor should be in. By mode, I mean THUMB or...
owaincole
Offline Send Email
Feb 1, 2002
12:46 pm

... you mean "BX LR" right?:)...
Wim Yedema
tharsis_bliss
Offline Send Email
Feb 1, 2002
1:03 pm

Jason, The problem is that the use of the link register and pc have been extended to determine what mode the processor should be in. By mode, I mean THUMB or...
Jason Emery
felix_draconis
Offline Send Email
Feb 2, 2002
2:32 am
Advanced

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