mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-27 10:24:19 +00:00
Upload
Digital Research
This commit is contained in:
38
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-20.ASM
Normal file
38
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-20.ASM
Normal file
@@ -0,0 +1,38 @@
|
||||
; Figure 5-20
|
||||
;
|
||||
; CF
|
||||
; Create File
|
||||
; This subroutine creates a file. It erases any previous
|
||||
; File before creating the new one.
|
||||
;
|
||||
; Entry Parameters
|
||||
;
|
||||
; DE -> File Control Block for new file
|
||||
;
|
||||
; Exit Parameters
|
||||
;
|
||||
; Carry Clear if operation successful (A = 0,1,2,3)
|
||||
; Carry Set if error (A = 0FFH)
|
||||
;
|
||||
; Calling Sequence
|
||||
;
|
||||
; LXI D,FCB
|
||||
; CALL CF
|
||||
; JC ERROR
|
||||
;
|
||||
B$ERASE EQU 19 ;Erase File
|
||||
B$CREATE EQU 22 ;Create File
|
||||
BDOS EQU 5 ;BDOS Entry Point
|
||||
;
|
||||
;
|
||||
CF:
|
||||
PUSH D ;Preserve FCB Pointer
|
||||
MVI C,B$ERASE ;Erase any existing file
|
||||
CALL BDOS
|
||||
POP D ;Recover FCB Pointer
|
||||
MVI C,B$CREATE ;Create (and open new file)
|
||||
CALL BDOS
|
||||
CPI 0FFH ;Carry set if OK, Clear if Error
|
||||
CMC ;Complete to use Carry set if Error
|
||||
RET
|
||||
|
||||
Reference in New Issue
Block a user