OK, I've (hopefully) fixed it!
Unfortunately, I'm *really* busy atm, so I didn't have time to test.
From what you've said above, I've followed this logic:
; Save hl!
; Now find the length of the string arg!
The argument is saved, and we call sub_Length to figure out the length of that string argument.
It gets pushed back to HL, so I pushed HL to a stack to save the argument.
; Copy it to the correct place...
I exchanged the new HL with DE, where it's supposed to go. Now the length is saved!
Since we don't need HL anymore, we're can call it and let it destroy things!
; ...and bring back the string arg!
And of course, HL is save and sound.... right?
Hopefully that logic will work!
I've attached the compiled 8Xp - simply add #Axiom(DCSAXIOM) to your code, and then
use DrawL("hello world!") to test!
Beware that this may crash your calc, so please, please, PLEASE back up your stuff before proceeding.
Thanks to KermMartian for the tip! EDIT:
Silly me, forgot to actually attach something!
Also, you can view the entire code here:http://code.google.com/p/axe-gui-libraries/source/browse/src/dcs7axiom/DCSAxiom.z80EDIT 2:
Apparently DE is also destroyed too (according to http://dcs.cemetech.net/index.php?title=OpenGUIStack
), so I've added a push/pop de into the code and recompiled - hopefully this is the panacea to the crash? (Reattached program with changes)