/* 
PVIDEO2.C -- protected mode program to poke video display memory 
            1 million times using selector 001Ch
*/ 
 
#include <stdlib.h> 
#include <stdio.h> 
#include <dos.h>
#include <pharlap.h>
 
#define MAX 1000000L
 
int main()
{ 
    FARPTR pVid;
    FARPTR fp;
    long i; 

//
// Construct a FAR pointer to video memory using selector 001Ch, which
// TNT DOS-Extender maintains and updates automatically when the video
// mode is changed.
//
    FP_SET(pVid, 0, SS_SCREEN);

 //
 // Poke video memory MAX times
 //
    for (i=MAX; i--; ) 
    {
	FP_SET(fp, FP_OFF(pVid) + (i%2000)*2, FP_SEL(pVid));
	PokeFarWord(fp, (USHORT)i);
    }

    return 0; 
} 
