63

The cursor used on my 486 (and Pentium 3) in MS-DOS 6/7 has a thick underlined character. I cannot find that in code page 437. The underscore character is the closest to it, but is thinner.

Where does this cursor character come from? Or did I miss something?

113

The text-mode cursor isn’t a character, it’s managed separately by the video output circuitry (which is how it keeps blinking even when your computer is busy or locked up). It can be enabled or disabled, and its size can be determined — at least, its start and end scanlines, which determine its height; the cursor always occupies the full width of a character cell. That way you can have the simple cursor beneath your text, the half-cell cursor typically used for insert mode, a full-cell cursor, etc. Even a cursor above your text if you want! On EGA, and many VGA clones, you can also have a split cursor: if the end line is above the start line, you end up with a two-part cursor with lines at the top (down to the end line) and at the bottom (from the start line).

The OSDev Wiki has more information on the topic, including pointers to the BIOS functions you can use, and code to directly manipulate the VGA registers (the cursor is also available on MDA, Hercules, CGA and EGA obviously). FreeVGA is also relevant (amongst many other resources on the topic).

Emulating IBM PC Cursors illustrates the various effects and provides an in-browser emulator running PC Magazine’s CTYPE so you can try different settings directly. (Thanks to Michael Kjörling for the suggestion!)

  • 12
    As I recall, if you specify the top to be lower than the bottom, you can even have a cursor in two parts. – David Richerby Jan 31 '18 at 23:43
  • 3
    @David, yes, pre-VGA — IIRC EGA produces a split block cursor (perhaps CGA too). VGA just disables the cursor if the top is lower than the bottom. The CGA and EGA behaviour doesn’t seem to be handled by the emulators I’ve tried so far, and I don’t have a real CGA or EGA close by, so I can’t check... – Stephen Kitt Feb 1 '18 at 8:15
  • For a second I thought you meant that the cursor could be programmed to be any width, which I had never seen in the specs. Can you clarify the "nearly" in "the cursor (nearly) always occupies the full width of a character cel"? It would be conceivable to implement hardware like that; but double-checking the documentation around confirms that the cursor hardware is linked to the character generator (or in any case, dependent on the character width). Pity, because it would have made a modern vertical line cursor possible. – Euro Micelli Feb 3 '18 at 15:34
  • @Euro that’s mostly me hedging my bets, because ISTR at least one graphics adapter where setting the top lower than the bottom produced a half-width, split cursor, looking like ▀▄ (in a single cell obviously). – Stephen Kitt Feb 3 '18 at 17:24
  • @Euro but to clarify, the cursor isn’t supposed to occupy anything other than the full width of the character cell. – Stephen Kitt Feb 3 '18 at 22:22
52

The cursor on the CGA, MDA, EGA, and VGA cards was a hardware sprite generated on the earlier cards by the 6845 video controller, and on later cards by a chip that emulates the 6845. That chip has an address counter that is used to fetch data from memory, as well as a line counter and a cursor-state latch. It also has a programmable registers for cursor address, cursor start line, cursor end line, and blink pattern.

Every time the display controller advances to line N of a character row, it compares N against the cursor-start and cursor-end registers. If it matches the former, it sets the cursor-state latch; if it matches the latter, it clears the latch. At all other times, the latch keeps its state. If the cursor is programmed to be active in rows 10-13 of each character, this signal will be active while drawing rows 10-13 of every character line.

Any time this latch is set, the value in an internal 5-bit frame counter matches the requirements of the blink pattern, and the display is fetching data from the programmed cursor address, the 6845 chip will output a "cursor" signal. The CGA and MDA will then filter this signal with a redundant (worse than useless) blink circuit. Whenever the filtered signal is high, the CGA or MDA will ignore the bit pattern of the character being displayed and unconditionally display the foreground color. The cursor has no effect upon anything stored in memory, and because of the CGA's redundant blink circuit there's not even any way for software to tell whether it's visible at any moment in time.

-1

Its been a very long time since I used MSDOS but on most video cards it flashed, that is it put down a _for several refresh cycles of the video page, and then a dim rectangle ▒ for several refresh cycles. so it looked like the character block was flashing on and off. This could actually be changed. As I recall you had to put lines in config.sys or Autoexec.bat.

I remember one mod people did was change to a little smiley face rather than the rectangle, like this ☺ but a square rather than round smiley.

You could use any character in the ascii dingbats see image(Note square smiley is second character.) and link bellow for wikipeidia.

enter image description here

https://en.wikipedia.org/wiki/Code_page_437

Note it was latter MSDOS versions(I think 3.0+.) that added ascii dingbats.

  • 6
    Welcome to Retrocomputing! What you describe might be possible with a TSR (but it would be very hard to get right), it certainly wasn’t the default behaviour; there was no standard way of using ▒ or a smiley as the cursor character. – Stephen Kitt Feb 3 '18 at 9:47
  • 2
    What you call ASCII dingbats have been in place since the original IBM-DOS 1.0. The character bitmaps were stored in ROM, so they were not even a DOS thing. It wasn't until maybe DOS 3.3 that DOS became "aware" of character bitmaps and added support to change them, to provide better international language support (look up codepages and the CHCP command). Maybe that's what you were thinking of? I don't know whether the original IBM PC 5150's MDA and/or CGA hardware supported changing the character bitmaps, or whether that required newer/different hardware. – Euro Micelli Feb 4 '18 at 1:35
  • Stephen Kitt What I describe was the cursor on every video card I had while running MSDOS starting from a 8088 to a 80485 from a hercules graphics card, to a CGA, to an EGA, to a VGA, and on an early S3 graphics coprossesor, after that MSDOS was gone and it was on to Win95. The only card that only had a blinking _ as the cursor was a IBM monochrome card they were text only. I started on CPM with a blinking _ from on board graphics with Z80. CPM 86 on a PC was a _for several refresh cycles of the video page, and then a dim rectangle ▒ looking like it blinked too. – DEH Feb 4 '18 at 5:16
  • Now the BIOS prompt was just the _ flashing on all the cards as I remember. – DEH Feb 4 '18 at 5:17
  • Anyway it was a very long time ago, so who knows I mite be brain dead. – DEH Feb 4 '18 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.