If you use the large or huge memory models (-ml or -mh options on the command line, or under Options -> Compiler -> Code generation), then all pointers will be of far* type automatically, meaning you can do things directly like:
Code: Select all
unsigned char *screen = (unsigned char*)0xB8000000;
It's useful if you intend to do a lot of code this way. It saves having to explicity use the far keyword on pointers and the alternate functions _fmemcpy() and friends for manipulating data in far memory, thus making the code more portable to the 32 or 64-bit flat models. (Only thing that will need to change is the address.)
It's not as efficient in real mode, since in the generated assembly far pointers seem to reload a segment register for nearly every access, but the difference will not be noticeable on any remotely modern hardware.