03-02-2016, 10:40 PM
Luzie Wrote:OK.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´ll paste the called FASTCALL down under.
I´ve tried to save IX register by a PUSH IX and restore it with POP IX, but this changed nothing,
The problem seems to me the TR-DOS-ROM (=Spectrum Betadisk-System) Routine
which is called with the FASTCALL.
But I cannot imagine yet, why this can bring your ZX Basic "out of running correct".
Here´s my used FASTCALL:
Code:FUNCTION FASTCALL MCodeDIRDOSv4 (number as uByte) as uInteger
ASM
;BDUC-Newsletter No.5 Page 5 Brothaers TR-DOS v4.XX Example for CAT to SCREEN
CALL 15366 ;TR-DOS v4 #3C06 = 15366 dez = DOS ON
PUSH HL ;Put the DOS OFF return adress on the stack - Needed by TR-DOS v4
LD A,2 ;Select Stream 2 (screen)
LD C,7 ;Set DOS Routine 7 (catalogue)
CALL 15357 ;Call TR-DOS v4 Central Functions adress #3BFD = 15357 dez
RET ;This one jumps to the adress PUSHed with PUSH HL, put DOS Off and returns
END ASM
END FUNCTION
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.
Where can I find the TR-DOS asm listings? maybe I can have a look.