14

What is the address of character table in DOS where we can create new fonts and symbols by manipulating the pixels of the each character?

I know to change it with BIOS interrupts, but I only need the memory address of the character table in dos for direct access.

Prof. Falken
  • 22,327
  • 18
  • 94
  • 163
user776475
  • 141
  • 4
  • 7
    Hmm, I couldn't find the close reason for "Asked 20 years too late" – Cody Gray May 30 '11 at 15:54
  • 4
    This has nothing to do with DOS but with the VGA hardware. Search for "vga character generator" or similar and you will probably find information. If I remember correctly it might require port IO rather than memory-mapped IO. – R.. GitHub STOP HELPING ICE May 30 '11 at 18:13
  • One very important question: is this in normal text-mode or is it in `AX=13h` mode (i.e. the 320x200 graphics mode with 256 colors) ? – DarkDust May 30 '11 at 20:33
  • 2
    How is this "not a real question"? – Jens Björnhager Jul 22 '11 at 22:31
  • 5
    Voted to reopen. It may be about "obsolete" technology but it's clearly about a programming problem. – DarkDust Jul 23 '11 at 08:23
  • 2
    Can we reopen this question? It's pretty silly that I 100% understand the question, came here from a google search where I was trying to find the answer to this question AND there is a well researched ANSWER. – boxed Nov 10 '19 at 07:39

2 Answers2

7

I can't remember how it was done any more (I did this stuff two decades ago), but you might want to look at the FreeVGA project. According to the text mode documentation you can select the address yourself (kinda; see the Character Map Select Register). Accessing that register is explained here.

You might also want to look at this presentation which deals with this topic as well (and is probably easier to comprehend).

Edit: Here's a post that explains how to replace a single character. He uses int 10h, ax=1100h (alternative documentation) to exchange a character, but in the CX register you can actually tell how many characters should be exchanged. Here's a very comprehensive list of int 10h functions.

Edit 2: Found another nice documentation.

Edit 3: In the last linked documentation, there's this:

Programming for Direct Access to Character Generator RAM

The following sequence sets up the EGA and VGA for accessing character- generator memory. See EGA I/O Ports for related information.

out 3c4H, 0402H   Mask reg; enable write to map 2
out 3c4H, 0704H   Memory Mode reg ; alpha, ext mem, non-interleaved
out 3ceH, 0005H   Graphics Mode reg; non-interleaved access
out 3ceH, 0406H   Graphics Misc reg; map char gen RAM to a000:0
out 3ceH, 0204H   Graphics ReadMapSelect reg; enable read chargen RAM

After these OUTs, the font data begins at a000:0 and the first byte of font data for a character begins at the character's ASCII value * 32. After reading or writing the font data, the following sequence restores the EGA/VGA to normal operations:

out 3c4H, 0302H   Mask reg; disable write to map 2
out 3c4H, 0304H   Memory Mode reg; alpha, ext mem, interleaved
out 3ceH, 1005H   Graphics Mode reg; interleaved access
out 3ceH, 0e06H   Graphics Misc reg; regen buffer to b800:0
out 3ceH, 0004H   Graphics ReadMapSelect reg; disable read chargen RAM
DarkDust
  • 85,893
  • 19
  • 180
  • 214
1

If I remember correctly and the graphic cards didn't change too much (I played with that the last time more than 15 years ago), the font information isn't at a given memory address, it is loaded on the graphic card memory.

AProgrammer
  • 48,232
  • 8
  • 83
  • 139