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 bread…
CS/A65: A 6502 computer with USB, Ethernet and co-processors
21–30 of 50 posts
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#22Always 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 bread…
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).
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#23Noob 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 ?
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.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#24Andre 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.
It feels weird to me that some hackers don't know what a 6502 is! Sign of my age I guess.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#25Earlier quoted context omitted.
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).
What significant advantage does that have over a conditional branch followed by an RTS?
It's worth noting that the 8086 got rid of conditional returns, you only have unconditional ones there.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#26Earlier quoted context omitted.
What significant advantage does that have over a conditional branch followed by an RTS?
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.
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.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#27Earlier quoted context omitted.
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.
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.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#28Earlier quoted context omitted.
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.
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.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#29Oh, except the Atari peripheral port was actually better than USB; Atari peripherals could be daisy-chained.
Re: CS/A65: A 6502 computer with USB, Ethernet and co-processors
#30Earlier quoted context omitted.
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.
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.