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

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? 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 #9724 of 15019 |
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).

If your processor is in the wrong state and it tries to execute a
command from the wrong instruciton set, then you get all sorts of
problems, Basically it tends to keep on going executing random
instructions since it is doubtfull that you'll have coded a branch by
accident!! - Or until it gets to some code which is in the correct
state... but then that wont help much either!

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.
Owain


--- In gbadev@y..., "felix_draconis" <felixd@f...> wrote:
>
> 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 links in and compiles
> properly, but it promptly crashes at the instruction:
>
> mov pc,lr
>
> (which I presume is trying to copy the return address for the
> function call to assembly into PC)
>
> (and yes, I can 'fix' it with bx lr, but there are more complex
uses
> of pc later on that I can't seem to correct)
>
> I know there'll likely be other problems, hence why I'm reluctant
to
> ask too many questions of the list. Searching elsewhere doesn't
seem
> to reveal any tutorials on this, or even what compiler was being
used
> at the time. I can only imagine what settings
>
> But at the same time, days of constant effort are starting to be
> tiring. ^.^
>
> Jason Emery
> World Tree Games





Fri Feb 1, 2002 11:08 am

owaincole
Offline Offline
Send Email Send Email

Forward
Message #9724 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