Listing 4

#include <stdlib.h>
#include <stdio.h>
main()
    {
    FILE *fp;
    char far *hga_buff;
    unsigned bytes_written;
    hga_buff = (char far *) 0xB0000000L;
    if ( fp = fopen("screen.pic", "wb") == NULL )
        {
        puts("Error opening file."};
        exit(1);
        }
    bytes_written = fwrite(hga_buff,1,32767,fp);
    printf("%u bytes written to file.\n",bytes_written);
    }

/* End of File */