Give compiler exclusive use of IX
Give compiler exclusive use of IX
Please delete - sorry, thought about the problem a bit more!!
Re: Give compiler exclusive use of IX
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!
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!
Re: Give compiler exclusive use of IX
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.
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.