[comp.sys.ibm.pc.misc] Programming the keyboard port

TOMIII@MTUS5.BITNET (Thomas Dwyer III) (08/14/90)

According to my "Z-386/AT Series Workstation Technical Reference
Manual, Volume II Programmable Registers" book, page 17-2 it says:

  The Status Register (Port 064H)

  The Status register is an 8-bit read-only register. [text ommited]


Now on page 17-3 it says:

  Command Register (Port 064H)

  The command register is an 8-bit write-only register, addressed at I/O
  port 064H. [text ommited]


Ok people, how can the same port be both read-only and write-only?  Am
I missing something?  Am I correct in thinking that if I write a SCP
command (page 17-5) to port 064H than I can read the results of the
command from port 060H?  My tests show that any value written to port
064H followed by a read of port 060H results in a 01CH being read.

Any help on this would be most appreciated.

Thanks,
Thomas Dwyer III                            TOMIII   @ MTUS5.BITNET
Network Programmer                          DWYERIII @ MTUS5.BITNET
Computing Technology Services
Michigan Technological University

foss@iris.ucdavis.edu (Jim Alves-Foss) (08/16/90)

In article <90226.104110TOMIII@MTUS5.BITNET> TOMIII@MTUS5.BITNET (Thomas Dwyer III) writes:
>...
>Ok people, how can the same port be both read-only and write-only?  Am
>I missing something? 
>...
>Thanks,
>Thomas Dwyer III                            TOMIII   @ MTUS5.BITNET
>Network Programmer                          DWYERIII @ MTUS5.BITNET
>Computing Technology Services
>Michigan Technological University

Well, In the PC architecture we have 512 (not 256) ports. 256 are Input ports
and 256 are Output ports. Often a card will have a R/W register with a
single address. In your case you have TWO DISTINCT registers, one input
and one output but with the same address (064H(In) and 064H(Out)).

Hope this helps.

-Jim Alves-Foss (foss@iris.ucdavis.edu)  /* Of course these are MY opinions */
                (foss@[127.120.57.20])   /* and may change without warning. */

fzsitvay@techbook.com (Frank Zsitvay) (08/18/90)

In article <90226.104110TOMIII@MTUS5.BITNET> TOMIII@MTUS5.BITNET (Thomas Dwyer III) writes:
>According to my "Z-386/AT Series Workstation Technical Reference
>Manual, Volume II Programmable Registers" book, page 17-2 it says:
>
>  The Status Register (Port 064H)
>
>  The Status register is an 8-bit read-only register. [text ommited]
>
>
>Now on page 17-3 it says:
>
>  Command Register (Port 064H)
>
>  The command register is an 8-bit write-only register, addressed at I/O
>  port 064H. [text ommited]
>
>
>Ok people, how can the same port be both read-only and write-only?  Am

   When you write to port 064H you write to the command register.  When
you read from 064H, you read the status register, not the contents of
the command register.

   zilog has been confusing programmers with this for years...



-- 
fzsitvay@techbook.COM - one of these days i'll get it right...

Version 2 of anything is usually the version that works.