• Please review our updated Terms and Rules here

I wonder if part of why EGA had write only registers...

yuhong

Experienced Member
Joined
Mar 2, 2010
Messages
367
is to save a few transistors, which would have been pretty important in 1983.
 
Heck, I wonder how the write only registers on the original Hercules card were implemented.
 
A "write only" register on a board made out of discrete logic was usually just a latch like a 74LS373, which are inherently unidirectional devices. (Input goes in one set of wires, the saved state comes out of another set.) It's a lot more work to make an addressable latch that can be read back; basically you'll need to add a second copy of the latch, or a buffer that's connected to the output side to loop the state back in... etc. When thinking in terms of ASICs figure either way it'll about double the transistor count for the registers. Which may or may not be a huge deal depending on the vintage and how many registers the thing has.
 
I think it may be because the EGA was designed by a committee of disparate hardware groups that hated each other ;-)
 
One interesting thing I found out about other early video cards; the ALT256 and the ALT512, once you had placed data into the memory on the ALT256, you could not get it out again, there was no facility to read it out other than the serializing to create the composite video signal for the VDU. So if you created some image on the fly, say that from a Light Pen, the only way to save it as a file was to write duplicate data to main memory.

On the other hand, their second board, the ALT512, you could read the video memory back out. The Alt 512 also had two video plains that you could use to make a 4 shade grey scale.

I guess it could have been a matter of cost in this case too, but I think in the ALT256, they simply didn't think that someone would have wanted to port the data in another direction.
 
Most of the EGA registers live on one of the 5 custom LSI chips (save the External registers which are named quite literally, and are indeed some type of 74). IBM designed these chips themselves (unless they contracted it out...), so my conclusion is that they just hated us.

Only the CRTC chip even has an IOR line at all, so you can read those critical light pen latch registers. /s

It's possible it was due to cost or some other limitation that improved by the time the VGA was designed, where suddenly we can read everything. Consolidating the LSI logic probably made it easier, too as you didn't have to run 4 more IOR lines all over the board.
 
The PGC was readable. Did any software read from the PGC? If no one reads from the video card, write only registers would make the design that much easier. VGA reads were rather complex.

I envision some IBMer being upset that developers can't work out what they want from hardware before the hardware gets built.
 
Most of the EGA registers live on one of the 5 custom LSI chips (save the External registers which are named quite literally, and are indeed some type of 74). IBM designed these chips themselves (unless they contracted it out...), so my conclusion is that they just hated us.

Only the CRTC chip even has an IOR line at all, so you can read those critical light pen latch registers. /s

It's possible it was due to cost or some other limitation that improved by the time the VGA was designed, where suddenly we can read everything. Consolidating the LSI logic probably made it easier, too as you didn't have to run 4 more IOR lines all over the board.
Keep in mind that DIP chips were still common as well, so there is also the problems of the limited number of pins.
 
Keep in mind that DIP chips were still common as well, so there is also the problems of the limited number of pins.

That's a good point, these chips are pushing their DIP40 packages. I'm not an EE, so I couldn't tell you if the Sequencer chip needs two grounds, but if we wanted to read the map mask register, we'd have to sacrifice one.
 
The SOP with read-only registers is generally you assign a location in RAM that you update whenever your write the register, so if later you need to, say, flip a single bit in it, you can read the current state from said memory location and OR based on that. There really isn't a compelling case for readable configuration registers unless you're stuck trying to reverse engineer something a program that impolitely didn't update the RAM copy did.
 
The SOP with read-only registers is generally you assign a location in RAM that you update whenever your write the register, so if later you need to, say, flip a single bit in it, you can read the current state from said memory location and OR based on that. There really isn't a compelling case for readable configuration registers unless you're stuck trying to reverse engineer something a program that impolitely didn't update the RAM copy did.
That's all well and good until you get to task switching, and have to somehow deal gracefully with the potential mischief caused by code that isn't yours. Not impossible to deal with, but juggling saved video states and trapping port accesses probably didn't improve blood pressure among developers.

While VGA fixed most of this, it still retained the nonsense with the attribute controller, where the same port is used for both index and data regs, depending on the (unreadable) state of a flip-flop. See also this blog post, which I imagine is where the OP is coming from: https://www.os2museum.com/wp/learn-...part-x-the-vga-attribute-controller-is-weird/
 
  • Like
Reactions: cjs
The Windows VxD traps the I/Os to hold the state of the registers. It also remaps some of the frame buffer memory for DOS apps that access the EGA. Clever software for dumb hardware.
 
That's all well and good until you get to task switching, and have to somehow deal gracefully with the potential mischief caused by code that isn't yours. Not impossible to deal with, but juggling saved video states and trapping port accesses probably didn't improve blood pressure among developers.

Yeah, that's where it kind of breaks down; ideally everyone's a good boy and uses a documented OS call to touch hardware registers, but that's certainly not how DOS programs generally rolled.
 
Only the CRTC chip even has an IOR line at all, so you can read those critical light pen latch registers. /s

The "cursor address high" register is at least useful for hardware detection. For a 6845-based card, only the low 6 bits will be writable, and all 8 for EGA/VGA (of course, DOSBox and probably other emulators don't implement this!)

Yeah, that's where it kind of breaks down; ideally everyone's a good boy and uses a documented OS call to touch hardware registers, but that's certainly not how DOS programs generally rolled.

You simply couldn't write a graphical game (or any kind of interactive program) without direct access to the registers, because there was no DOS/BIOS interface that provided the functionality needed for that. No BitBlt etc., only an extremely slow function to get or set individual pixels.
 
There are lots of peripheral chips where the read function doesn't correspond to the write function. The designers probably didn't think that reading back what was written was necessary. I can see the reasoning--if the programmer wrote a value, surely it's known what was written. Why include circuitry to parrot it back?
 
There are lots of peripheral chips where the read function doesn't correspond to the write function. The designers probably didn't think that reading back what was written was necessary. I can see the reasoning--if the programmer wrote a value, surely it's known what was written. Why include circuitry to parrot it back?
Diagnostics, for one. I can see skipping read back of registers for super simple hardware, but I'd always want to be able to interrogate the state of the hardware for something as complex as a graphics video card.
 
Back
Top