How does the 8080 know which "Sense Switches" are enabled?

General discussions related to the Altair 8800 Clone

How does the 8080 know which "Sense Switches" are enabled?

Postby johnnystarr » February 22nd, 2019, 6:14 pm

Can someone explain exactly how the Altair 8800 "Sense Switches" are wired to the 8080 from an I/O perspective? From what I know, there are 256 I/O "ports", and certain values are linked to the (2)SIO ports and such. Authors of software like BASIC were somehow able to tell which values were selected to allow selection of serial cards & terminals. From a programming point of view, since no "examine" happens, the PC remains at 0 (or wherever the ORG location is). These pins would normally affect the address bus when performing an "examine" or "deposit" action.

The only alternative I can think of is if the sense-switches are tied to the bidirectional data-bus and these values are read using IN/OUT instructions.
johnnystarr
 
Posts: 5
Joined: February 12th, 2019, 7:41 pm

Re: How does the 8080 know which "Sense Switches" are enable

Postby TronDD » February 24th, 2019, 1:10 am

johnnystarr wrote:The only alternative I can think of is if the sense-switches are tied to the bidirectional data-bus and these values are read using IN/OUT instructions.


Yes.

The Altair 8800 Theory of Operation manual has the schematic. You'll see that address switches A0 - A7 are tied to the data bus D0 - D7 for deposits but switches A8 - A15 are also tied to the data bus lines D0 - D7. The sense switches also include the same circuit any other IO card would have that checks for an INPUT signal and reads 8 bits of the address bus (that's why there can only be 256 IO devices) for its IO address and puts the switch values onto the data bus.

A few things to note.
IN and OUT commands are special. They override the normal mode of the address bus and the peripherals in the system. An IN or OUT is a read or write just like a normal memory read or write which would use the address bus and data lines. Excepet when it's IN/OUT, memory knows to ignore the address and data lines. IO devices will read the address bus and check if it has their address on it and only read the data bus and act if so. When the IN or OUT instruction completes, the CPU returns the system to normal memory IO.

"Examine" and "deposit" are human actions through the front panel (or a monitor ROM). They use normal CPU memory IO like a program would but "examine" and "deposit" are not program commands. While "examine" moves the program counter to the address a specified on the switches as well as read from that address in memory, a program reading from an address in memory does not have the program counter set to that address. The program counter just increments as instructions are executed. So when a program reads the sense switches, it's executing code and the program counter will increment.
TronDD
 
Posts: 11
Joined: November 20th, 2018, 8:51 pm

Re: How does the 8080 know which "Sense Switches" are enable

Postby johnnystarr » February 25th, 2019, 8:10 pm

TronDD wrote:The Altair 8800 Theory of Operation manual has the schematic. You'll see that address switches A0 - A7 are tied to the data bus D0 - D7 for deposits but switches A8 - A15 are also tied to the data bus lines D0 - D7.


Do you know which instruction would be able to read A8 - A15 when tied to D0 - D7? Or would someone be able to provide a reference to an assembly language routine that does this? Thanks!
johnnystarr
 
Posts: 5
Joined: February 12th, 2019, 7:41 pm

Re: How does the 8080 know which "Sense Switches" are enable

Postby TronDD » February 25th, 2019, 9:05 pm

IN is the instruction. The sense switches are at IO address 377 in octal or FF in hex.

Lots of examples in the Altair clone downloads. Kill bits, for example, and boot loader ROMs.
http://altairclone.com/downloads/front_ ... LLBITS.PRN
http://altairclone.com/downloads/roms/MBL.PRN


Download the support material and read...a lot:
http://altairclone.com/downloads/support_package/
TronDD
 
Posts: 11
Joined: November 20th, 2018, 8:51 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron