A window micro-scroll routine: 208 bytes of machine code that scroll any rectangle of the screen by one pixel per call, up, down, left, right or diagonally. The BASIC loader reads the code from hex DATA lines into memory from 64768, then runs a demonstration that draws a frame with an inner box and scrolls parts of it up, then sideways, then the whole picture diagonally off the screen.
To use it in your own program, POKE the window and direction into the six bytes at the start of the code and call RANDOMIZE USR 64820 once for each pixel of movement. The demo names the addresses: right=64768, top=64769, left=64770, bottom=64771 (pixel coordinates), xdir=64772 and ydir=64773. POKE xdir with 255 to move left, 1 to move right or 0 for no sideways movement; ydir with 255, 1 or 0 likewise for vertical movement; the two can be combined for diagonal scrolls. The REM lines at the end of the program repeat these notes.
Published in Sinc-Link September-October 1989 (Super Scroll).
Source Code
1 REM Super Scroll by Steven V. Gunhouse
2 CLEAR 64767: LET x=64768
4 PRINT AT 10,5;"Loading M/L..."
5 LET a=10: LET b=11: LET c=12: LET d=13: LET e=14: LET f=15
10 READ a$: IF a$="END" THEN GO TO 70
20 FOR n=1 TO 15 STEP 2
30 LET w=16*VAL a$(n)+VAL a$(n+1)
40 POKE x,w: LET x=x+1
50 NEXT n
60 GO TO 10
70 CLEAR : LET scroll=64820: LET right=64768: LET top=64769: LET left=64770: LET bottom=64771: LET xdir=64772: LET ydir=64773
80 PRINT "Window Micro-scroll routine"
90 FOR i=100 TO 103: PLOT i,4: DRAW 0,151: NEXT i: FOR i=152 TO 155: PLOT i,4: DRAW 0,151: NEXT i: FOR i=4 TO 7: PLOT 100,i: DRAW 55,0: NEXT i: FOR i=152 TO 155: PLOT 100,i: DRAW 55,0: NEXT i: REM Frame
100 FOR i=105 TO 108: PLOT i,9: DRAW 0,141: NEXT i: FOR i=125 TO 129: PLOT i,9: DRAW 0,141: NEXT i: FOR i=147 TO 150: PLOT i,9: DRAW 0,141: NEXT i
105 FOR i=9 TO 12: PLOT 105,i: DRAW 45,0: NEXT i: FOR i=147 TO 150: PLOT 105,i: DRAW 45,0: NEXT i: FOR i=79 TO 82: PLOT 105,i: DRAW 45,0: NEXT i
110 POKE left,104: POKE right,151: POKE xdir,0: POKE ydir,1: FOR i=8 TO 76: POKE top,i+74: POKE bottom,i: RANDOMIZE USR scroll: NEXT i
120 POKE xdir,1: POKE ydir,0: POKE bottom,8: POKE top,151: FOR i=1 TO 48: RANDOMIZE USR scroll: NEXT i
130 POKE left,0: POKE right,159: POKE top,159: POKE bottom,0: POKE xdir,255: POKE ydir,255: FOR i=1 TO 160: RANDOMIZE USR scroll: NEXT i
150 REM This routine will scroll any section of screen any direction.
160 REM Variable names for POKEs should be self-explanatory.
170 REM Use POKE xdir,255 to scroll left, POKE xdir,1 to scroll right.
175 REM Or POKE xdir,0 for no horizontal scrolling.
180 REM Use POKE ydir,255 to scroll up, POKE ydir,1 to scroll down,
185 REM or POKE ydir,0 for no vertical scrolling.
190 REM These can be combined for diagonal scrolls.
9973 DATA "FFAF000001FF3A05"
9974 DATA "FD47545DFEFF3E07"
9975 DATA "281424A4200A7DC6"
9976 DATA "206F38047CD60867"
9977 DATA "AFB8C0545DC9A425"
9978 DATA "A7C07DD6206FD87C"
9979 DATA "C60867C9ED5B00FD"
9980 DATA "2A02FD7A94477BF6"
9981 DATA "07951F1F1FE61F3C"
9982 DATA "4F04C5ED4B04FD3E"
9983 DATA "FFB8280162B92001"
9984 DATA "6BCB3DCB3DCB3D3E"
9985 DATA "AF9467E6380707B5"
9986 DATA "6F7CCB3FCB3FCB3F"
9987 DATA "ACE6F8ACF6406754"
9988 DATA "5D78A7C1280605C5"
9989 DATA "CD06FDC13A04FDFE"
9990 DATA "FF281CA72832C5E5"
9991 DATA "41A77E1F12132310"
9992 DATA "F9E1CD06FDC110EE"
9993 DATA "AF41121310FCC9C5"
9994 DATA "E541A77E17121B2B"
9995 DATA "10F9E1CD06FDC110"
9996 DATA "EEAF41121B10FCC9"
9997 DATA "C5E50600EDB0E1CD"
9998 DATA "06FDC110F3C90000"
9999 DATA "END"
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

