15h DP$VIEW display a string
Input A register - line number (0 for top line).
B register - Length of string to view
X register - Address of string to view
UTW_S0 - Time to delay before scrolling in 1/20 second.
Output B register - Key press that terminated scrolling.
Description

Displays the string and then starts to scroll to the right wrapping around with two spaces in between, on the line specified in the A register.

Pressing the left and right arrow keys alters the scrolling action if top bit of A register is clear when passed to the routine.

Any other key press is returned in the B register.

If the top bit of register A is set then the routine will not allow the use of any arrow keys and will return on any key press.

If the returned key is not of interest and scrolling of the same string is to be continued then VIEW can be called again with an address of 0 in the X register. No other calls to the display driver should be used between the subsequent calls of DP$VIEW with X = 0.

If the string is less than the screen width then no scrolling will occur but the routine will still wait for a key and will discard left and right arrow key presses.

The cursor is switched off during this routine but the cursor state prior to the call is maintained.

After this call the cursor position as used by the PRINT and EMIT routines will be trashed, it corrupts location dpb_cpos (current cursor position).

If a call is made initially with the X register equal to 0 then anything can and probably will happen.

Example The following example displays the first 16 or 20 characters of the string "HELLO THERE PLEASE PRESS EXECUTE" for 2 seconds on the second line of the LCD. Then continually scrolls the whole string until the execute key is pressed. Pressing the arrow keys will stop, start and change the direction of the scrolling.
LDD     #40
        STD     UTW_S0                  ; wait 2 seconds before scrolling
        LDAA    #1                      ; display on second line
        LDX     #STRING                 ; address of string
        LDAB    #ENDSTR-STRING          ; length of string
LOOP:   OS      DP$VIEW
        LDX     #0                      ; continue viewing unless
        CMPB    #13                     ; execute key was pressed
        BNE     LOOP                    ; if so return
        RTS
STRING: ASCII   "HELLO THERE PLEASE PRESS EXECUTE"
ENDSTR:
Errors - none -