Give compiler exclusive use of IX

Other misc things
Post Reply
gazsp
Member
Posts: 13
Joined: Sat Jun 19, 2010 5:07 pm

Give compiler exclusive use of IX

Post by gazsp »

Please delete - sorry, thought about the problem a bit more!!
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Give compiler exclusive use of IX

Post by dom »

If you're seeing that then it sounds like you're probably using sdcc.

sdcc uses ix as a framepointer, so it is saving it at the entry of every function so that when the function returns the framepointer of the caller is restored. There's the option --fomit-frame-pointer to disable it, thought historically that gets less testing so may be buggy.

I say "probably using sdcc" because sccz80 will do it the same if you add -debug as an option - I'm starting to add source level debugging and having a framepointer really makes locating variables much easier!
gazsp
Member
Posts: 13
Joined: Sat Jun 19, 2010 5:07 pm

Re: Give compiler exclusive use of IX

Post by gazsp »

Correct - I am :-)

Also, I realised that if it didn't push / pop ix when calling nested functions, the frame pointer would be wrong coming back from the second function.

Again, this can be deleted - I obviously need more coffee!

Cheers,
Gaz.
Post Reply