Skip to content

Commit

Permalink
add FTYPE word
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrit committed Dec 15, 2020
1 parent 6c4098f commit 0149d37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions discio.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions figforth.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0149d37

Please sign in to comment.