🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.programmer
1 messages
1 total messages Started by RAMontante Thu, 16 Aug 1990 02:10
Re: Programming the keyboard port
#1033
Author: RAMontante
Date: Thu, 16 Aug 1990 02:10
28 lines
1853 bytes
Excerpted from:  / TOMIII@MTUS5.BITNET (Thomas Dwyer III) /
|   The Status Register (Port 064H)
|     The Status register is an 8-bit read-only register. [text omitted]
|   Command Register (Port 064H)
|     The command register is an 8-bit write-only register, addressed at I/O
|     port 064H. [text omitted]
| Ok people, how can the same port be both read-only and write-only?  Am
| I missing something?  


In this context, the command register is "write-only" in the sense that,
if you write some command word to it, you cannot find out what command
word you wrote by attempting to read it back --- if you try, you will
instead get the contents of the status register.  Similarly, you cannot
change the status by writing to the status register.

For example, in assembly language (or an HLL for that matter), it might
seem natural to clear some status indicators by AND'ing the appropriate
bits of the status register with 0.  This will fail miserably, as the
status register is read-only.  You must instead write the appropriate
command or commands to the command register (which happens to be at the
same address).  The appropriate command will not, in general, look like
the AND of the current status with any intuitive mask value.

It might be clearer if each register had a unique address.  But once you're
used to this stuff, the overloading of an address is not confusing, and
in old small architectures the address space was small enough that it
seemed worthwhile to reuse addresses in this manner.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads