Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!nbires!hao!gaia!zhahai From: zhahai@gaia.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: changing character sets Message-ID: <288@gaia.UUCP> Date: Tue, 24-Feb-87 03:11:49 EST Article-I.D.: gaia.288 Posted: Tue Feb 24 03:11:49 1987 Date-Received: Fri, 27-Feb-87 05:42:33 EST References: <1303@erix.UUCP> Reply-To: zhahai@gaia.UUCP (Zhahai Stewart) Distribution: world Organization: Gaia Corp., Boulder, CO Lines: 76 In article <1303@erix.UUCP> joe@erix.UUCP (Joe Armstrong) writes: >What I want to do: > Dynamically (i.e. not at boot time) Change the system character >sets to my own character sets - at any time I'd like to be able to poke a >new character definition into the machine. > >A few simple questions: > 1) Are the characters sets in RAM > 2) If so at what address > 3) How are the characters packed > 4) If I change the RAM character set (I assume it is in RAM) > can I use bios calls to output the characters or what? > Joe Armstrong By character set, I assume that you mean the screen representation of characters, rather than the "meaning" associate with a particular byte value (which would require changing all the software on the system, if you wanted EBCDIC for example). First, there are many different video boards avaliable for the IBM PC and compatibles. The most popular and widely used and emulated ones from IBM are the Monochrome Display (and Printer) Adapter, the Color Graphics Adapter, and the Enhanced Graphics Adapter - MDPA, CGA, and EGA. The dot representation of characters is fixed on ROMs in the MDPA and would be hard to change thereby - unless you got a clone with sockets ROMS and could create compatible EPROMS... but this is not dynamic. The CGA has several "modes" of display, some of which are "character modes" and some "graphic modes", ie: bit mapped graphics ("All Points Addressable" in IBMese). With the character modes you are in the same fix as with the MDPA. With the graphic modes however, the dot representations are "drawn" on the screen by software in the ROM BIOS code (Int 0x10). Using the ROM BIOS, the patterns for characters 0x00-0x7F are taken from the ROM BIOS (ie: software or firmware ROM, readable by the CPU). To change these, you would have to replace the ROM BIOS software with some code in RAM which intercepts calls to Int 10 before it gets to the ROM BIOS - this would be dynamic as you seek. For characters 0x80-0xFF the ROM BIOS does not store the patterns - if you want them you HAVE to define them yourself (remember, this is in graphic modes only). This is described in the IBM PC Tech Ref Manual, for example. If you have a CGA or compatible, use software which always goes thru the ROM BIOS (rather than writing to the screen directly), can afford the slowdown of the graphic mode characters (which take longer to display and scroll), then this might be the route for you. If you only need a few special character (which can be mapped to hi-bit-set character, 80-FF) this will be especially easy. If you have a "Monochrome Graphics Controller", such as made by Hercules and their imitators, the situation is similar except you will definitely need to write your own software, since the ROM BIOS doesnt know at all how to draw characters in that graphics mode. Finally, the good news: The EGA allows redefinition of the dot patterns for each character for both graphic and character modes. This is very often compatible with software which expects a CGA or MDPA in character mode (graphic modes are somewhat less perfectly compatible). This means that with an EGA or clone, your software can "load" new dot patterns which are used for all character display, and is invisible to most software. So if you want to change the # to a British pound, your editor may not even be aware of the substitution. The details of this are beyond my scope tonight, but PC Tech Journal has described the calls needed. Please note that all you are changing is the screen display: if you redefine $ to be a-umlaut, dont expect your software to consider it a "letter" now - it will still treat it exactly as a $ (perhaps a better example would be redefining the comma display - it may now show as a European letter on the screen, but you can't use it inside an identifier...). That type of "semantic" redefinition is totally unprovided for on the IBM PC. Also note that you will need still other tricks to make your printer display the "redefined" characters as you wish - there is not sharing of info between them. I hope this helps. The technical details are beyond my limits tonight for typing, and you may or may not want them anyway. Perhaps someone else will explain them further or give better references - this overview may help put such details into perspective. Good luck! ~z~ -- Zhahai Stewart {hao | nbires}!gaia!zhahai