| Click here to select a new forum. |
| How do soft-switches work? |
Posted by: Dog Cow on 2009-02-26 14:40:14 Here's a question for which I have not found the answer:
The Apple II, as you should know, has some soft-switches, memory locations which cause some setting to change. My question is: how does this work? How is it that using an AppleSoft line such as PEEK manages to change the switch? Is there something in the Monitor that does this?
|
Posted by: david__schmidt on 2009-02-26 14:57:57 Soft switches have a hardware component: there is circuitry that reacts to particular address lines being tickled. That's why things like peek can affect them from BASIC.
|
Posted by: Dog Cow on 2009-02-26 17:43:22 Do you know what hardware this is? I only have a IIgs, so I suppose that is incorporated in the Mega II, but what about on the older models?
|
Posted by: david__schmidt on 2009-02-26 18:50:52 A handful of 74LS* chips. Sather's "Understanding the Apple II" would probably help here:
http://www.scribd.com/doc/201423/Understanding-the-Apple-II-by-Jim-Sather-1983Quality-Software
|
Posted by: II2II on 2009-02-26 19:48:08 Most people have a nasty tendency to think that memory is something where you specify a memory location, the CPU applies that memory location to the address lines, then the CPU reads the results from the data lines. (Or you specify the memory location and some data, then the CPU applies the memory location to the address lines and the data to the data lines, leaving the RAM to make the data part of its state.) That is a very CPU-centric view of the world. It is also totally incorrect.
Once the address is on the address lines, the external circuitry can do whatever it wants with those electrical impulses. Usually it heads over to RAM, like it is supposed to. But it is also possible to have it do something else. It is easy enough to build a circuit that detects a certain address, then sends an electrical impulse to another part of the circuitry when that happens. If it needs to maintain state, it may go to a flip-flop. In that case, it could totally ignore the data lines and do it's work based upon what happens on the address lines.
I'm fairly certain that would be considered very bad form in this day in age, but it does tend to simplify things.
(When you look at digital electronics, it's possible to do all sorts of weird things. For example, ROMs can do many forms of computation that don't require you to save state.)
|
Posted by: Dog Cow on 2009-02-27 09:59:41
A handful of 74LS* chips. Sather's "Understanding the Apple II" would probably help here:http://www.scribd.com/doc/201423/Understanding-the-Apple-II-by-Jim-Sather-1983Quality-Software I downloaded that PDF a few months ago but haven't read it yet. Maybe I should do that. 😛
|
Posted by: david__schmidt on 2009-02-27 10:12:56
I downloaded that PDF a few months ago but haven't read it yet. Maybe I should do that. 😛 It's a tough slog, especially if it's the first time through. But Sather lays bare all the secrets of Woz's wonder machine. Some of the hardware later than the ][ and ][+ emulate or replicate the behavior of the earlier machines in LSI chips; but the first ones have it all laid out in discrete logic.
|
Posted by: porter on 2009-02-27 11:44:07
Here's a question for which I have not found the answer:
The Apple II, as you should know, has some soft-switches, memory locations which cause some setting to change. My question is: how does this work? Computers have CPU, memory and IO (input output)
Some CPUs, like Intel family, Z80 etc have different address space for IO devices. Others like Motorola CPUs, 6502 family etc have what is called memory mapped IO, where IO ports appear in the same address space as normal memory.
|
| 1 |