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 / CPM / ZCPR / ZCPRBF.ASM < prev   
Assembly Source File  |  2000-06-30  |  3KB  |  86 lines

  1. ; ZCPR contains two minor but inconvenient bugs in the TYPE command.
  2. ; 1. Non-printing control codes increment the column count though
  3. ;    the cursor column on the console hasn't moved.  Also stray line
  4. ;    feeds (<LF> with no <CR>) reset the column count when in fact
  5. ;    only a line feed has been printed and the cursor is still
  6. ;    (one would hope) in the same column on the console.  In either
  7. ;    case all further TAB expansion untill the next <CR> will be
  8. ;    incorrect.
  9. ; 2. When TYPE pauses (in the page mode) waiting a key from the
  10. ;    terminal, the key when pressed will be echoed to the console
  11. ;    display before the file resumes typing.  This charecter isn't
  12. ;    counted in the column count so not only does it mess up the
  13. ;    screen bye echoing, it also causes the tab expansion to be off
  14. ;    untill the next <CR>.  This is not a problem if the charecter
  15. ;    typed to resume a paused output is a non-printing control code
  16. ;    or a <CR>.  (for thoes of us who like <space-bar> for --More--
  17. ;    I offer the following patches.)
  18. ;
  19. ;        Comments to: GRUPP@MIT-MC
  20. ;    
  21. ;--------------------------------------------------------------
  22. ;The following code should be added in section 3 after
  23. ;the CONIN: sub-routine.
  24. ;
  25. NOECHO:
  26.     PUSH    D    ;Get char from CON: with no echo
  27.     MVI    C,6    ;Set up for direct CON I/O
  28.     MVI    E,0FFH    ;
  29.     CALL    BDOSB
  30.     POP    D
  31.     CPI    0    ;Con stat, 0 = no char
  32.     JRZ    NOECHO    ;Loop till we get a char
  33.     RET
  34. ;
  35. ;--------------------------------------------------------------
  36. ;In Section 5D (TYPE Command) the code from:
  37. ; "OUTPUT CHAR TO CON: OR LST: DEVICE WITH TABULATION" to:
  38. ; "CONTINUE PROCESSING" should be replaced with the following;
  39. ;
  40. ;
  41. ; OUTPUT CHAR TO CON: OR LST: DEVICE WITH TABULATION
  42. ;
  43.     CPI    CR        ;Is char <CR> ?
  44.     JRNZ    NOCR        ;No
  45.     MVI    B,0        ;Yes... reset tab count.
  46. NOCR:
  47.     CPI    ' '        ;Is char control code ?
  48.     JRC    NOPRT        ;Yes... non printing don't bump count
  49.     INR    B        ;else increment char count
  50. NOPRT:
  51.     CPI    TAB        ;Tab ?
  52.     JRZ    LTAB        ;Yes... expand.
  53.     CALL    LCOUT        ;Output char (or control char)
  54.     JR    TYPE2L
  55. LTAB:
  56.     MVI    A,' '        ;<SP>
  57.     CALL    LCOUT
  58.     INR    B        ;Incr col count
  59.     MOV    A,B
  60.     ANI    7
  61.     JRNZ    LTAB
  62. ;
  63. ; CONTINUE PROCESSING
  64. ;
  65. ;--------------------------------------------------------------
  66. ;The marked change should be made in the PGFLG: routine. ---------------|
  67. ;                                    |
  68. ;                                    |
  69. PGFLG    EQU    $+1        ;POINTER TO IN-THE-CODE BUFFER PGFLG    |
  70.     MVI    A,0        ;0 MAY BE CHANGED BY PGFLG EQUATE    |
  71.     CPI    PGDFLG        ;PAGE DEFAULT OVERRIDE OPTION WANTED?    |
  72. ;                                    |
  73.     IF    PGDFLT        ;IF PAGING IS DEFAULT            |
  74.     JRZ    PGBAK        ;  PGDFLG MEANS NO PAGING, PLEASE    |
  75.     ELSE            ;IF PAGING NOT DEFAULT            |
  76.     JRNZ    PGBAK        ;  PGDFLG MEANS PLEASE PAGINATE        |
  77.     ENDIF                                |
  78. ;                                    |
  79.     CALL    NOECHO        ;get char to continue... but,    <<<-----|
  80.                 ;DON'T mess up screen with it.    <<<-----|
  81.     CPI    'C'-'@'     ;^C
  82.     JZ    RSTCPR        ;RESTART CPR
  83. ;
  84. ;
  85. ;--------------------------------------------------------------
  86.