Opening A Source File (Ascii File); Inputting The Line Of Source File (Ascii File); Output Of A Source File (Ascii File); Closing Source Files (Ascii Files) - Sharp mz-800 Technical Reference And User's Manual

Hide thumbs Also See for mz-800:
Table of Contents

Advertisement

Opening a source file (ASCII file)
LD A,open-mode
LD(ZRWX),A
LD A,3
LD(ELMD),A
LD
A,l
LD(ZLOG),A
LD DE,FILE.X
SVC .COUNT
SVC.DEVFN
SVC .RWOPN
LD A,(ELMD)
CP 3
JP NZ,error
; Read-open if the open mode is 1 and write-opens if it is 2.
· ; Set the file mode to the source file mode.
; Set the logical number to 1.
; Set the name of the file to be opened in DE.
; Sets the file length in bytes in B.
; Interpret (specify) the device name and file name.
; Open the file
; Set the file mode opened in A.
; Source file?
; Jump to the error handling routine if not source file.
FILE. X: DEFM "QD: SAMPLE"
DEFBO
; Set the end of the file name to 0.
; Add 0 to end of filename.
Inputting one line of source file(ASCII file)
LD DE,buffer-adr
SVC .INMSG
JP C,eof
Output of a source file (ASCII file)
LD DE,save-adr
LD B,length
SVC.PRSTR
Closing source files (ASCII files)
LD A,logical-number
LD B,FFH
SVC.CLKL
; The source file is assumed to be read-opened.
; Set the starting address of the input buffer in DE.
; Input one line.
; Perform the file end processing if CF:
=
; Set the length of the line read in bytes in B.
(OD at the end of the line is not included.)
; The source file is assumed to have been opened.
; Starting address of the memory area to be saved.
; File size in bytes (including OD at the end of each line).
; Specified file only if the logical number is not zero and all files if it is
; zero.
; Closes the file(s).
65

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents