powerpc assembly programming

raw_knee

Registered
hi everyone,

i'm just a newbie with regards to programming for the powerpc-mac os x platform.

i have a c program that calls a function that i have written in assembly. compiling the codes went without a hitch, however, i encountered a bus error when i ran the program. checking out the codes, i found out that the problem was within the assembly function i made. i have an instruction that accesses r15 that caused the bus error:

stfd f3,0(r15)

data from f3 comes from one of the assembly function's parameters.

when i changed it to r12, the bus error did not occur. i found out that other registers were also not accessible.

pardon me if i'm committing a very simple error, but what gives?

(by the way, i'm using an emac running mac os x 10.2)
 
OS X uses certain registers for it's own purposes, so you need to preserve them. You can use them, but you have to return them to their original state when they entered the subroutine. Here's a web page:

http://math-atlas.sourceforge.ne<t/devel/atlas_contrib/node90.html>
 
Back
Top