home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / qb_lib / scroll.asm < prev    next >
Encoding:
Assembly Source File  |  1990-04-20  |  3.6 KB  |  99 lines

  1. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. ;
  3. ;       Name :    Scroll.ASM
  4. ;    Revised :    4/20/90
  5. ;    Purpose :    - This routine allows a user-defined screen "window" area to be
  6. ;        SCROLLED by one screen row on the currently active display page
  7. ;        of the screen.
  8. ;        - The user must define the 4 corners of the area, the color to
  9. ;        use, and the direction of the scroll.
  10. ;
  11. ;      Notes :    - This routine does NO ERROR CHECKING!
  12. ;        - Requires the Microsoft MACRO ASSEMBLER V 5.1 or higher for
  13. ;        successful assembly due to the use of the Microsoft simplified
  14. ;        Segment Model.
  15. ;        - This routine should be DECLAREd in your program as an
  16. ;        external SUB routine, via the QuickBASIC statement :
  17. ;
  18. ;        DECLARE SUB Scroll (Ulr%, Ulc%, Lrr%, Lrc%, Attrib%, Dir%)
  19. ;
  20. ;        - Consistent with QuickBASIC, this routine will treat the
  21. ;        screen as ranging from the upper left corner (at 1,1) to the
  22. ;        lower right corner (at 25,80), rather than the way in which
  23. ;        assembler usually defines the screen ( as 0,0 to 24,79 ).
  24. ;        - It is OK to use an Lrr > 24 if you are in EGA (43 row) or
  25. ;        VGA (50 row) text mode.
  26. ;
  27. ; Parameters :    - This SUB requires SIX parameters, any or all of which
  28. ;        may be either pre-defined INTEGER VARIABLES, IMMEDIATE INTEGER
  29. ;        VALUES, or CONSTs.
  30. ;        - Note that INTEGER VARIABLES or CONST's are faster at run-time
  31. ;        than IMMEDIATE INTEGER VALUES.
  32. ;        - In Sequence, these parameters are defined as -
  33. ;
  34. ;        Ulr    = Upper Left Hand Row # of the Window
  35. ;        Ulc    = Upper Left Hand Column # of the Window
  36. ;        Lrr    = Lower Right Hand Row #
  37. ;        Lrc    = Lower Right Hand Column #
  38. ;        Attrib    = The color attribute to give the Window Area
  39. ;        Dir    = Direction to Scroll (0 = UP, 1 = DOWN)
  40. ;
  41. ;    Color        Foreground Value        Background Value
  42. ;
  43. ;    BLACK            0                 0
  44. ;    BLUE            1                16
  45. ;    GREEN            2                32
  46. ;    CYAN            3                48
  47. ;    RED            4                64
  48. ;    MAGENTA         5                80
  49. ;    YELLOW            6                96
  50. ;    WHITE            7                   112
  51. ;
  52. ;    To get INTENSE foreground color, add 8 to foreground value.
  53. ;    To get BLINKING attribute, add 128 to the total combined color value.
  54. ;==============================================================================
  55.  
  56.     .MODEL    MEDIUM,BASIC
  57.     .CODE
  58.  
  59. Scroll    PROC    ULR:word, ULC:word, LRR:word, LRC:word, ATTRIB:word, DIR:word
  60.  
  61.     mov    BX,ULC            ; Put address of Ulc value into BX
  62.     mov    CX,[BX]         ; Put the Ulc value into CL
  63.     dec    CX            ; Adjust for BASIC screen definition
  64.  
  65.     mov    BX,ULR            ; Put address of Ulr value into BX
  66.     mov    AX,[BX]         ; Put the Ulr value into AX
  67.     dec    AX            ; Adjust for BASIC screen definition
  68.     mov    CH,AL            ; Put Ulr value into CH
  69.  
  70.     mov    BX,LRC            ; Put address of Lrc value into BX
  71.     mov    AX,[BX]         ; Put the Lrc value into AX
  72.     dec    AX            ; Adjust for BASIC screen definition
  73.     mov    DX,AX            ; Put adjusted value into DL
  74.  
  75.     mov    BX,LRR            ; Put address of Lrr value into BX
  76.     mov    AX,[BX]         ; Put the Lrr value into AX
  77.     dec    AX            ; Adjust for BASIC screen definition
  78.     mov    DH,AL            ; Put the Lrr value into DH
  79.  
  80.     mov    BX,DIR            ; Load address of scroll direction
  81.     mov    AX,[BX]         ; Put scroll direction value in AL
  82.     mov    AH,AL            ; Transfer scroll direction value to AH
  83.     push    AX            ; Save the scroll direction temporarily
  84.  
  85.     mov    BX,ATTRIB        ; Put address of color attribute in BX
  86.     mov    AX,[BX]         ; Load color attribute value into AX
  87.     mov    BH,AL            ; Load color attribute value into BH
  88.  
  89.     pop    AX            ; Restore the scroll direction value
  90.     add    AH,06            ; BIOS Scroll Function
  91.     mov    AL,01            ;    for one line
  92.     int    10h            ; BIOS INT
  93.  
  94.     ret                ; RETURN to CALLing QB program
  95.  
  96. Scroll    ENDP
  97.     END
  98. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  99.