[HN Gopher] CS/A65: A 6502 computer with USB, Ethernet and co-pr...
       ___________________________________________________________________
        
       CS/A65: A 6502 computer with USB, Ethernet and co-processors
        
       Author : amrcnimgrnt
       Score  : 92 points
       Date   : 2021-08-20 17:06 UTC (5 hours ago)
        
 (HTM) web link (www.6502.org)
 (TXT) w3m dump (www.6502.org)
        
       | glonq wrote:
       | Pros and cons of this versus Commander X16 ?
        
         | deelowe wrote:
         | X16 is going to be more for folks who want something that just
         | works and they can play around with in software
         | 
         | Projects like this are more for folks who are looking to build
         | their own computers from scratch. Typically, this is for
         | someone who's more into hardware.
         | 
         | Personally, I enjoy both. I have probably 6 or so kit computers
         | at this point. FWIW, the two that I've enjoyed the most are Ben
         | Eater's breadboard 6502 project and the nand2tetris series
         | which is all done in software.
        
         | wvenable wrote:
         | This is a home built hobby project, if you want one you're
         | going to have to source the parts yourself, create the PCBs,
         | and build it. And it will mostly be one of a kind. It's a fun
         | project if that's what you're into. I'm building a 6502
         | computer much less involved than this one.
         | 
         | The Commander X16 will be more of completed commercial project
         | where the appeal is more using the computer to write software
         | than building the computer itself.
        
       | PostThisTooFast wrote:
       | Sounds like the Atari 8-bits (except for the Ethernet).
       | 
       | Oh, except the Atari peripheral port was actually better than
       | USB; Atari peripherals could be daisy-chained.
        
       | skyde wrote:
       | Noob her! why use a 6502 versus another 8bit cpu like Atmel AVR?
       | Is there any advantage? Does it consume less electricity while
       | running at similar speed ?
        
         | tyingq wrote:
         | The Atmel has a modified harvard architecture, so it's easier
         | to use as a microcontroller than to run an OS on. Where there
         | are lots of available OSes for 6502, Z80, etc.
        
         | retrac wrote:
         | Sentimentality. The 6502 has been around for almost half a
         | century now. Often the processor in an older programmer's first
         | computer or video game system. It's horribly limited, but
         | assembly programming for the 6502 has become a kind of code
         | golf.
        
         | klodolph wrote:
         | I'll step in and say that the Atmel AVR is damn awesome
         | processor, it's just that it's hooked up to on-chip peripherals
         | and the address/data bus is completely internal. This means
         | that if you want to connect something to an Atmel AVR, it will
         | likely be over some serial protocol, like SPI, I2C, or UART.
         | 
         | This is what you want, like, 99.9% of the time.
         | 
         | The 6502 just puts its address and data bus on pins, and you
         | can make the memory map for your computer however you want, as
         | long as you are willing to wire up the logic. There's no
         | privilege for on-chip resources... everything is off-chip and
         | completely equal. With the AVR, the resources (RAM, flash,
         | peripherals) are completely fixed but much, much faster. There
         | are a ton of chips you can buy with SPI / I2C interfaces if you
         | want the AVR to do something interesting, and you drive them
         | with the on-chip peripherals. The on-chip peripherals get to
         | sit in memory somewhere, but the external ICs don't. With the
         | 6502, you put things in memory somewhere, figure out a way to
         | decode addresses on the bus, and use a parallel interface for
         | everything.
        
         | anyfoo wrote:
         | One thing that might or might not matter, depending on why you
         | are doing the project, is that a 6502-based computer is less
         | opaque.
         | 
         | A 6502 is a CPU in the "traditional sense". It has limited
         | internal state in the form of a few registers, and communicates
         | with the outside world with address lines and data lines; I
         | only simplified a little there. Everything else is external:
         | RAM, ROM, any external devices on a different bus (I2C etc.),
         | even timers and GPIO need external circuitry with usually other
         | ICs.
         | 
         | An AVR on the other hand tends to have all of that stuff (or at
         | least a sizable subset) built in. That's, obviously, enormously
         | convenient, and often means that with the AVR itself and just
         | minimal external circuitry you have your needs covered. But
         | it's less educational, you've rather plugged a computer into
         | your circuit than built a computer.
        
         | vidarh wrote:
         | Nostalgia and/or familiarity.
         | 
         | Lots of us grew up with 6502 based machines.
        
         | schemescape wrote:
         | I'm not 100% confident about the dates, but my understanding is
         | that the author's project started in 1989, before AVRs were
         | developed (1996).
        
         | wvenable wrote:
         | More fun/interesting and more potential to be actual computer.
         | 
         | Probably the main advantage of a 6502 is more RAM/EEPROM (as
         | 8bit microcontrollers are pretty limited that way) and more of
         | a hardware/software ecosystem to work with.
        
         | the-dude wrote:
         | I assume memory lanes.
        
           | z-nexx wrote:
           | And address lanes. Don't forget the ALU, etc.
        
       | cdcarter wrote:
       | Always love to see a 6502 post here on HN. It's a really unique
       | processor compared to other 8-bit processors at the time. With
       | only one general purpose register, and memory mapped IO, the 6502
       | offers a ton of "addressing modes" to solve problems that the
       | 8080 would solve with register transfers.
       | 
       | Ben Eater (http://beneater.net/) makes a neat video series and
       | accompanying product kit where you build a 6502 on a breadboard,
       | if you're looking for something a little more approachable than
       | this (very cool) project!
        
         | spicybright wrote:
         | A while back I tried writing an Atari 2600 game and got about
         | half way (got sprites, collisions, level, just no goal)
         | 
         | The console uses a slightly cheaper version, the 6507 I think.
         | Same chip, just smaller address line and no interrupts (!)
         | 
         | Instead you ran a "wait for the cathode ray to reach the right
         | side of the screen" in order to time everything correctly.
         | 
         | Very fascinating stuff, I recommend anyone interested in the
         | above dive in and give it a shot.
         | 
         | All you need is an editor[1] (I found one online!) and the
         | stella manual[2].
         | 
         | There's something nice about having the entire machine spec in
         | one book instead of leaning on stack overflow...
         | 
         | [1]
         | https://8bitworkshop.com/v3.8.0/?platform=vcs&file=examples%...
         | 
         | [2] https://cdn.hackaday.io/files/1646277043401568/stella.pdf
        
         | hota_mazi wrote:
         | As much as I love the 6502, I have to say the 8080 has some
         | very neat features that I wish I had with 6502, such as
         | conditional returns (in other words, do a RTS only if a certain
         | flag is set or not).
        
           | earthbee wrote:
           | What significant advantage does that have over a conditional
           | branch followed by an RTS?
        
             | anyfoo wrote:
             | Code density, and you could potentially save a few cycles
             | with a single instruction. Whether that matters at all
             | depends on how much slack you have in your utilization of
             | available memory and CPU cycles. (Strictly talking about
             | "old" CPUs here.)
             | 
             | It's worth noting that the 8086 got rid of conditional
             | returns, you only have unconditional ones there.
        
               | earthbee wrote:
               | A taken branch on the 6502 takes 3 cycles. A not taken
               | branch followed by a Return From Subroutine instruction
               | takes 2 + 6 cycles.
               | 
               | Looking up the conditional return instructions on the
               | 8080 seems to show it takes 5 cycles when false and 11
               | when true.
               | 
               | So the two 6502 instructions add up to being two or three
               | cycles faster than one 8080 conditional return.
        
               | anyfoo wrote:
               | I was not trying to compare the 6502 with the 8080 here,
               | and I said "potentially" exactly because it depends on
               | the architecture wether it works out (and, as said,
               | 8088/8086 removed the conditional returns). On the 8080
               | specifically, conditional returns seem to be a little
               | cheaper overall.
        
               | jonsen wrote:
               | It's only fair to compare cycle numbers if you also
               | compare cycle times.
        
               | klodolph wrote:
               | Cycle counts are super misleading. These processors were
               | limited by the speed of RAM, and cycles per RAM access
               | differed. Suppose you have RAM running at 1 MHz... maybe
               | your 6502 is also clocked at 1 MHz, and your 8080 is
               | clocked at 4 MHz. I know you're not trying to compare
               | 6502 performance to 8080 performance in general, just
               | that there's a fairly wide variation in how much you can
               | accomplish in a cycle, and "how many RAM accesses can the
               | processor make" is probably what you want to look for,
               | since it's a bit more directly comparable across
               | processors of that era.
        
         | royjacobs wrote:
         | It's a really fun architecture, agreed. I spent the last few
         | months writing an assembler, formatter and language server for
         | 6502 code. If you're interested, it's available at
         | https://mos.datatra.sh
        
       | amrcnimgrnt wrote:
       | Andre Fachat also wrote a pre-emptive multitasking kernel for the
       | 6502:
       | 
       | http://www.6502.org/users/andre/osa/oa1.html
       | 
       | This is basically the same CPU as in the NES.
        
         | abdulhaq wrote:
         | It feels weird to me that some hackers don't know what a 6502
         | is! Sign of my age I guess.
        
           | mdp2021 wrote:
           | Days ago a user who declared to be a Google employee wrote
           | that many of his colleagues have no idea what RSS is. (No,
           | sign of the times.)
        
         | the-dude wrote:
         | And in the BBC B, Electron and Commodore 64.
        
           | salamandersauce wrote:
           | And Apple II and Atari 2600 and 8 bit computers.
        
             | [deleted]
        
       ___________________________________________________________________
       (page generated 2021-08-20 23:00 UTC)