home *** CD-ROM | disk | FTP | other *** search
- FLOWCHART FOR BACKSPACE HANDLING
- IN CP/M AND MICROSOFT BASIC
- R.C. Minnick
- Box 306
- Ouray CO 81427
-
-
- Unfortunately for those of us who are able to do real
- backspaces, both CP/M and Microsoft Disk BASIC assume that all
- of us are stupid enough to buy ASR33's. Also, each of the
- above two processors handles backspaces differently. The
- flowchart below shows how I have been able to get rid of the
- annoying backslashes and echoed deletions in both CP/M and
- BASIC. I have chosen to use the DEL key for backspacing, but
- another can be substituted if desired.
-
- This scheme does not make TAB corrections on backspacing
- (an exercise for the student--and PLEASE tell me if you are
- able to add in this feature!)
- ENTRY
- !
- IS DF=1? :y____________
- n !
- ! IS DATUM='\'? :y___
- IS SF=1? :n____ n !
- y ! ! SET SF=1
- ! ! IS DATUM=DEL? y__!
- SET SF=0 ! n !
- ! ! ! !
- ! ! SET DATUM=DEL !
- ! ! ! !
- ! !______! !
- ! ! !
- ! DISPLAY DATUM !
- ! ! !
- ! SET DF=0 !
- ! ! !
- !_________________!_____________!
- !
- EXIT
-
- SF=BACKSLASH FLAG
- DF=DELETE FLAG
-
-
-
- ======================================
- Code fragment for the above flow chart
- DF is bit 7 & SF is bit 6 of IOCKBD
- ======================================
-
- ;
- ; VDM OUTPUT DRIVER - DATUM IN C - HANDLE
- ; DELETE FLAG (DF) & BACKSLASH FLAG (SF)
- VDMC: PUSH H
- LXI H,IOCKBD
- MOV A,M
- RLC ;CY=1 IF DF=1
- JC VDMCA
- RLC ;CY=1 IF SF=1
- MOV A,C ;DATUM
- JNC VDMCB
- MOV A,M
- ANI 0BFH ;SF=0
- MOV M,A
- POP H
- RET
- VDMCA: MOV A,C
- CPI 5CH ;BACKSLASH
- JNZ VDMCC
- MOV A,M
- ORI 40H ;SF=1
- MOV M,A
- POP H
- RET
- VDMCC: CPI 7FH ;DELETE?
- MVI A,7FH
- JNZ VDMCB
- POP H
- RET
- VDMCB: CALL VDM
- MOV A,M
- ANI 7FH ;DF=0
- MOV M,A
- POP H
- RET
-