I think DiskROM initialization failed, but I'm not sure how to interpret the result :
; Check if disk found ld a, (HPHYD) ;// a=F7 cp #0xC9 jr z, return ; comprueba version de DOS y guarda ld c, DOSVER ;// c=6F call BDOS ld a, b ;// a=0, b=0 inc a ;// a=1
F7 = rst $30
so there is something hooked.... done!
I successfully opened a file using DOS function 44h (Create file handle).
I got Error=0, Handle=0.
But when I try read the file (DOS function 48h) I got the following result:
Input:
C = 48H (_READ)
B = 0 (File handle)
DE = C0BEh (Buffer address)
HL = 100h (Number of bytes to read )
Output:
A = 0 (Error)
HL = 100h (Number of bytes actually read)
According to returned values, all is right but the problem is nothing is copied at the C0BEh address.
Any idea?
The MSX Technical handbook - Part III say:
System calls can also be used from DISK-BASIC by using
the entry address of F37DH. For this case, store the machine codes in the
area allocated by the CLEAR statement and call its start address using the
USR function.
Someone can explain this section?
What are the CLEAR statement and the USR function?
the CLEAR statement in the BASIC, define not only the space reserved in bytes for BASIC variables
also has a second parameter, that defines the higher address that the BASIC interpreter can use.
so, if you define
clear 200, &HBFFF
basic interpreter can to use from &H8000 up to &HBFFF
that way it frees for other purposes the addresses &HC000 and UP!. Purposes like, you placing your assempler code.
so that phrase, is saying, if you want to call that function, you must place some assembler code where the CLEAR sentences allows it, and then to call it.
