Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Service 06H (decimal 6) and companion service 07H are used to define a
  rectangular window of text on the screen and to scroll the window's
  contents up or down one or more lines. To accomplish the scrolling effect,
  blank lines are inserted at the bottom of the window area with service 06H
  (at the top with service 07H) and the top lines of the window (the bottom
  lines with service 07H) are scrolled off and disappear.

  The number of lines to be scrolled is specified in AL. If AL = 00H, the
  entire window is blanked. (The same thing would happen if you scrolled
  more lines than the window size allowed.) The location or size of the
  window is specified in the CX and DX registers: CH is the top row, and DH
  is the bottom row; CL is the left column, and DL is the right column. The
  display attribute for the new blank lines inserted by the two services is
  taken from BH. Figure 9-7 summarizes the register settings for both
  services 06H and 07H.

  When you fill a window with lines of text, you'll discover that window
  scrolling is normally a two-stage process: When a new line is ready to be
  written in the window, service 06H (or service 07H) scrolls the current
  window contents. Then the new line is filled with text using the cursor-
  positioning and character-writing services. The following example
  demonstrates this window action.

  DEBUG                   ; invoke DEBUG from DOS utilities
  A                       ; ask to assemble instructions
  INT 10                  ; create interrupt 10H instruction
  [Return]                ; finish assembling
  R AX                    ; ask to see and change contents of AX
  0603                    ; specify service 06H (scroll up), using
                          ; 3-line window
  R CX                    ; ask to see and change contents of CX
  050A                    ; specify top left corner: row 5, column 10
  R DX                    ; ask to see and change contents of DX
  1020                    ; specify bottom right corner: row 16, column 32
  D 0 L 180               ; fill screen with nonsense
  G =100 102              ; execute INT 10H, then stop

  Service Number           Parameters
  --------------------------------------------------------------------------
  AH = 06H (scroll up)     AL = number of lines to scroll
  AH = 07H (scroll down)   CH = row number of upper-left corner
                           CL = column number of upper-left corner
                           DH = row number of lower-right corner
                           DL = column number of lower-right corner
                           BH = display attribute for blank lines
  --------------------------------------------------------------------------

  Figure 9-7.  Register values for scrolling using services 06H and 07H.

  See Chapter 8 for more on assembly-language routines. See the IBM DOS
  Technical Reference Manual for more on DEBUG.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson