home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG025.ARK / BKSPACE.DOC < prev    next >
Text File  |  1984-04-29  |  3KB  |  87 lines

  1.                FLOWCHART FOR BACKSPACE HANDLING
  2.                   IN CP/M AND MICROSOFT BASIC
  3.                          R.C. Minnick
  4.                             Box 306
  5.                         Ouray CO 81427
  6.  
  7.  
  8. Unfortunately  for  those  of  us  who  are  able  to  do  real
  9. backspaces,  both CP/M and Microsoft Disk BASIC assume that all
  10. of us are stupid enough to buy ASR33's.    Also,  each  of  the
  11. above  two  processors  handles  backspaces  differently.   The
  12. flowchart below shows how I have been able to get  rid  of  the
  13. annoying  backslashes  and  echoed  deletions  in both CP/M and
  14. BASIC.  I have chosen to use the DEL key for  backspacing,  but
  15. another can be substituted if desired.  
  16.  
  17.       This scheme does not make TAB corrections on  backspacing
  18. (an  exercise  for  the  student--and PLEASE tell me if you are
  19. able to add in this feature!) 
  20.                      ENTRY
  21.                        !
  22.                    IS DF=1? :y____________
  23.                        n                 !
  24.                        !              IS DATUM='\'? :y___
  25.                    IS SF=1? :n____       n              !
  26.                        y          !      !          SET SF=1
  27.                        !          !   IS DATUM=DEL? y__!
  28.                    SET SF=0       !      n             !
  29.                        !          !      !             !
  30.                        !          !   SET DATUM=DEL    !
  31.                        !          !      !             !
  32.                        !          !______!             !
  33.                        !                 !             !
  34.                        !              DISPLAY DATUM    !
  35.                        !                 !             !
  36.                        !              SET DF=0         !
  37.                        !                 !             !
  38.                        !_________________!_____________!
  39.                                          !
  40.                                        EXIT
  41.  
  42.               SF=BACKSLASH FLAG
  43.               DF=DELETE FLAG
  44.  
  45.  
  46.  
  47.          ======================================
  48.          Code fragment for the above flow chart
  49.          DF is bit 7 & SF is bit 6 of IOCKBD
  50.          ======================================
  51.  
  52. ;
  53. ; VDM OUTPUT DRIVER - DATUM IN C - HANDLE
  54. ; DELETE FLAG (DF) & BACKSLASH FLAG (SF) 
  55. VDMC:  PUSH    H
  56.        LXI     H,IOCKBD
  57.        MOV     A,M
  58.        RLC             ;CY=1 IF DF=1
  59.        JC      VDMCA
  60.        RLC             ;CY=1 IF SF=1
  61.        MOV     A,C     ;DATUM
  62.        JNC     VDMCB
  63.        MOV     A,M
  64.        ANI     0BFH    ;SF=0
  65.        MOV     M,A
  66.        POP     H
  67.        RET
  68. VDMCA: MOV     A,C
  69.        CPI     5CH     ;BACKSLASH
  70.        JNZ     VDMCC
  71.        MOV     A,M
  72.        ORI     40H     ;SF=1
  73.        MOV     M,A
  74.        POP     H
  75.        RET
  76. VDMCC: CPI     7FH     ;DELETE?
  77.        MVI     A,7FH
  78.        JNZ     VDMCB
  79.        POP     H
  80.        RET
  81. VDMCB: CALL    VDM
  82.        MOV     A,M
  83.        ANI     7FH     ;DF=0
  84.        MOV     M,A
  85.        POP     H
  86.        RET
  87.