;
;
; TODO
- ; - Recheck all syscall translations
; - Fix up directory mapping a bit more
- ; - Save the syscall vector on entry and go via the saved copy as the
- ; RST could be re-used by CP/M programs
; - Make the code use indirect pointers to the directory buffer etc
; from the scratch space so that we can eventually make it
; multi-threaded for boxes with a large fixed common where we want to
LD HL,#0
LD (0x0003),HL ; Clear IOBYTE and Default Drive/User
+ LD HL, (0x31) ; JP xxxx is what FUZIX leaves at 0x30
+ LD (syscall+1), HL
+ LD A, #0xC3 ; JP
+ LD (syscall), A
+
JP __bios ; Go to Cold Start setup
;==========================================================
PUSH HL ; Path
LD HL,#1 ; Fuzix Open Fcn #
PUSH HL
- RST 0x30 ; _open (Path, Mode);
+ CALL syscall ; _open (Path, Mode);
POP BC ; Clean Stack
POP BC
POP BC
LD HL,#11 ; Fuzix sync function #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
JP Exit0 ; Return OK
CloseV: PUSH DE
LD HL,#2 ; Fuzix Close Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
RET
PUSH HL ; String
LD HL,#6 ; UZI Unlink Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
; desc = creat (getname (blk), 0666);
Fcn22: CALL CkSrch ; Ensure Search file closed
- LD HL,#0q0666 ; Own/Grp/Oth are Read/Execute
+ LD HL,#0x1B6 ; Own/Grp/Oth are Read/Execute
PUSH HL ; DE -> arg
LD HL,#0x502 ; O_CREAT|O_RDWR|O_TRUNC
CALL GetNam ; This name string
PUSH HL
LD HL,#1 ; Fuzix open Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
POP BC
PUSH HL
LD HL,#5 ; UZI link Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
POP BC
PUSH HL
LD HL,#6 ; UZI unlink Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
JP NC,Exit0 ; exit w/0 if Ok
PUSH HL
LD HL,#6 ; UZI unlink Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
PUSH HL ; dname
LD HL,#15 ; UZI stat Fcn #
PUSH HL
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stk
POP BC
POP BC
PUSH HL
LD HL,#9 ; _lseek()
PUSH HL
- RST 0x30 ; Syscall
+ CALL syscall ; Syscall
POP BC ; Recover stack
POP BC
POP BC
LD HL,#0 ; Exit Good Status
PUSH HL
PUSH HL ; UZI Fcn 0 (_exit)
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
Spin: JR Spin ; Can't happen!
;.....
PUSH HL
LD L,#7 ; UZI Read Fcn
ChrV0: PUSH HL
- RST 0x30 ; Execute
+ CALL syscall ; Execute
POP BC
POP BC
POP BC
PUSH HL
LD E,A ; Position R/W Fcn #
PUSH DE
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clear Stack
POP BC
POP BC
PUSH DE
LD E,#29 ; Fuzix ioctl Fcn #
PUSH DE
- RST 0x30 ; Execute!
+ CALL syscall ; Execute!
POP BC ; Clean Stack
POP BC
POP BC
;----------------------- Data -----------------------
+syscall:
+ .ds 3
ttTermios:
.ds 20 ; Working TTY Port Settings
ttTermios0: