Z80, 8086, 6502 and 65k opinions?
Re: Z80, 8086, 6502 and 65k opinions?
(I think we've all benefited from the prime directive of the 6502 - to be the smallest viable 8bit CPU, and therefore the cheapest.)
Re: Z80, 8086, 6502 and 65k opinions?
BigEd wrote:
(I think we've all benefited from the prime directive of the 6502 - to be the smallest viable 8bit CPU, and therefore the cheapest.)
If someone votes for 8086 then we are no longer friends.
Re: Z80, 8086, 6502 and 65k opinions?
So I take it the best CPU to learn assembly programming is the 6502, based on the elegance everybody mentions here... Although the main reason why I want to learn assembly programming in the first place is to be able to program in x86 and ARM assembly. So do you think the 6502 would make a good stepping stone to learn those languages? Or should I start with one of those processors first?
I also found this website which sells 6502 and 65186 SBCs (and apparently bill mensch is the CEO btw), so should I get one of those? I don't mind saving for one even though the one I want is 199.00 . Thoughts?
I was also thinking about getting the gr8bit but $499 is a bit too much for me.
I also found this website which sells 6502 and 65186 SBCs (and apparently bill mensch is the CEO btw), so should I get one of those? I don't mind saving for one even though the one I want is 199.00 . Thoughts?
I was also thinking about getting the gr8bit but $499 is a bit too much for me.
Re: Z80, 8086, 6502 and 65k opinions?
You should learn assembly on the platform you want to write assembly for. Each CPU has their own architectural quirks, which won't translate from one CPU to the other. Fundamentals will translate (register usage, math, addressing modes, etc.), but machine has their own character and own idioms that won't move over.
If there's a specific project you want to learn assembly for, you should just do it. Get your tool chain set up and start banging away. Get your project started If you want to do some ARM assembly for some controller project, you should just do it.
The reason is simply that the your motivation is likely external ("I want to do X on an ARM machine") rather than "Gee I'd like to learn assembly". The primary task with provide the motivation to learn the actual details of coding. It will also focus your efforts on your task at hand.
Unless you have some desire for a 6502 machine in house, I wouldn't purchase one just to learn coding. You can use a simulator if you want instead.
But, again, I'd focus on the higher level task. Assembly is simply a means to an end. The end is what's more interesting for most folks, so focus on that, and the assembly will come along as much as it needs to.
If there's a specific project you want to learn assembly for, you should just do it. Get your tool chain set up and start banging away. Get your project started If you want to do some ARM assembly for some controller project, you should just do it.
The reason is simply that the your motivation is likely external ("I want to do X on an ARM machine") rather than "Gee I'd like to learn assembly". The primary task with provide the motivation to learn the actual details of coding. It will also focus your efforts on your task at hand.
Unless you have some desire for a 6502 machine in house, I wouldn't purchase one just to learn coding. You can use a simulator if you want instead.
But, again, I'd focus on the higher level task. Assembly is simply a means to an end. The end is what's more interesting for most folks, so focus on that, and the assembly will come along as much as it needs to.
Re: Z80, 8086, 6502 and 65k opinions?
nonanon wrote:
So I take it the best CPU to learn assembly programming is the 6502, based on the elegance everybody mentions here... Although the main reason why I want to learn assembly programming in the first place is to be able to program in x86 and ARM assembly. So do you think the 6502 would make a good stepping stone to learn those languages? Or should I start with one of those processors first?
If you are more interested in learning about how computers work at the hardware level then there is probably nothing better than the 6502. You could build your own system on a breadboard, it's not that hard. You'll need an EPROM programmer (or some other way of getting started), but otherwise you can do it quite cheaply. Or you could get a WDC board, that would get you up and going quickly.
Most of the difficulty in getting started is setting up an environment which doesn't get in your way. The 6502 is a more pure way to learn because it's simpler and needs less support. For a more complex processor the possibilities are endless, but you will have more work setting up a toolchain and development system. I guess another consideration is the support you can get from 6502.org, if you get stuck there are plenty of people here that always help out and are happy to discuss any problems you may come across. Maybe spend some time looking through Garth's primer, it may get you hooked on going down the 6502 path.
Re: Z80, 8086, 6502 and 65k opinions?
I see, maybe I'm too used to high level languages where if you learn one, then learning the others is a lot easier.
The goal is x86 assembly. Is there even such a thing as a 8086 or 186 development board though?
The goal is x86 assembly. Is there even such a thing as a 8086 or 186 development board though?
Re: Z80, 8086, 6502 and 65k opinions?
nonanon wrote:
The goal is x86 assembly. Is there even such a thing as a 8086 or 186 development board though?
Seriously, what do you want to do with the hardware?
If you want to learn ARM, hard to go wrong with a Raspberry Pi and you have little pins to do stuff with.
If you want a "bare metal" x86, you can look at emulators like QEMU. Gives you a basic PC with basic hardware (floppies, hard drive, network card, etc.) that you can code on at assembly without having to constantly restart you machine.
Yea, it's all software, but again, it depends on what you want to do with the hardware. Lots of folks do early OS hacking on something like QEMU.
There's DosBOX if you just want a dos PC to play with.
Re: Z80, 8086, 6502 and 65k opinions?
Not much to add here - there is something to be said for speaking several flavours of assembly language and having a view on the different kinds of CPUs out there, and that would be good background for someone wanting to understand CPU design, but if you intend to write x86 code then x86 code is probably the best place to start. It is much more fiddly than 6502 or ARM. Running your own code on your dev machine and possibly crashing the machine will probably get tiresome, so if that seems to happen, consider running in an emulator or virtual machine.
Intel do make the Edison board as a kinda sorta x86 equivalent to Raspberry Pi, but I'm not sure it offers anything special if your aim is to program - as opposed to making a robot or embedded computer of some kind.
Search online for x86 tutorials - there are plenty out there. I suppose if you find yourself totally baffled it might suit your learning style to start on a simpler CPU - easy6502 would be my recommendation in that case. But once you've got to grips with registers and memory, you'd then have to unlearn the 6502 specifics as you learn the x86.
Edit: these links look like they might be good starting points:
https://www.reddit.com/r/learnprogrammi ... embly_for/
http://stackoverflow.com/questions/8631 ... 6-assembly
Intel do make the Edison board as a kinda sorta x86 equivalent to Raspberry Pi, but I'm not sure it offers anything special if your aim is to program - as opposed to making a robot or embedded computer of some kind.
Search online for x86 tutorials - there are plenty out there. I suppose if you find yourself totally baffled it might suit your learning style to start on a simpler CPU - easy6502 would be my recommendation in that case. But once you've got to grips with registers and memory, you'd then have to unlearn the 6502 specifics as you learn the x86.
Edit: these links look like they might be good starting points:
https://www.reddit.com/r/learnprogrammi ... embly_for/
http://stackoverflow.com/questions/8631 ... 6-assembly
Re: Z80, 8086, 6502 and 65k opinions?
nonanon wrote:
maybe I'm too used to high level languages where if you learn one, then learning the others is a lot easier.
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: Z80, 8086, 6502 and 65k opinions?
One could probably argue if the CISC nature of the 8086 is really an attractive feature. I think when it comes to learning assembly language it is only human to learn the smallest set of instructions that can do most of the work for you. So all in all most of the CISC intructions is probably under utilised anyway.
Where CISC is a real pain is if you try to read a 8086 assembly program and figure out how it accomplish its task. Sometimes just this task itself is a steep learning curve because now you need to know what all these extra instructions does. Sometimes it is even neccessary to consult several resources before it comes clear on what an instruction does.
With the 6502, however, you can sumarise its instructions in a couple of pages.
Where CISC is a real pain is if you try to read a 8086 assembly program and figure out how it accomplish its task. Sometimes just this task itself is a steep learning curve because now you need to know what all these extra instructions does. Sometimes it is even neccessary to consult several resources before it comes clear on what an instruction does.
With the 6502, however, you can sumarise its instructions in a couple of pages.
Re: Z80, 8086, 6502 and 65k opinions?
whartung wrote:
nonanon wrote:
The goal is x86 assembly. Is there even such a thing as a 8086 or 186 development board though?
Seriously, what do you want to do with the hardware?
If you want to learn ARM, hard to go wrong with a Raspberry Pi and you have little pins to do stuff with.
If you want a "bare metal" x86, you can look at emulators like QEMU. Gives you a basic PC with basic hardware (floppies, hard drive, network card, etc.) that you can code on at assembly without having to constantly restart you machine.
Yea, it's all software, but again, it depends on what you want to do with the hardware. Lots of folks do early OS hacking on something like QEMU.
There's DosBOX if you just want a dos PC to play with.
But does QEMU really support the entire x86-64 instructing set? My goal is to get up to being able to code the latest intel cpus in their entire assembly, including say, iommu, vt-x, etc...
Re: Z80, 8086, 6502 and 65k opinions?
fastgear wrote:
Where CISC is a real pain is if you try to read a 8086 assembly program and figure out how it accomplish its task. Sometimes just this task itself is a steep learning curve because now you need to know what all these extra instructions does. Sometimes it is even neccessary to consult several resources before it comes clear on what an instruction does.
That said, Hennessy and Patterson don't consider quantity of instructions as a criteria for what is and is not RISC. What defines a processor as a RISC CPU is how the instruction set itself is designed. E.g., RISC CPUs in the 80s had 30 to 60 instructions. Today, they often have as many instructions as any half-way decent x86 CPU. Vis. the latest ARM and POWER CPUs. However, the one thing that both generations have in common is the instruction set is atomic enough for easy (or, at least, efficient) pipeline execution.
Indeed, if you look at most of the x86 instruction set today, as wildly varied as it is, most are designed with register-register semantics in mind. A lot do support register-memory operation, but even this is positively RISC compared to the benchmark that Hennessy and Patterson used to define what a CISC architecture definitively is: VAX-11/780.
Re: Z80, 8086, 6502 and 65k opinions?
nonanon wrote:
whartung wrote:
nonanon wrote:
The goal is x86 assembly. Is there even such a thing as a 8086 or 186 development board though?
Seriously, what do you want to do with the hardware?
If you want to learn ARM, hard to go wrong with a Raspberry Pi and you have little pins to do stuff with.
If you want a "bare metal" x86, you can look at emulators like QEMU. Gives you a basic PC with basic hardware (floppies, hard drive, network card, etc.) that you can code on at assembly without having to constantly restart you machine.
Yea, it's all software, but again, it depends on what you want to do with the hardware. Lots of folks do early OS hacking on something like QEMU.
There's DosBOX if you just want a dos PC to play with.
But does QEMU really support the entire x86-64 instructing set? My goal is to get up to being able to code the latest intel cpus in their entire assembly, including say, iommu, vt-x, etc...
Re: Z80, 8086, 6502 and 65k opinions?
Here's what QEMU says about its support:
https://qemu.weilnetz.de/qemu-tech.html ... femulation
But asking for the very latest feature set is probably pushing you in the direction of running on silicon. You can get a long way in a virtual machine, but if you really want to get to IOMMU stuff, well, that might mean baremetal. Certainly it's an enormous distance from a 6502. A journey of a thousand miles, as they say, begins with a single step.
To your advantage, AMD64 aka x86_64 is a much simpler world to live in. Or is it - the 32 bit world is a Russian Doll of compatible extensions to an idiosyncratic interior... good luck, you're going to need it!
https://en.wikipedia.org/wiki/X86#x86_registers
https://qemu.weilnetz.de/qemu-tech.html ... femulation
But asking for the very latest feature set is probably pushing you in the direction of running on silicon. You can get a long way in a virtual machine, but if you really want to get to IOMMU stuff, well, that might mean baremetal. Certainly it's an enormous distance from a 6502. A journey of a thousand miles, as they say, begins with a single step.
To your advantage, AMD64 aka x86_64 is a much simpler world to live in. Or is it - the 32 bit world is a Russian Doll of compatible extensions to an idiosyncratic interior... good luck, you're going to need it!
https://en.wikipedia.org/wiki/X86#x86_registers
Re: Z80, 8086, 6502 and 65k opinions?
The CPU from the 80s which was the most powerful was probably the original MIPS, they were the first RISC design, which allowed for much more efficient usage of silicon, but they required tremendous amount of memory.
Now, if you ask my favourite, it's without a single doubt the 6502, even though it's from the 70s. I have never developed any assembly program for neither the 8086, nor the Z80, nor the 68k (not 65k by the way), so I cannot juge. The Z80 looks like it has an elegant instruction set as well.
You probably also forgot the 6800, which was the distant cousin of the 6502 and Motorola's main chip before the 68k.
Now, if you ask my favourite, it's without a single doubt the 6502, even though it's from the 70s. I have never developed any assembly program for neither the 8086, nor the Z80, nor the 68k (not 65k by the way), so I cannot juge. The Z80 looks like it has an elegant instruction set as well.
You probably also forgot the 6800, which was the distant cousin of the 6502 and Motorola's main chip before the 68k.