06-12-2016, 09:34 PM
boriel Wrote:You have to save both the SP (stack) and the IX register. FASTCALL is faster and does nothing of this, it's just a pure ASM code (the ubyte parameter is passed in the A register).I think you maybe right with this. I have to try a little further.
I haven't examined what TR-DOS do. Also, ZX BASIC uses the classic 48k ROM variables (i.e.236XX addresses). It might also be that.
OK. As I´m not very experimented with ASM, can you please show me the way ? Do you think this should be enough (=save IX and SP):
On <!-- m --><a class="postlink" href="http://jgmalcolm.com/z80/intermediate/pcsp.htm#gsc.tab=0">http://jgmalcolm.com/z80/intermediate/p ... #gsc.tab=0</a><!-- m -->
I found this one:
;SafeExit:
ld sp,(SavedSP) ;get back saved sp
ret ;exit
;SaveSP:
ld (SavedSP),sp ;save sp
ret ;go back
;SavedSP: .dw 0 ;memory to save sp
I tried this with:
Code:
LD (SavedSP),SP
PUSH IX
...
CALL 15357 ;TR-DOS v4 #3BFD = 15357 dez
POP IX
LD SP,(SavedSP)
RET
SavedSP:
DEFB 0,0
boriel Wrote:Where can I find the TR-DOS asm listings? maybe I can have a look.You mean TR-DOS ROM-Listing ? I have one commented in portoguese for TR-DOS v4 compatible CBI-DOS v2.4
but I think it´s not yet worth to do time-consuming debugging on it.