*************************************************************** * * * Module Name: selecdrv.lib Rev. 1.0 * * Function: This module will ask Last rev. 03 May 85 * * for source and destin- By: glh/w6bsk * * ation disks and prompt * * mounting, if called. * * Requires CPMIO.LIB * * * *************************************************************** sorcdisk: call spmsg ; Ask for source drive number db ' Input source drive (a,b,c,d): ',0 call cimsg ; Get the input ani 5fh ; Then force upper case. sui 41h ; Convert to binary jz ssave ; Was A drive, is ok. cpi 00 ; Greater than A? jnc uppes ; Yes, maybe ok. errsrv: call spmsg ; Print error message db ' Not legal drive: ',0 call ccrlf jmp sorcdisk uppes: cpi 4 ; Less than E? jc ssave ; Yes, is legal jmp errsrv ; No, try again ssave: sta srcdrv ; Save the requested drive adi 41h ; Convert back to ASCII sta ascdrv ; and save if letter needed. ret srcdrv db 1 ; Binary value of source drive ascdrv db 1 ; Ascii value of source drive destdisk: call spmsg ; Ask for source drive number db ' Input destination drive (a,b,c,d): ',0 call cimsg ; Get the input ani 5fh ; Then force upper case. sui 41h ; Convert to binary jz dsave ; Was A drive, is ok. cpi 00 ; Greater than A? jnc upped ; Yes, maybe ok. errdrv: call spmsg ; Print error message db ' Not legal drive: ',0 call ccrlf jmp destdisk upped: cpi 4 ; Less than E? jc dsave ; Yes, is legal jmp errdrv ; No, try again dsave: sta dstdrv ; Save the requested drive adi 41h ; Convert back to ASCII sta asddrv ; and save if letter needed. ret dstdrv db 1 ; Binary value of dest drive. asddrv db 1 ; Ascii value of dest drive. mountdsk: lda srcdrv ; Get the source disk mov c,a ; and store it- lda dstdrv ; Get the dest drive cmp c ; Test if same. jnz drivok ; Not, go. call ccrlf call spmsg ; Display error message db ' Source/destination same: redo. ',0 jmp start drivok: call ccrlf call spmsg ; Display the message db ' Mount the source disk in drive ' lda ascdrv ; Get the drive id (Ascii) call co ; Display it call spmsg db ' and the destination disk in drive ',0 lda asddrv ; Get dest id call co call spmsg db '.',0 call ccrlf call spmsg db ' Are the drives ready? ',0 call getyn ret ; Return to calling routine with ; zero set if Yes.