From 0149d375a3c39b6370d066a824f4b50847bde843 Mon Sep 17 00:00:00 2001 From: dimitrit Date: Tue, 15 Dec 2020 21:54:00 +0000 Subject: [PATCH] add FTYPE word --- discio.asm | 16 +++++++++++----- figforth.asm | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/discio.asm b/discio.asm index 879ca18..dd41bc4 100644 --- a/discio.asm +++ b/discio.asm @@ -286,12 +286,19 @@ EXTND2: .WORD BDOS ; & re-open .WORD DROP ; discard return code .WORD SEMIS +; + .BYTE 85H + .TEXT "FTYP" ; FTYPE ( -- addr ) + .BYTE 'E'+$80 ; Returns address of file type used + .WORD EXTEND-09H ; with FILE. +FTYPE .WORD DOCON,DEFFT +DEFFT .TEXT "FTH" ; default file type ; .BYTE 84H ; FILE used in the form .TEXT "FIL" ; FILE cccc - .BYTE 'E'+$80 ; closes the current file and attempts - .WORD EXTEND-09H ; to open the file with the given name. -FILE: .WORD DOCOL + .BYTE 'E'+$80 ; Closes the current file and attempts + .WORD FTYPE-08H ; to open the file with the given name. +FILE: .WORD DOCOL ; The file type is determined by FTYPE. .WORD FCB .WORD LIT,CLSFIL ; close existing file .WORD BDOS @@ -307,7 +314,7 @@ FILE: .WORD DOCOL .WORD DUP .WORD LIT,MAXLEN .WORD BLANK ; clear previous name from fcb - .WORD LIT,FTYPE + .WORD FTYPE .WORD OVER .WORD LIT,MAXLEN .WORD PLUS @@ -323,7 +330,6 @@ FILE: .WORD DOCOL .WORD LIT,8 .WORD QERR .WORD SEMIS -FTYPE .TEXT "FTH" ; default file type ; .BYTE 84H ;LOAD .TEXT "LOA" diff --git a/figforth.asm b/figforth.asm index cb8a5f9..d624cdc 100644 --- a/figforth.asm +++ b/figforth.asm @@ -3222,9 +3222,9 @@ PTSTO: .WORD $+2 JNEXT ; .EJECT -#INCLUDE DISCIO.FTH +#INCLUDE DISCIO.ASM .EJECT -#INCLUDE CONPRTIO.FTH +#INCLUDE CONPRTIO.ASM .EJECT ; .BYTE 0C1H ; ' (tick)