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:
50
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-15.ASM
Normal file
50
CONTRIBUTIONS/cpm-handbook/cpmsrc/FIG5-15.ASM
Normal file
@@ -0,0 +1,50 @@
|
||||
; Figure 5-15
|
||||
;
|
||||
; CDISK
|
||||
; Change Disk
|
||||
; This subroutine displays a message requesting the
|
||||
; to change the specified logical disk, then waits for
|
||||
; a Carriage Return to be pressed. It then issues
|
||||
; a Disk Reset and returns to the caller.
|
||||
;
|
||||
; Entry Parameters
|
||||
;
|
||||
; A = Logical disk to be changed (A = 0, B = 1)
|
||||
;
|
||||
; Exit Parameters
|
||||
;
|
||||
; None
|
||||
;
|
||||
; Calling Sequence
|
||||
;
|
||||
; MVI A,0 ;Change drive A:
|
||||
; CALL CDISK
|
||||
;
|
||||
;
|
||||
B$DSKRESET EQU 13 ;Disk Reset function code
|
||||
B$PRINTS EQU 9 ;Print $-terminated string
|
||||
B$CONIN EQU 1 ;Get console input
|
||||
BDOS EQU 5 ;BDOS Entry Point
|
||||
;
|
||||
CR EQU 0DH
|
||||
LF EQU 0AH
|
||||
;
|
||||
CDISKM: DB CR,LF,'Change logical disk '
|
||||
CDISKD: DB 0
|
||||
DB ': and press Carriage Return to continue$'
|
||||
;
|
||||
CDISK:
|
||||
ADI 'A'-1 ;Convert to Letter
|
||||
STA CDISKD ;Store into message
|
||||
MVI C,B$PRINTS ;Display Message
|
||||
LXI D,CDISKM
|
||||
CALL BDOS
|
||||
CDISKW:
|
||||
MVI C,B$CONIN ;Get keyboard character
|
||||
CALL BDOS
|
||||
CPI CR
|
||||
JNZ CDISKW
|
||||
MVI C,B$DSKRESET ;Now reset disk system
|
||||
CALL BDOS
|
||||
RET
|
||||
|
||||
Reference in New Issue
Block a user