<ahem> speaking of ASM, paste this into an ASM file, and compile it.
incase you dont get a chance to try this totaly kewl program, it makes your moniter in full-screen mode, then makes cool fire effect...
=)
it has nothing to do with what your talking about, I just thought I would include it(BTW the compiled executable is only 1.92kb)
.MODEL SMALL ; Data segment < 64K, code segment < 64K
.STACK 200H ; Set up 512 bytes of stack space
.386
; ===========================================================================
.DATA
CR EQU 13
LF EQU 10
BufferX EQU 320 ; Width of screen buffer
BufferY EQU 104 ; Height of screen buffer
AllDone DB CR, LF, "That was:"
DB CR, LF
DB CR, LF, " FFFFFFFFF IIIIIII RRRRRRRRR EEEEEEEEE ! "
DB CR, LF, " FFF III RRR RRR EEE !!! "
DB CR, LF, " FFF III RRR RRR EEE !!!!!"
DB CR, LF, " FFF III RRRRRRRR EEE !!!!!"
DB CR, LF, " FFFFFFF III RRRRRRRR EEEEEEEE !!!!!"
DB CR, LF, " FFF III RRR RRR EEE !!! "
DB CR, LF, " FFF III RRR RRR EEE "
DB CR, LF, " FFF III RRR RRR EEE !!! "
DB CR, LF, " FFFFF IIIIIII RRRR RRRR EEEEEEEEE !!! "
DB CR, LF
DB CR, LF
Buffer DB BufferX * BufferY DUP (?) ; The screen buffer
Seed DW 3749h
INCLUDE PALETTE.DAT ; The palette, generated with
; Autodesk Animator, and a simple
; Pascal program.
; ===========================================================================
.CODE
InitializeMCGA PROC
MOV AX, 0A000h
MOV ES, AX ; ES now points to the VGA
MOV AH, 00H ; Set video mode
MOV AL, 13H ; Mode 13h
INT 10H ; We are now in 320x200x256
RET
InitializeMCGA ENDP
; ---------------------------------------------------------------------------
SetUpPalette PROC
MOV SI, OFFSET Palette ; SI now points to the palette
MOV CX, 768 ; Prepare for 768 OUTs
MOV DX, 03C8H ; Palette WRITE register
XOR AL, AL ; Start at color 0
CLI ; Disable interrupts
OUT DX, AL ; Send value
CLD ; Forward direction
INC DX ; Now use palette DATA register
REP OUTSB ; 768 multiple OUTs
STI ; Enable interrupts
RET
SetupPalette ENDP
; ---------------------------------------------------------------------------
; This procedure was picked up from comp.lang.asm.x86 - many thanks to the
; unknown author.
Random PROC
MOV AX, Seed ; Move the seed value into AX
MOV DX, 8405H ; Move 8405H into DX
MUL DX ; Put 8405H x Seed into DX:AX
INC AX ; Increment AX
MOV Seed, AX ; We have a new seed
RET
Random ENDP
; ---------------------------------------------------------------------------
DrawScreen PROC
MOV SI, OFFSET Buffer ; Point SI to the start of the buffer
XOR DI, DI ; Start drawing at 0, 0
MOV BX, BufferY - 4 ; Miss the last four lines from the
; buffer. These lines will not look
; fire-like at all
Row:
MOV CX, BufferX SHR 1 ; 160 WORDS
REP MOVSW ; Move them
SUB SI, 320 ; Go back to the start of the array row
MOV CX, BufferX SHR 1 ; 160 WORDS
REP MOVSW ; Move them
DEC BX ; Decrease the number of VGA rows left
JNZ Row ; Are we finished?
RET
DrawScreen ENDP
; ---------------------------------------------------------------------------
AveragePixels PROC
MOV CX, BufferX * BufferY - BufferX * 2 ; Alter all of the buffer,
; except for the first row and
; last row
MOV SI, OFFSET Buffer + 320 ; Start from the second row
Alter:
XOR AX, AX ; Zero out AX
MOV AL, DS:[SI] ; Get the value of the current pixel
ADD AL, DS:[SI+1] ; Get the value of pixel to the right
ADC AH, 0
ADD AL, DS:[SI-1] ; Get the value of pixel to the left
ADC AH, 0
ADD AL, DS:[SI+BufferX] ; Get the value of the pixel underneath
ADC AH, 0
SHR AX, 2 ; Divide the total by four
JZ NextPixel ; Is the result zero?
DEC AX ; No, so decrement it by one
NextPixel:
MOV DS:[SI-BufferX], AL ; Put the new value into the array
INC SI ; Next pixel
DEC CX ; One less to do
JNZ Alter ; Have we done them all?
RET
AveragePixels ENDP
; ---------------------------------------------------------------------------
TextMode PROC
MOV AH, 00H ; Set video mode
MOV AL, 03H ; Mode 03h
INT 10H ; Enter 80x25x16 mode
MOV DX, OFFSET AllDone ; DS:DX points to the ending message
MOV AH, 09H
INT 21H ; Display the ending message
RET
TextMode ENDP
; ---------------------------------------------------------------------------
Start:
MOV AX, @DATA
MOV DS, AX ; DS now points to the data segment.
CALL InitializeMCGA
CALL SetUpPalette
MainLoop:
CALL AveragePixels
MOV SI, OFFSET Buffer + BufferX * BufferY - BufferX SHL 1
; SI now points to the start of the second last row
MOV CX, BufferX SHL 1 ; Prepare to get BufferX x 2 random #s
BottomLine:
CALL Random ; Get a random number
MOV DS:[SI], DL ; Use only the low byte of DX - ie,
INC SI ; the number will be 0 --> 255
DEC CX ; One less pixel to do
JNZ BottomLine ; Are we done yet?
CALL DrawScreen ; Copy the buffer to the VGA
MOV AH, 01H ; Check for keypress
INT 16H ; Is a key waiting in the buffer?
JZ MainLoop ; No, keep on going
MOV AH, 00H ; Yes, so get the key
INT 16H
CALL TextMode
MOV AH, 4CH
MOV AL, 00H
INT 21H ; Return to DOS
END Start
Ok, you called my bluff, you saw an INCLUDE in there,
put this in a file called pallete.dat
; This file was generated externally by a high level language, and a
; copy of Autodesk Animator. This file is only needed by FIRE!.ASM
; during assembly, and is not required for FIRE!.EXE to run.
Palette DB 0, 0, 0, 0, 0, 6, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 8, 0, 0, 9, 0, 0, 10
DB 2, 0, 10, 4, 0, 9, 6, 0, 9, 8, 0, 8, 10, 0, 7, 12, 0, 7, 14, 0, 6, 16, 0, 5
DB 18, 0, 5, 20, 0, 4, 22, 0, 4, 24, 0, 3, 26, 0, 2, 28, 0, 2, 30, 0, 1, 32, 0, 0
DB 32, 0, 0, 33, 0, 0, 34, 0, 0, 35, 0, 0, 36, 0, 0, 36, 0, 0, 37, 0, 0, 38, 0, 0
DB 39, 0, 0, 40, 0, 0, 40, 0, 0, 41, 0, 0, 42, 0, 0, 43, 0, 0, 44, 0, 0, 45, 0, 0
DB 46, 1, 0, 47, 1, 0, 48, 2, 0, 49, 2, 0, 50, 3, 0, 51, 3, 0, 52, 4, 0, 53, 4, 0
DB 54, 5, 0, 55, 5, 0, 56, 6, 0, 57, 6, 0, 58, 7, 0, 59, 7, 0, 60, 8, 0, 61, 8, 0
DB 63, 9, 0, 63, 9, 0, 63, 10, 0, 63, 10, 0, 63, 11, 0, 63, 11, 0, 63, 12, 0, 63, 12, 0
DB 63, 13, 0, 63, 13, 0, 63, 14, 0, 63, 14, 0, 63, 15, 0, 63, 15, 0, 63, 16, 0, 63, 16, 0
DB 63, 17, 0, 63, 17, 0, 63, 18, 0, 63, 18, 0, 63, 19, 0, 63, 19, 0, 63, 20, 0, 63, 20, 0
DB 63, 21, 0, 63, 21, 0, 63, 22, 0, 63, 22, 0, 63, 23, 0, 63, 24, 0, 63, 24, 0, 63, 25, 0
DB 63, 25, 0, 63, 26, 0, 63, 26, 0, 63, 27, 0, 63, 27, 0, 63, 28, 0, 63, 28, 0, 63, 29, 0
DB 63, 29, 0, 63, 30, 0, 63, 30, 0, 63, 31, 0, 63, 31, 0, 63, 32, 0, 63, 32, 0, 63, 33, 0
DB 63, 33, 0, 63, 34, 0, 63, 34, 0, 63, 35, 0, 63, 35, 0, 63, 36, 0, 63, 36, 0, 63, 37, 0
DB 63, 38, 0, 63, 38, 0, 63, 39, 0, 63, 39, 0, 63, 40, 0, 63, 40, 0, 63, 41, 0, 63, 41, 0
DB 63, 42, 0, 63, 42, 0, 63, 43, 0, 63, 43, 0, 63, 44, 0, 63, 44, 0, 63, 45, 0, 63, 45, 0
DB 63, 46, 0, 63, 46, 0, 63, 47, 0, 63, 47, 0, 63, 48, 0, 63, 48, 0, 63, 49, 0, 63, 49, 0
DB 63, 50, 0, 63, 50, 0, 63, 51, 0, 63, 52, 0, 63, 52, 0, 63, 52, 0, 63, 52, 0, 63, 52, 0
DB 63, 53, 0, 63, 53, 0, 63, 53, 0, 63, 53, 0, 63, 54, 0, 63, 54, 0, 63, 54, 0, 63, 54, 0
DB 63, 54, 0, 63, 55, 0, 63, 55, 0, 63, 55, 0, 63, 55, 0, 63, 56, 0, 63, 56, 0, 63, 56, 0
DB 63, 56, 0, 63, 57, 0, 63, 57, 0, 63, 57, 0, 63, 57, 0, 63, 57, 0, 63, 58, 0, 63, 58, 0
DB 63, 58, 0, 63, 58, 0, 63, 59, 0, 63, 59, 0, 63, 59, 0, 63, 59, 0, 63, 60, 0, 63, 60, 0
DB 63, 61, 0, 63, 61, 0, 63, 61, 0, 63, 62, 0, 63, 62, 0, 63, 62, 0, 63, 62, 0, 63, 63, 0
DB 63, 63, 1, 63, 63, 2, 63, 63, 3, 63, 63, 4, 63, 63, 5, 63, 63, 6, 63, 63, 7, 63, 63, 8
DB 63, 63, 9, 63, 63, 10, 63, 63, 10, 63, 63, 11, 63, 63, 12, 63, 63, 13, 63, 63, 14, 63, 63, 15
DB 63, 63, 16, 63, 63, 17, 63, 63, 18, 63, 63, 19, 63, 63, 20, 63, 63, 21, 63, 63, 21, 63, 63, 22
DB 63, 63, 23, 63, 63, 24, 63, 63, 25, 63, 63, 26, 63, 63, 27, 63, 63, 28, 63, 63, 29, 63, 63, 30
DB 63, 63, 31, 63, 63, 31, 63, 63, 32, 63, 63, 33, 63, 63, 34, 63, 63, 35, 63, 63, 36, 63, 63, 37
DB 63, 63, 38, 63, 63, 39, 63, 63, 40, 63, 63, 41, 63, 63, 42, 63, 63, 42, 63, 63, 43, 63, 63, 44
DB 63, 63, 45, 63, 63, 46, 63, 63, 47, 63, 63, 48, 63, 63, 49, 63, 63, 50, 63, 63, 51, 63, 63, 52
DB 63, 63, 52, 63, 63, 53, 63, 63, 54, 63, 63, 55, 63, 63, 56, 63, 63, 57, 63, 63, 58, 63, 63, 59
DB 63, 63, 60, 63, 63, 61, 63, 63, 62, 63, 63, 63, 63, 63, 60, 63, 63, 61, 63, 63, 62, 63, 63, 63