TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: BARRY BLOCK
from: DENIS BOYLES
date: 1997-05-13 13:35:00
subject: Scrolly.Asm 1/

;-=] SCROLLY.ASM [=- v1.00 Public Domain (pd) by Denis Boyles
;
; This is the assembly version of my "VGA Scroller" program, as suggested I 
try
; by Barry Block in the 80XXX ECHO. It uses the same technique I used in my
; BIGHIYA.ASM program of using the CGA ROM 8x8 FONT to plot letters.
;
; The FONT is used to plot the letters onto the VGA screen (320x200x256) 
here
; they are "scrolled" to the left. Something familiar to anyone who's seen or
; is a member of "demo" coding group. If not, it's just like a stock quote
; ticker, scrolling text in/out of the screen.
;
; This program has been a while coming, I wasn't to sure I could even do it
; in pure assembly. However after doing a C version, then a QBASIC one, I 
elt
; ready to tackle it. :) Some parts may not be designed the best, but for now
; it works, which is enough for me.
;
; Arrowsoft Assembler (MASM v3.0) / VAL Linker (as .COM file)
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;--------------------------------------------------------------------------
;Just going to define some EQUate constants here
VIDEO       EQU 10h                    ;the BIOS VIDEO interrupt services
KEYBOARD    EQU 16h                    ;the BIOS KEYBOARD interrupt services
DOS         EQU 21h                    ;the DOS interrupt services
ScrollY     EQU 61                     ;the Y position of the scroller text
WinColor    EQU 2                      ;the color for the scroller border
PRG SEGMENT
    ASSUME CS:PRG,DS:PRG
    ORG 100h
;--------------------------------------------------------------------------
;This is the DOS entry point, which jumps over our data to the main
;procedure.
ENTRY:
    jmp     main
;--------------------------------------------------------------------------
;All our data is stored here which consists of the following: A table of 8
;color values used for the font. The table is used as Y positions 0-7 to
;color those pixels.
;
;The bits is a table of the 8-bit values, used to test the font for an on/off
;pixel. The font itself is 8-bits across by 8 bytes and is a monochrome font.
;This is NUL terminated, to test when the last bit in the table has been used
;so it can start again at 0.
;
;Finally msg is the message that will be scrolled on the screen. This can be
;as long as you want, assuming it fits in a 64K COM segment. It's also NUL
;terminated to detect the end.
colors      db 15,11,3,3,9,9,1,1
bits        db 128,64,32,16,8,4,2,1,0
msg         db ". . . . . . Hello, World! . . . . . . -=] SCROLLY.ASM [=- "
            db "v1.00 Public Domain (pd) 1997 by Denis Boyles . . . . . . "
            db "Greetz to: Barry Block ",1," Sylvain Lauzon ",1," Nick Coons 

            db 1," Kevin Barrow ",1," and everyone else on the ",17," 80XXX "
            db 16," Fido ECHO . . . . . . Special greetz to: VLA ",4
            db " ASPHYXIA ",4," INERTIA ",4," and all other demo groups, "
            db "keep on ",15," coding ",15," . . . This message will self-"
            db "repeat . . . . . . ",0
;--------------------------------------------------------------------------
;This is the main procedure which is jumped to from the DOS entry point
;above. It basically gets the ball rolling by setting up the scroller and
;then starting it.
main PROC
    mov     AX,0013h                   ;VIDEO - Set Video Mode (13h)
    int     VIDEO                      ;call to switch into 320x200x256 mode
    mov     AX,0A000h                  ;setup ES so it addresses the VIDEO 
AM
    mov     ES,AX                      ;set/left set during program run
    call    SetupScreen                ;prepares the scroller border/window
    call    ScrollText                 ;this starts the scroller loop
    mov     AX,0003h                   ;VIDEO - Set Video Mode (03h)
    int     VIDEO                      ;call to switch back to text mode
    mov     AX,4C00h                   ;DOS - Terminate Program (0)
    int     DOS                        ;call to quite back to DOS
main ENDP
;-=] SetupScreen [=--------------------------------------------------------
;This adjusts the scanline per pixel ratio, to make the font "bigger". It
;also draws two lines which act as the scroller window/border/frame.
SetupScreen PROC
    mov     DX,03D4h                   ;DX = VGA ? register
    mov     AX,0209h                   ;AX = index 9 - set scanline/pel (2)
    out     DX,AX                      ;send the index/data to the VGA port
;this makes each pixel (2)+1 = 3 scanlines in depth. ie: 320x132 ? mode
    mov     AX,ScrollY - 3             ;AX = Y position for horizontal line
    push    AX                         ;push it onto the stack
    mov     AX,WinColor                ;AX = color of that line
    push    AX                         ;push it onto the stack
    call    HorizLine                  ;draw the top line
    mov     AX,ScrollY + 10            ;same above, but for bottom line
    push    AX
    mov     AX,WinColor
    push    AX
    call    HorizLine
    ret
SetupScreen ENDP
>>> Continued to next message
 * OLX 2.1 TD * Backup not found: (A)bort (R)etry (P)anic
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.