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 / FRAGMENT.DOC < prev    next >
Text File  |  1984-04-29  |  4KB  |  123 lines

  1.                     TWO VDM CBIOS FRAGMENTS
  2.                          R.C. Minnick
  3.                             Box 306
  4.                         Ouray, CO 81427
  5.                                
  6.  
  7.  
  8.  
  9.       There are a couple features in my CBIOS which I find very
  10. useful, and which might be of interest to others in the  CPMUG.
  11. Rather than bore you with a complete CBIOS listing (it occupies
  12. 5K  of  EPROM plus the standard RAM), the two interesting parts
  13. are shown below as code fragments.  
  14.  
  15.       The first is a VDM paging function which is added to  the
  16. standard  VDM  software  driver.    In the code below, bit 0 of
  17. IOCVDM stores the paging flag.  If  it  is  on,  the  VDM  will
  18. display  16  lines  and  then pause until a CON: input.  If the
  19. input is any character BUT a 'P', the process of stopping every
  20. 16 lines continues; if a 'P' is entered,  the  paging  flag  is
  21. turned  off.   The code below does not show the TOGPG function,
  22. since it is certain that you will do the job differently than I
  23. have.  
  24.  
  25.  
  26. ; SCROLL SCREEN UP
  27. SCRL:  LXI     H,BOTL  ;BEGINNING OF TEXT LINE
  28.        PUSH    H
  29.        LDA     IOCVDM
  30.        ANI     1       ;0=PAG OFF
  31.        XRI     1       ;0=PAG ON
  32.        ORA     M       ;0= " & BOTL=0
  33.        JNZ     $+6
  34.        CALL    CHAR    ;ANY BUT P RESTARTS
  35.        CPI     'P'
  36.        PUSH    D
  37.        CZ      TOGPG   ;P REMOVES PAGING
  38.        POP     D
  39.        MOV     A,M
  40.        INR     M
  41.        SUB     M
  42.        LXI     B,0
  43.        CALL    CLNA
  44.        LXI     B,2040H ;B=SPACE, C=CTR=64
  45. SCRL2: MOV     M,B     ;CLEAR BOTTOM LINE
  46.        INR     L
  47.        DCR     C
  48.        JNZ     SCRL2
  49.        POP     H
  50.        MOV     A,M
  51.        ANI     0FH
  52.        MOV     M,A
  53. ; SET BOSL & BOTL IN SCROLL REGISTER
  54. VDMOT: LDA     BOSL
  55.        RLC
  56.        RLC
  57.        RLC
  58.        RLC
  59.        LXI     H,BOTL
  60.        ORA     M
  61.        OUT     VDMDEV  ;SCROLL REGISTER PORT
  62.        RET
  63.  
  64.  
  65.  
  66.  
  67.  
  68.       In the second code fragment, a hard copy is  produced  of
  69. the  information  on the VDM screen.  That is, the current CON:
  70. display is sent to LST: without  any  disturbance  (except  the
  71. appearance  of  the prompt character--which is later erased) to
  72. CON:.  This fragment is actually an addition to code  published
  73. by  Dan  S.  Parker  in DDJ [V2 N4 P10, April 1977].  The cited
  74. code has been improved by the suppresion of blanks to the right
  75. of non-blank text on each line.  My  code  below  is  not  very
  76. elegant,  but it works.  Furthermore, I find the feature useful
  77. to have.  
  78.  
  79.  
  80. ;
  81. ; HARD COPY OF VIDEO SCREEN TO DURA
  82. ;
  83. HCOPY: LDA     BOTL    ;VDM BEG. OF TEXT LINE
  84.        LXI     H,VDMBASE       ;BOTTOM VDM RAM
  85.        LXI     D,40H   ;CHAR/LINE (16-BIT)
  86. HCOPY1:DAD     D
  87.        DCR     A
  88.        JNZ     HCOPY1  ;HL NOT AT START OF TEXT
  89.        MVI     E,11H   ;E=1+LINES/SCREEN
  90. NXTLN: MVI     C,CR
  91.        CALL    LIST    ;DO CRET
  92.        MOV     A,H
  93.        CPI     0D0H    ;STILL WITHIN VDM RAM?
  94.        JNZ     $+6     ;YES
  95.        LXI     H,VDMBASE       ;WRAP-AROUND
  96.        DCR     E       ;LINE COUNT
  97.        JNZ     HCOPY3  ;NOT DONE
  98.        RET
  99. HCOPY3:MVI     D,40H   ;RESET CHAR COUNT
  100.        MVI     C,3FH   ;LOCAL CTR
  101.        PUSH    H       ;SAVE BEG. OF LINE PTR.
  102.        MOV     A,L
  103.        ADD     C
  104.        MOV     L,A     ;HL POINTS TO END OF LINE
  105. HCOPY5:MOV    A,M
  106.        CPI     20H     ;SPACE?
  107.        JNZ     HCOPY4  ;NO, EXIT THIS CALC.
  108.        DCR     D
  109.        DCX     H
  110.        DCR     C       ;TO KEEP ON THIS LINE
  111.        JNZ     HCOPY5  ;CONTINUE REMOVING SPACES
  112. HCOPY4:POP     H       ;RESTORE BEG. OF LINE PTR.
  113. HCOPY2:PUSH    H       ;SAVE BEG. OF LINE
  114.        MOV     C,M     ;DATUM
  115.        CALL    LIST    ;PRINT IT
  116.        INX     H
  117.        DCR     D       ;CHAR COUNT
  118.        JNZ     HCOPY2+1        ;CONTINUE
  119.        POP     H       ;BEG. OF THIS LINE
  120.        LXI     B,40H
  121.        DAD     B       ;HL NOT POINTS TO NEXT LINE
  122.        JMP     NXTLN
  123.