Author Topic: 6502 Cpu wanted  (Read 6025 times)

0 Members and 1 Guest are viewing this topic.

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
6502 Cpu wanted
« on: February 14, 2017, 04:41:40 PM »
hi everyone,

Im studying engineering at uni and while I've been learning to code on MCU's I've developed quite an interest in older 8-bit computers. however I can't seem to find any local (aus) suppliers of 6502 cpu's and related peripheral chips. i usually do a lot of my shopping through element14 but they don't stock these parts so i was wondering if anyone knew of a supplier that sells theses at a fair price or perhaps if anyone had any old chips laying around that they would part with?
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1849
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #1 on: February 14, 2017, 05:36:32 PM »
eBay doesn't look too expensive:

http://cgi.ebay.com/170828631732

Just don't buy this one  ;)

http://cgi.ebay.com/192041375586
So Long, and Thanks for All the Fish
 


Offline borjam

  • Supporter
  • ****
  • Posts: 512
  • Country: es
  • EA2EKH
Re: 6502 Cpu wanted
« Reply #3 on: February 14, 2017, 06:58:04 PM »
Turns out Jameco Electronics still has them in stock!

http://www.jameco.com/z/6502-Major-Brands-MPU-R6500-CISC-8-Bit-1MHz-40-Pin-CDIP_43191.html

They seem to stock other vintage offerings like Z80, 6809... No M68000 though!
« Last Edit: February 14, 2017, 06:59:49 PM by borjam »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 5897
Re: 6502 Cpu wanted
« Reply #4 on: February 14, 2017, 07:09:30 PM »
The W65C02 is still in production, and is stocked by Mouser.   
 
Normally I'd go off on a long spiel about the best way to design a retro CPU board with modern glue chips, with a USB interface for loading code and control, so you don't have to suffer the traditional EPROM based build - burn - crash development cycle, but Hackaday have reviewed the Western Design Center's development boards with 65C02 and related cores and it turns out WDC have already done all the hard work for you.  See http://hackaday.com/2015/07/29/review-single-board-65c02-and-65c816-computers/.  Not cheap mind you, but by the time you've added up the cost of a N.O.S. 6502 CPU, 6520 PIA, 6522 VIA, and stuck them on a board with RAM, FLASH, glue logic and a FTDI USB <> parallel chip that can emulate a COM port for host communications, you'll be up to a significant proportion of the WDC boards price.    Then you have a long hard road ahead of you porting a 6502 monitor ROM to your board.   On time factor alone it would be cheaper to wash car windows, do odd-job or flip burgers to pay for one of the WDC boards rather than attempting to roll your own.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1849
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #5 on: February 14, 2017, 07:13:41 PM »
Another idea is to buy a C64 or 1541 floppy on eBay, and then desolder any chips on it. C64 is better, because you get the CPU (6510, but it is the same as a 6502, except for an additional 8 bit GPIO), two 6522 VIAs, the SID sound chip and the VIC graphics chip, and you can sell the rest like the PLA or the DRAM, if you don't need it. Of course, don't buy a working C64, would be a sacrilege, you can get broken ones for cheap. Usually the RAM or PLA is broken, so chances are high that the CPU still works.
So Long, and Thanks for All the Fish
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #6 on: February 14, 2017, 07:16:48 PM »
Turns out Jameco Electronics still has them in stock!

http://www.jameco.com/z/6502-Major-Brands-MPU-R6500-CISC-8-Bit-1MHz-40-Pin-CDIP_43191.html

They seem to stock other vintage offerings like Z80, 6809... No M68000 though!

Looking back with 35 years hindsight, it's amazing how similar in concept the 6809 is to the x86. Same number of registers, just arranged differently. A couple of secondary opcode pages. Very similar ModR/M byte.

It felt much nicer to use at the time though. A couple of friends and I designed/built our own wire-wrapped board using one, wrote simple OS and compiler...
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1322
  • Country: gb
Re: 6502 Cpu wanted
« Reply #7 on: February 15, 2017, 05:38:58 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

The assembler is embedded in the BBC Basic which makes it quite easy to use and powerful (you can use the BASIC for macros and conditional assembly and so on).

I did have a BBC Master in my attic which I bought ages ago for £50 but I had to get rid of it when I moved house recently.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #8 on: February 15, 2017, 06:06:21 AM »
There's the T65 and several other 6502 softcores you can use on an inexpensive FPGA. You get all the support chips "for free" that way too. I've got a 6502 system running on a $13 FPGA board.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3121
  • Country: gb
  • Will design for cookies
Re: 6502 Cpu wanted
« Reply #9 on: February 15, 2017, 06:41:07 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

^^^ This!

Either a model B or a Master 128 will do, and make sure you also pick up a copy of the Advanced User Guide which describes the built-in assembler in detail, as well as the other hardware. There really is no better way to make a 6502 accessible.

If you want to build something, don't waste time actually wiring up a 6502 from scratch. Get the BBC machine and build something to plug into one of its various expansion ports, which are easy to use and will readily connect to modern hardware.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #10 on: February 15, 2017, 07:44:26 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: us
Re: 6502 Cpu wanted
« Reply #11 on: February 15, 2017, 07:48:45 AM »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #12 on: February 15, 2017, 08:04:03 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.

I like working with the retro stuff. It really makes you appreciate how far we've come in some areas. It also makes one appreciate just how capable some of the old hardware was, despite its simplicity. It amazes me what people have squeezed out of the humble 6502.
 

Offline jpb

  • Super Contributor
  • ***
  • Posts: 1322
  • Country: gb
Re: 6502 Cpu wanted
« Reply #13 on: February 15, 2017, 08:22:41 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
The ARM chip was based on the 6502. The 6502 has a nice simple instruction set and I think the designers of ARM (from Acorn) designed ARM along the same lines but with 32 bit registers and a barrel shifter and a few other goodies. The 6502 is definitely nicer to program than say the 8086 family.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3121
  • Country: gb
  • Will design for cookies
Re: 6502 Cpu wanted
« Reply #14 on: February 15, 2017, 08:54:02 AM »
The ARM instruction set was new from the ground up, and there's really no similarity between it and 6502.

Examples: ARM2 has a set of 16 registers, of which 13 are completely general purpose, and conditional execution for every opcode. The 6502 has A, X and Y, all of which are 8 bit only. The only conditional operations are short range relative jumps, and indirect operators work differently depending on whether X or Y is the index.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #15 on: February 15, 2017, 08:55:16 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.

I like working with the retro stuff. It really makes you appreciate how far we've come in some areas. It also makes one appreciate just how capable some of the old hardware was, despite its simplicity. It amazes me what people have squeezed out of the humble 6502.

Trust me, I remember how far we've come!!!

6502 just takes SO MUCH CODE to do anything. And you don't have that much memory to put it in.

Ok, so you use zero page as registers. A lot of registers. Now add two variables in zero page together. If they're 8 bit then that's four instructions, seven bytes of code, eleven clock cycles. If they're 16 bit then it's seven instructions, thirteen bytes of code, twenty clock cycles. For 32 bit it's thirteen instructions, twenty five bytes of code, thirty eight clock cycles.

8 bit AVR has 32 registers. You add two registers with one instruction, two bytes, one clock cycle. If you need 16 bit then it's two instructions, four bytes, two clock cycles. For 32 bit it's four instruction, eight bytes, four clock cycles. More than three times less code and about ten times fewer clock cycles. Same with Thumb or RISC-V, except they handle 32 bit variables with a single two-byte one clock cycle instruction (Thumb is a bit lacking in registers, but RISC-V isn't).

Don't even talk about trying to manage a C/Pascal style stack! The only sane thing to do is go to a bytecode interpreter or threaded code, which adds yet more slowness. At least if you didn't need recursion zero page is big enough that you could probably allocate every function in your program its own little argument/scratch area (and even overlay areas for functions that couldn't call each other).

I appreciate how far we've come. Really. I don't need to re-live it :-)

On the other hand -- let's make a 6502 back end for LLVM!!!
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #16 on: February 15, 2017, 09:19:53 AM »
If you just want to do 6502 assembler it might be worth picking up an old BBC model B micro if there are any locally.

I see there are real masochists here :-) I've done more than enough 6502 asm in my time. Painful. They were cheap and that was the best thing about them. The 6809 was massively more pleasant to program. But the modern AVR beats both hands-down. And are super cheap *today*.

I'm also really enjoying programming the RISC-V in my "HIFive1" Arduino clone in asm. Very straightforward and easy to learn -- even more than ARMs.
The ARM chip was based on the 6502. The 6502 has a nice simple instruction set and I think the designers of ARM (from Acorn) designed ARM along the same lines but with 32 bit registers and a barrel shifter and a few other goodies.

Just a few other goodies :-)

Quick! What does this simple ARM instruction (valid from the first Archimedes PCs) do?

LDMIAEQ SP!, {R4-R7,PC}

Well! It loads five registers from memory. It adds 20 to the stack pointer register. One of the registers is the PC, so it's a branch instruction -- probably a function return. Oh, and it does all that only if the Z condition code flag is set. It's a conditional return from a function.

Very RISC!

What I find really scary is that IA part .. Increment After .. is only one of four options you could put there: also Increment Before, Decrement Before, or Decrement After. And you could use any register as the base register, not only the stack pointer.

I love ARM, really I do. It's better than x86. But it's far from simple!

The 6502 is definitely nicer to program than say the 8086 family.

Better than 8080, for sure. Better than 8086. probably not. Worse than i386 or x86_64 for sure.

ARM is nicer to program than any x86.

It turns out the worst thing about the 8086 family is actually Intel's documentation, mnemonics, and assembler format. And the hideous complexity of implementing it to go fast.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #17 on: February 15, 2017, 04:41:49 PM »
thanks everyone for all the info and pointers to where to buy/acquire a 6502 cpu. the idea of getting a bbc micro sounds interesting unfortunately being in Australia i dont think I'm likely to find one to buy, and if i did it would probably cost a pretty penny down under.

sorry if my reply is kind of short, I've come down with a bad flu but i do really appreciate all the help and ill probably do an order with mouser
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #18 on: February 15, 2017, 08:28:59 PM »
thanks everyone for all the info and pointers to where to buy/acquire a 6502 cpu. the idea of getting a bbc micro sounds interesting unfortunately being in Australia i dont think I'm likely to find one to buy, and if i did it would probably cost a pretty penny down under.

sorry if my reply is kind of short, I've come down with a bad flu but i do really appreciate all the help and ill probably do an order with mouser

Not Aussie, but here's three C64s for sale for $50 in NZ.

http://www.trademe.co.nz/computers/vintage/auction-1261470379.htm

BBCs were never common in NZ and Aus, but there should be any number of C64, C128, Atari 400/800 around in closets, and quite a lot of Apple's too. Some of these were made rigth from the late 70s until the early 90s.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #19 on: February 15, 2017, 08:42:19 PM »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser
 

Offline Moshly

  • Regular Contributor
  • *
  • Posts: 101
  • Country: au
  • What's wrong with this thing
Re: 6502 Cpu wanted
« Reply #20 on: February 15, 2017, 08:46:30 PM »
Or download WinVICE http://vice-emu.sourceforge.net/ & emulate most commodore 8bit's (all 6502)

Get yourself a cross development IDE here http://6502.org/tools/asm/
Now you don't even need a legacy system.

There are emulators for every just about any 6502 based system, some even have monitors & cross dev stuff built in.

If you do want to get an old system, choose something that someone has made an SD or USB interface for. The main problem you will have is getting data in & out of it.

Another thing to note is that not all 6502 CPU's have the same instruction set.
The CMOS version has more instructions and fixed some bugs.
The Rockwell version has some added bit instructions. (not compatible with the CMOS version)
There are also some other variants, the 16bit 65c816 (when in 6502 8bit mode) uses the CMOS set.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #21 on: February 15, 2017, 08:48:32 PM »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser

Go any relatives? If you ask around you can probably find one for free. If they haven't been tossed...
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #22 on: February 15, 2017, 08:51:48 PM »
mmm, not really interested in WinVICE as emulation isn't on much interest to me. i basically just want to get a 65C02 and interface it with RAM/ ROM and PIA/VIA chips and write some code to see how things where done before microchips suck as the PIC and AVR changed everything with integration

as for relatives, well none have any old 8 bit systems, I've certainly asked around :)
 

Offline Moshly

  • Regular Contributor
  • *
  • Posts: 101
  • Country: au
  • What's wrong with this thing
Re: 6502 Cpu wanted
« Reply #23 on: February 15, 2017, 10:05:48 PM »
Ok, cool, jumping straight in at the deep end  :-+

Some good books on the subject ->
http://www.bombjack.org/commodore/books-generic.htm
Scroll down to programming section and check out the Rodnay Zaks titles & the MOS hardware & software manuals. Lots of other good stuff too.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 1849
  • Country: de
    • Frank Buss
Re: 6502 Cpu wanted
« Reply #24 on: February 15, 2017, 11:06:30 PM »
unfortunately at least as far as i can find, any apple II's, Commodore 64/128 etc or other similar era hardware are just to expensive to buy, everything i find on eBay is $150 upwards and being a university student its the old issue of lack of funds. unless anyone knows something i dont about where to get old systems in Australia or wants to donate one then i think i'll have to buy some new chips from mouser

Interesting, ebay.com.au has nearly no C64 auctions (if you search for C64). In ebay.de there are lots of them. But you could order the individual chips. I don't know the seller, but this auction is still online:

http://cgi.ebay.com/170828631732

US $2.54 for a 6502, and free shipping doesn't look to expensive. But it is in China, if I order it from Germany usually needs 4 weeks or more delivery time. But I have good experience with it, once I ordered a lot of MC6850 UART chips for my Kerberos cartridge from China and they all worked with no problems. Very useful chip, if you want to implement a serial port on your system. You can get them, too, for cheap on Australia eBay, again from China. It's crazy, cost with free shipping is less than the shipping cost alone would be if I would send you one:

http://cgi.ebay.com.au/191964446415

But I couldn't find a cheap 6522 VIA.

For the RAM and ROM, I would just use modern parts. See e.g. my Kerberos cartridges (schematic in my github project page for it). It provides 128 kB RAM extension and 2 MB flash memory, besides the MIDI ports. I used a CY62128EV30 SRAM chip. You can tie A15 and A16 to GND and then you'll have 32 kB RAM for your system for less than 2 bucks (you can get it from Mouser and Digikey). You'll might need some logic gates, too, for decoding the addresses and chip select. Note that you need some voltage level translators as well, like the 74LVC8T245, because the RAM operates with 3.3V. I guess there are cheap 5V SRAM chips out there as well.

For the second 32 kB you can use a flash, like on my catridge. But this is available with 5V supply voltage as well, e.g. SST39SF010A. So for a start, you could just use a 6502 and a flash, then program a blinking light by toggling A15, or something more fancy like an 8 bit digital output with a 74373 and related trigger logic. If you use the outputs of this chip, you could even implement bank switching. It's all too easy these days, no need to use complicated DRAM chips.

For flashing the flash, I used my C64 in combination with the CPLD (and for fun built a programmer with a Raspberry Pi), but it works with a TL866CS, too, a universal programmer that Dave tested once:. Relatively  cheap on ebay: http://cgi.ebay.com.au/191736125106 Very useful device, can read old EPROMs and ROMs, too.

If you don't have already many gates for testing on a breadboard, maybe design a circuit first (which is the most fun part anyway, at least for me), then you'll know what you need to buy.
So Long, and Thanks for All the Fish
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: us
Re: 6502 Cpu wanted
« Reply #25 on: February 15, 2017, 11:27:50 PM »
The whole retro computing in an in thing now so everyone is buying them and the prices are high.   I've only had any decent luck just finding old stuff local (craigslist, etc) but even the the prices are much higher than they used to be.

You may just have to eat the shipping cost from Jameco or one of WDC's distributors.

I tried to do a proxy once a few years ago and add a few parts to one of my orders then forward to someone in another country but there are so many laws and regulations just to walk into the post office before you even try to ship anything, shipping anything is a complete mess now a days.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #26 on: February 16, 2017, 08:21:40 AM »
That happens with everything though, everybody throws most of it away, so the stuff that's left is harder to find and commands higher prices. It's too bad there isn't a computer graveyard in a warehouse out in the desert somewhere cheap like the graveyard for old aircraft. A lot of cool old stuff could have been saved for future generations to play with.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: us
Re: 6502 Cpu wanted
« Reply #27 on: February 16, 2017, 08:35:42 AM »
I hate that about the whole e-waste thing too.  people bring their old computers and they get sent to china and scrapped.  Some people don't know the value of a commodore or amiga and they end up there or in trash.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #28 on: February 16, 2017, 03:08:29 PM »
im not to sure what goes on here in Australia, we do have some recycling centres in some cities for e-waste but as it costs money most people seem to just throw electronics out in the trash (bad practice i know).

i always tell my friends and family to send all there stuff my way first so i can salvage anything of use such as motors, IC's (not common chips but unique or hard to get ones) and so forth but I've yet to come across any vintage electronics from my small network of family and friends...
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #29 on: February 16, 2017, 04:22:53 PM »
Do you have Craigslist or something like it there? Thrift stores? Maybe you can find a group or club of vintage computer enthusiasts? That's a great way to network with people who may have extra stuff available. Most 6502 systems are now old enough that they are either long gone and buried or they are in someone's collection.
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #30 on: February 16, 2017, 05:00:14 PM »
there is gumtree thats similar to crags list but i never see anything good on there vintage electronics wise. While it would be amazing to get an old 8 bit system and start learning what can be done with it, unless someone has one to donate i think that ill end up just wording some new chips or mouser when i have a bit of spare cash for another shopping spree

on a side note, i just wanted to thank everyone for all the help and suggestions, I've been a member for awhile now but rarely post anything however its been great knowing that this forum is so helpful to myself any others when we get stuck
« Last Edit: February 16, 2017, 05:02:14 PM by Chopsticks »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #31 on: February 16, 2017, 07:53:29 PM »
Well there's certainly fun to be had in building your own. You might be interested in this:

http://searle.hostei.com/grant/6502/Simple6502.html
 

Offline Chopsticks

  • Regular Contributor
  • *
  • Posts: 64
  • Country: au
Re: 6502 Cpu wanted
« Reply #32 on: February 17, 2017, 01:20:20 PM »
I bookmarked that link a couple days ago, between that and Quinn's Veronica computer project there's a good deal of useful information I'll be able to cobble together :)
 There's also a couple other 8 bit minimal chip designs on that site for the z80 if memory serves correct
 

Offline TNOBLE8888

  • Newbie
  • Posts: 3
  • Country: us
Re: 6502 Cpu wanted
« Reply #33 on: July 27, 2017, 11:59:05 AM »
Hey there, I have a virgin 6502 and a couple 6522 (I/O ports), if still looking.
 Thom
A lifetime of electronics prototyping, hacking hardware and integrating with a system-of-systems engineering perspective.
 

Offline tiger99

  • Contributor
  • Posts: 8
  • Country: gb
Re: 6502 Cpu wanted
« Reply #34 on: August 08, 2017, 09:31:15 AM »
It was noticeable at the time that 6502 based computers seemed to be consistently slightly faster than those based on the Z80. I suspect that the small instruction set forced better programming techniques, or maybe just made it easier.

But what I did find surprising is that a BBC Micro, running an 8 bit 6502 at 2MHz and with no floating point hardware, consistently beat an original 16 bit IBM PC/AT, with an 80286/287 running at 6MHz and hardware floating point, by a factor of between 2 and 5. The programs were partial helicopter simulations, as we were designing autopilots at the time, and some minimal translation between Basic dialects was done to enable what had been written in M$/IBM ROM Basic (apparently translated from the original code for the 8086 by Gates himself) to run on the BBC. The engineers who witnessed these trials were suitably impressed, and thereafter paid little credence to Gates and his alleged programming skill. We also tried some kind of Basic on a PDP11-45, which thrashed them both of course, but not by very much.

The BBC could do in 32k (yes, k, not M or G!) of RAM what seems to take bloatware programmers a minimum of 1000 times more to do these days, thinking about the bloat of most mobile apps, for instance. It sickens me to see the way software development has gone, all the power ans speed of modern hardware being gobbled up by bloatware. The great virtue of a 6502 is that it forces you to think properly, and not waste precious instruction or data space or machine cycles. But note that the BBC had a very well coded Basic interpreter in a 16k ROM and an unusually comprehensive and also well coded operating system in another 16k ROM, which were of immense help in getting it to do what was wanted efficiently.

I would suggest that everyone who writes code should have a go at an old 6502 based system from time to time. It encourages good habits.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #35 on: August 08, 2017, 11:12:39 AM »
I would suggest that everyone who writes code should have a go at an old 6502 based system from time to time. It encourages good habits.

I really can't agree with this part.

I cut my programming teeth on the 6502, and it's main virtue was costing eight to ten times less than its competition.

If you want 8 bit nostalgia, the 6809 had almost all the same virtues, while being a whole lot more pleasant and efficient in execution and programmer effort.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 3767
  • Country: de
Re: 6502 Cpu wanted
« Reply #36 on: August 08, 2017, 08:21:11 PM »
The 6502 was about as fast as an Z80 system running at 3.5 to 4 times the speed. However clock speeds where also at about that ratio: 6502 often a 1 MHz and Z80 at 3.5xx MHz.  The early PCs where relatively slow. This is only partially due to the software, but also from some slow software and using the 80286 most of the time in 8086 mode only. Especially DOS code often did not use an FPU unless specially complied for it. So the basic comparison might have just ignored the FPU. A 2 MHz 6502 might thus compete with a 6 MHz 8086 - especially if the code is written for low width data.
 

Offline bsudbrink

  • Regular Contributor
  • *
  • Posts: 103
  • Country: us
Re: 6502 Cpu wanted
« Reply #37 on: August 09, 2017, 01:39:16 AM »
Here's a higher res version of my avatar, how "real men" (just kidding) learned to program the 6502 back in the day:

 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 3395
  • Country: nl
Re: 6502 Cpu wanted
« Reply #38 on: August 09, 2017, 03:18:17 AM »
Here's a higher res version of my avatar, how "real men" (just kidding) learned to program the 6502 back in the day:

Don't you love it when the data bits outnumber the address bits? :)

But it's true, once you learned how to program things like this (a KIM-1 for me) you never forget how assembly language works.
Keyboard error: Press F1 to continue.
 
The following users thanked this post: SeanB

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1306
  • Country: dk
Re: 6502 Cpu wanted
« Reply #39 on: August 19, 2017, 07:07:38 PM »
I'd go for the FPGA ($13) version  (I have the FPGA board as a MC6809)

http://searle.hostei.com/grant/Multicomp/

And this baseboard
https://www.retrobrewcomputers.org/forum/index.php?t=msg&th=19&start=40&

Using NealC's implementation (MC6809 or Z80)
https://www.retrobrewcomputers.org/doku.php?id=boards:sbc:multicomp:cycloneii-c:start#downloads


/Bingo
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 3716
  • Country: us
Re: 6502 Cpu wanted
« Reply #40 on: December 06, 2017, 07:46:43 AM »
I made a similar daughterboard some time back that does roughly the same thing but it's much smaller than that baseboard. I'll post the design here when I get home in case anyone wants to make one, I've got all three varieties running on the hardware, 6502, 6809 and a decked out Z80 system running CP/M.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 1608
  • Country: gb
Re: 6502 Cpu wanted
« Reply #41 on: December 06, 2017, 11:44:29 PM »
what's the goal here?
if you just want to write code then use an emulator - like MAME.
emulate an apple2 or a bbc micro and write your code in the emulator.
mame has a debugger & dissassembler built in you can cheat with!  :-+

6502 was faster btw, because it had very low cycle-count operations.
there was a video on utube of an interview with a guy from Atari arcade-division - possibly Edd Logg,
he was saying that a 6502 cound run code almost as fast as a 68000, and the only reason they switched was to get the bigger memory-map!
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #42 on: December 08, 2017, 06:40:07 AM »
what's the goal here?
if you just want to write code then use an emulator - like MAME.
emulate an apple2 or a bbc micro and write your code in the emulator.
mame has a debugger & dissassembler built in you can cheat with!  :-+

6502 was faster btw, because it had very low cycle-count operations.
there was a video on utube of an interview with a guy from Atari arcade-division - possibly Edd Logg,
he was saying that a 6502 cound run code almost as fast as a 68000, and the only reason they switched was to get the bigger memory-map!

Code with 8 bit variables only, i the 68000 is running at twice the clock speed of the 6502 .. ok, maybe.

1 or 2 MHz 6502 vs 8 MHz 68000 ... not a chance.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 1608
  • Country: gb
Re: 6502 Cpu wanted
« Reply #43 on: December 08, 2017, 07:08:20 PM »
2MHz 6502, vs 7MHz 68000
and his comment was based on real hardware his unit built running software his team wrote - so i trust him.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #44 on: December 08, 2017, 08:04:30 PM »
2MHz 6502, vs 7MHz 68000
and his comment was based on real hardware his unit built running software his team wrote - so i trust him.

I don't believe it.

6502 takes 1 clock cycle per byte read/write (including instruction fetch), with a minimum of 2, plus 1 extra for a taken branch, or for a carry (page crossing) during indexed addressing or branch offset calculation.

68000 takes 4 clock cycles per byte or word read/write (including instruction fetch), plus 2 more for indexed addressing (each operand) or a taken branch.

So, on the face of it, it looks at first that a 2 Mhz 6502 and 8 MHz 68000 are going to have similar timings.

The problem is, the 6502 usually needs several instructions to do what the 68k can do in one.

For example, your commonly-used variables are usually in registers on 68k and in Zero Page on 6502. The 68k does a register-to-register add in 4 clock cycles (8 for a = b + c rather than a  += b because it needs an extra move). The 6502 needs 11 cycles for 8 bit variables (CLC, LDA, ADC, STA) or 20 cycles for 16 bit variables.

If they were clocked the same and you only needed 8 bit variables then the 6502 would be not too far off. But that's not the case. The 68k is clocked 3 or 4 times faster.

What about memory block moves (often a limiting factor)?

The 68k typically does "move (an)+,(an)+; dbne" for 22 cycles for copying either a byte or a word at a time. (let's ignore 32 bits at a time, which is 30% faster again). 6502 typically does "lda (zp),y;sta (zp),y;dey;bne" for 15 cycles per byte assuming no page crossing. If you don't mind self-modifying code you can cut the 6502 time down by 2 cycles. Unrolling has a similar effect for both, so I'll ignore that.

So, again, if they were clocked the same and the 68k is restricted to byte-at-a-time then the 6502 is competitive .. even a little faster. But, again. the 68k is actually clocked 3 or 4 times faster.

I'm sorry, but I just don't see it.
 

Offline brucehoult

  • Frequent Contributor
  • **
  • Posts: 522
  • Country: ru
Re: 6502 Cpu wanted
« Reply #45 on: December 08, 2017, 08:41:17 PM »
Oh, one possibility. Maybe your friend was not talking about the 68000 but the 68008 which, like the 8088 in the original PC, used an 8 bit bus. That might hobble it almost enough for the 6502 to be somewhat speed competitive on some programs.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 1608
  • Country: gb
Re: 6502 Cpu wanted
« Reply #46 on: December 09, 2017, 01:41:31 AM »
memory block move in atari's case can be done using the blitter chips - so it does not count.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf