mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 14:08:05 +11:00
pgm: have its own file handle
This commit is contained in:
parent
a48a91c8da
commit
bed7032ee5
@ -8,8 +8,15 @@
|
|||||||
; non-zero means error. Programs should avoid having error code overlaps with
|
; non-zero means error. Programs should avoid having error code overlaps with
|
||||||
; the shell so that we know where the error comes from.
|
; the shell so that we know where the error comes from.
|
||||||
;
|
;
|
||||||
|
; *** Requirements ***
|
||||||
|
; fs
|
||||||
|
;
|
||||||
; *** Defines ***
|
; *** Defines ***
|
||||||
; PGM_CODEADDR: Memory address where to place the code we load.
|
; PGM_CODEADDR: Memory address where to place the code we load.
|
||||||
|
;
|
||||||
|
; *** Variables ***
|
||||||
|
.equ PGM_HANDLE PGM_RAMSTART
|
||||||
|
.equ PGM_RAMEND PGM_HANDLE+FS_HANDLE_SIZE
|
||||||
|
|
||||||
; Routine suitable to plug into SHELL_CMDHOOK. HL points to the full cmdline.
|
; Routine suitable to plug into SHELL_CMDHOOK. HL points to the full cmdline.
|
||||||
; We can mutate it because the shell doesn't do anything with it afterwards.
|
; We can mutate it because the shell doesn't do anything with it afterwards.
|
||||||
@ -48,7 +55,7 @@ pgmRun:
|
|||||||
call fsIsValid
|
call fsIsValid
|
||||||
jr nz, .ioError
|
jr nz, .ioError
|
||||||
push hl ; unparsed args
|
push hl ; unparsed args
|
||||||
ld ix, FS_HANDLES
|
ld ix, PGM_HANDLE
|
||||||
call fsOpen
|
call fsOpen
|
||||||
ld hl, PGM_CODEADDR
|
ld hl, PGM_CODEADDR
|
||||||
.loop:
|
.loop:
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
.dw blkBselCmd, blkSeekCmd, blkLoadCmd, blkSaveCmd
|
.dw blkBselCmd, blkSeekCmd, blkLoadCmd, blkSaveCmd
|
||||||
.dw fsOnCmd, flsCmd, fnewCmd, fdelCmd, fopnCmd
|
.dw fsOnCmd, flsCmd, fnewCmd, fdelCmd, fopnCmd
|
||||||
|
|
||||||
|
.equ PGM_RAMSTART SHELL_RAMEND
|
||||||
.equ PGM_CODEADDR USERCODE
|
.equ PGM_CODEADDR USERCODE
|
||||||
#include "pgm.asm"
|
#include "pgm.asm"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user