However, in a symbolic assembler that conforms to the MOS Technology/WDC standard—which standard has existed for some 38 years and was derived from the MC6800 assembler, instructions that can act on either the accumulator or memory are required to have an operand so the assembler can differentiate between the two addressing modes. Hence, ROL A is unambiguously understood as rotate the accumulator, whereas ASL $0A clearly means that it is the content of $000A that is to be rotated. The assembler prohibits the definition of A as a symbol.
First steps...
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: First steps...
barrym95838 wrote:
BigDumbDinosaur wrote:
... There is a reason why A is used to represent the accumulator in instructions that can act on the accumulator or memory, but it seems that relatively few folks understand it. Call me a gruff old curmudgeon, but I am not much of a fan of assemblers that significantly deviate from the MOS Technology/WDC formal syntax. In my opinion, there's no good reason for doing so.
However, in a symbolic assembler that conforms to the MOS Technology/WDC standard—which standard has existed for some 38 years and was derived from the MC6800 assembler, instructions that can act on either the accumulator or memory are required to have an operand so the assembler can differentiate between the two addressing modes. Hence, ROL A is unambiguously understood as rotate the accumulator, whereas ASL $0A clearly means that it is the content of $000A that is to be rotated. The assembler prohibits the definition of A as a symbol.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: First steps...
cr1901 wrote:
The other mnemonics are less useful to me, but I can understand why they exist... who typically refers to the accumulator- in either mode- as "C" (although that is technically correct)?
It's important to understand that the .B accumulator doesn't go away when the m bit in the status register is set. Also, if the x bit is clear but m is set and a TAX or TAY is executed, .B gets copied to the MSB despite the accumulator being 8 bits wide.
Use whatever helps you remember, but keep in mind that if you publish your code others may not necessarily understand your thinking.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: First steps...
Dr Jefyll wrote:
BigDumbDinosaur wrote:
the NXP 28C94 quad UART I'm going to use in POC V2 has the ability to identify why it is interrupting by placing a bitwise code on the data bus when commanded to do so.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: First steps...
Now I'm getting somewhere... I have about half a schematic complete for R1, and I'll probably upload a flowchart tonight.
R1 will run on an 8-bit ISA perfboard card, which gives me access to power without needing to create a power supply, as well as a host environment I am familiar with to upload programs to RAM. The 65816 will run an EPROM monitor which polls for input/output from the PC, but can also use the on-card serial port to talk to the outside world. Serial port is interrupt-driven and will override ISA host commands. It'll be used mainly used for querying status of R1 from the '816's point-of-view, as well as file xfer in ROM monitor mode, and "free for use" otherwise. R1 will (tentatively) contain 8kB of EPROM and 16kB of SRAM. R1 can communicate using the serial port for a small terminal on an external host, or via 5 registers on the computer with the ISA card (BASE can be whatever is free in the PC map). I've modified the address space based on suggestions from the Primer and BDD to minimize the amount of address-decoding logic.
From the PC, the IO map is as follows:
I feel this should be a simple and fun project that bridges my enjoyment for programming the '816 and the ISA bus. Since I'll keep the '816 in Native Mode even without > 64kB of RAM, for slow systems like the XT, the '816 becomes a vastly superior coprocessor
. For faster systems, R1 just becomes a unique expansion, interface, and development (EID?
) environment/card.
I haven't fully decided the schematic output, but one thing that will influence my decision: Can ONE port of the PIA be used as a simple bidirectional bus arbiter using the handshake signals- for instance, attaching the 65816 to the ISA bus. In all cases, the x86 PC takes priority in case of conflict with the 5 I/O registers. I'd like to minimize on external latches and use the PIA to its full potential.
R1 will run on an 8-bit ISA perfboard card, which gives me access to power without needing to create a power supply, as well as a host environment I am familiar with to upload programs to RAM. The 65816 will run an EPROM monitor which polls for input/output from the PC, but can also use the on-card serial port to talk to the outside world. Serial port is interrupt-driven and will override ISA host commands. It'll be used mainly used for querying status of R1 from the '816's point-of-view, as well as file xfer in ROM monitor mode, and "free for use" otherwise. R1 will (tentatively) contain 8kB of EPROM and 16kB of SRAM. R1 can communicate using the serial port for a small terminal on an external host, or via 5 registers on the computer with the ISA card (BASE can be whatever is free in the PC map). I've modified the address space based on suggestions from the Primer and BDD to minimize the amount of address-decoding logic.
From the PC, the IO map is as follows:
- BASE Data In (Write)/Data Out (Read) (Host ISA PC uses port-mapped I/O to talk to R1)
- BASE+1 Command (Write)/Command Status (Read) (Host ISA PC send command to processor while running ROM monitor/poll routine)
- BASE+2 Control Register (controls a latch whose bits propagate to enable/disable various circuitry on the board- such as the clock/RDY (The latter is probably more kosher), debug IRQ, single step, and ROM monitor vs RAM program mode.)
- Clock circuit (use the Primer? I have a 10MHz 4 pin crystal FWIW)
- Reset circuit (Probably needs to be OR'ed with the ISA reset pin)
- Single step circuit (will be enabled using a bit on the control register)
- Bus arbitration circuit (see below)
- Wait state circuit for ROM (this is the tough one- any help here to minimize glue logic is greatly appreciated).
- Minimal logic ROM/RA switcher (in RAM mode, the vectors need to be stored in RAM in case they are altered)
I feel this should be a simple and fun project that bridges my enjoyment for programming the '816 and the ISA bus. Since I'll keep the '816 in Native Mode even without > 64kB of RAM, for slow systems like the XT, the '816 becomes a vastly superior coprocessor
I haven't fully decided the schematic output, but one thing that will influence my decision: Can ONE port of the PIA be used as a simple bidirectional bus arbiter using the handshake signals- for instance, attaching the 65816 to the ISA bus. In all cases, the x86 PC takes priority in case of conflict with the 5 I/O registers. I'd like to minimize on external latches and use the PIA to its full potential.
Re: First steps...
cr1901 wrote:
I haven't fully decided the schematic output, but one thing that will influence my decision: Can ONE port of the PIA be used as a simple bidirectional bus arbiter using the handshake signals- for instance, attaching the 65816 to the ISA bus. In all cases, the x86 PC takes priority in case of conflict with the 5 I/O registers. I'd like to minimize on external latches and use the PIA to its full potential.
There's pretty much a guarantee that the ISA bus clock and the clock I use to drive the '816 will be out of phase. If I use the handshaking signals of the PIA to hold the current value being input to one port from the ISA bus, and to arbitrate when to output-enable a TTL buffer attached to the other port (output mode) of the PIA, that resolves some synchronization issues. Idk if it can be done, but I think it's worth a shot.
Since I don't think the PIA's output port can be Z-stated, I still need a 3-state TTL buffer to "block" the PIA's output from reaching the bidirectional ISA data bus. Nevertheless, it does save me glue logic if this can be done.
Re: First steps...
Quote:
Since I don't think the PIA's output port can be Z-stated, I still need a 3-state TTL buffer to "block" the PIA's output from reaching the bidirectional ISA data bus.
The PIA port can be put in the input state, which is high-impedance and won't interfere with the ISA. Unfortunately to do so requires the '816 to write $00 to the Data Direction Register (DDR), and a software command is not appropriate. What you want is for the port to either drive or go high-Z according to a hardware signal, such as from a IO decoder supplied with the ISA address.
A good chip to consider for this sort of job is the 74hc646 registered transceiver. This could tie the IAS and '816 buses together without need for the PIA.
-- Jeff
- Attachments
-
- 74HC_HCT646_CNV.pdf
- (88.21 KiB) Downloaded 89 times
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: First steps...
If I'm perfectly honest, I'm just looking for a way to use the PIA's handshaking mode- since I bought two by accident, I might as well use them to their full potential.
The 3-state buffer TTL on the PIA's output is what will prevent the PIA's output from driving the ISA bus. I just want to use the PIA's handshake signals to ensure the ISA bus is happy with the xfer in case the PIA needs more time to react (add wait states to the ISA bus for 14MHz and above machines).
From the POV of the IBM PC that houses the ISA card, the PIA is the destination/source of the IN and OUT instructions. It is how the IBM PC communicates with the card, transferring data back and forth. This saves me some TTL logic, and lets me put the PIA to good use.
The 3-state buffer TTL on the PIA's output is what will prevent the PIA's output from driving the ISA bus. I just want to use the PIA's handshake signals to ensure the ISA bus is happy with the xfer in case the PIA needs more time to react (add wait states to the ISA bus for 14MHz and above machines).
From the POV of the IBM PC that houses the ISA card, the PIA is the destination/source of the IN and OUT instructions. It is how the IBM PC communicates with the card, transferring data back and forth. This saves me some TTL logic, and lets me put the PIA to good use.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: First steps...
Dr Jefyll wrote:
A good chip to consider for this sort of job is the 74hc646 registered transceiver. This could tie the IAS and '816 buses together without need for the PIA.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: First steps...
BigDumbDinosaur wrote:
You'd also have to think about how you would handle IRQs from the ISA bus.
I can get away with the following signals: A0-A9, D0-D7, AEN (Distinguish DMA from CPU access), IOW (x86 port IO write) and IOR (x86 port IO read). I may also use the 14.3MHz Oscillator (OSC) that the ISA bus provides by convention as the clock for the card (or maybe halve it for now).
Re: First steps...
BigDumbDinosaur wrote:
The VPB output could actually be used in several ways. As discussed, its intended purpose is to let external hardware know that the 65C816 is loading the program counter with the relevant interrupt vector. Sufficiently sophisticated logic could alter the apparent vector according to the source of the interrupt. As noted, a priority encoder would be necessary to determine which vector should be loaded. Discrete priority encoders tend to be slow devices (they have a lot of gates), so a CPLD or FPGA would be better suited to the task. Implementation of vectored interrupts could produce a big payoff in performance.
Re: First steps...
Part I
I'm reading the primer, and I realize: there is no way I can get around wired-OR output. I'm willing to suffer the consequences of this, but is there any way to reliably use Wired-OR in a 10MHz+ system? I have an ACIA IRQ, PIA IRQAB/IRQBB, and VIA IRQ (series Schottky diode) in my design.
Part II
I think I still have my heart set on using the PIA as the ISA bus controller even if requires external components.
The CPU responds to all writes from the ISA bus. Port A is used storing data that comes from the ISA bus. Assuming the active transition is set appropriately, CA1 is attached directly to the AND of address-decoding logic output for the ISA bus and the IOW control signal from the ISA bus.
I.e. if the x86 IO port matches and it's an IOWrite, CA1 will be asserted via active transition, and the PIA will inform the microprocessor that data is about to be latched into a 8-bit latch that feeds into Port A. One problem with this is that the CPU reading the latch from the PIA might happen before the output from the latch is valid, but after the data has been clocked in (tCO- clock-to-output time on datasheets).
EDIT: Ignore following paragraph. I can just use NOPs to delay the read until tCO has passed if necessary.
I could alternatively skip this latch, and have CA2 feed into the IOCHRDY to the ISA bus, which lengthens I/O cycles, but the CPU would have to read data from the PIA very fast (2.5 microseconds) for this to work. I suppose I could pre-empt the IRQ and use WAI while the CPU is not doing anything using one of Garth's tricks, and ignore PIA interrupts if the serial console is in use or a program is running in RAM, etc.
I haven't given much thought to writes yet (though I have ideas). At this point, the ISA bus is simply a one way communications channel with the PC to send data to R1. Other than polling, there isn't currently a way for R1 to initiate a data xfer with the IBM PC, and I don't want to give R1 an IRQ. I may bring out CA2 and CB2 to an external latch and have the IBM PC poll the I/O port until CA2 is deasserted (CPU is not reading ISA bus) and CB2 has been asserted (response available from CPU to ISA bus).
I'm reading the primer, and I realize: there is no way I can get around wired-OR output. I'm willing to suffer the consequences of this, but is there any way to reliably use Wired-OR in a 10MHz+ system? I have an ACIA IRQ, PIA IRQAB/IRQBB, and VIA IRQ (series Schottky diode) in my design.
Part II
I think I still have my heart set on using the PIA as the ISA bus controller even if requires external components.
The CPU responds to all writes from the ISA bus. Port A is used storing data that comes from the ISA bus. Assuming the active transition is set appropriately, CA1 is attached directly to the AND of address-decoding logic output for the ISA bus and the IOW control signal from the ISA bus.
I.e. if the x86 IO port matches and it's an IOWrite, CA1 will be asserted via active transition, and the PIA will inform the microprocessor that data is about to be latched into a 8-bit latch that feeds into Port A. One problem with this is that the CPU reading the latch from the PIA might happen before the output from the latch is valid, but after the data has been clocked in (tCO- clock-to-output time on datasheets).
EDIT: Ignore following paragraph. I can just use NOPs to delay the read until tCO has passed if necessary.
I could alternatively skip this latch, and have CA2 feed into the IOCHRDY to the ISA bus, which lengthens I/O cycles, but the CPU would have to read data from the PIA very fast (2.5 microseconds) for this to work. I suppose I could pre-empt the IRQ and use WAI while the CPU is not doing anything using one of Garth's tricks, and ignore PIA interrupts if the serial console is in use or a program is running in RAM, etc.
I haven't given much thought to writes yet (though I have ideas). At this point, the ISA bus is simply a one way communications channel with the PC to send data to R1. Other than polling, there isn't currently a way for R1 to initiate a data xfer with the IBM PC, and I don't want to give R1 an IRQ. I may bring out CA2 and CB2 to an external latch and have the IBM PC poll the I/O port until CA2 is deasserted (CPU is not reading ISA bus) and CB2 has been asserted (response available from CPU to ISA bus).
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: First steps...
cr1901 wrote:
Part I
I'm reading the primer, and I realize: there is no way I can get around wired-OR output. I'm willing to suffer the consequences of this, but is there any way to reliably use Wired-OR in a 10MHz+ system? I have an ACIA IRQ, PIA IRQAB/IRQBB, and VIA IRQ (series Schottky diode) in my design.
I'm reading the primer, and I realize: there is no way I can get around wired-OR output. I'm willing to suffer the consequences of this, but is there any way to reliably use Wired-OR in a 10MHz+ system? I have an ACIA IRQ, PIA IRQAB/IRQBB, and VIA IRQ (series Schottky diode) in my design.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: First steps...
cr1901 wrote:
I'm reading the primer, and I realize: there is no way I can get around wired-OR output. I'm willing to suffer the consequences of this, but is there any way to reliably use Wired-OR in a 10MHz+ system? I have an ACIA IRQ, PIA IRQAB/IRQBB, and VIA IRQ (series Schottky diode) in my design.
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: First steps...
Quote:
quad 2-input OR gate or similar would work, would it?
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: First steps...
GARTHWILSON wrote:
I hope I don't embarrass myself by answering while missing something since I'm not re-reading six pages of this topic to remind myself of where we were.
GARTHWILSON wrote:
If the AND gate is not a possibility so you have to do the wire-ORs on the IRQ\ line, just make sure you have plenty of time in your ISRs between when you turn off the interrupt in the ACIA or PIA or VIA and when you hit the RTI, for the IRQ\ line to float up.
Using a Schmitt Trigger comes to mind as a potential workaround; it will stay low for a small portion of the IRQ line floating back up, but enough time to detect that the IRQ line IS in fact floating back up to "No interrupt" levels.
*Well, I should write a spurious IRQ handlers anyway, but that's tangential.