PDA

View Full Version : Can a retro-computer be a useful way to learn computer-architecture fundamentals?



olamazur2
April 17th, 2018, 02:13 AM
I've been reading about the fundamentals of computer architecture, but I think I could get a better grasp of the basics if I could could have an actual device to play with.

I had considered building a 2- or 4-bit device on a breadboard with "switches and blinky lights," but I think that a ready-made machine that I can interact with, code/decode, and disassemble/reassemble might be a better place for me to start.

Would a retro-computer, say from the the 70's or 80's, be good for this purpose?

FYI, I've been considering an original Apple II for many reasons, including its hobbyist-friendly design, a wealth of documentation, and a fondness for its main inventor, Steve Wozniak. But after seeing the high price of them on eBay, I'm considering other systems too.

smbaker
April 17th, 2018, 08:23 AM
I think one of the recent Z-80 retro kits would be useful for educational purposes. 1) You can interact with it over a serial terminal, and 2) Most of them have some kind of IO that you could attach LEDs to.

Stone
April 17th, 2018, 08:33 AM
Get an XT or an XT clone. Everything is well documented, systems and parts are rather plentiful and reasonably priced and it's generic as well as open architecture.

glitch
April 17th, 2018, 09:07 AM
Old computers are an excellent way to learn the fundamentals of computer architecture -- that's how I learned, and it gave me a major advantage in college. I learned assembly/machine language programming on the 6502, but took Comp Org in college around 2007, so yes, still relevant! I understood enough low-level machine architecture to realize just how inadequate our Comp Org I textbooks were, and to also appreciate the switch to a better textbook and MIPS32 in Comp Org II :p

The Apple II series would be an excellent choice to start with, if you want actual vintage hardware. You probably want to find a IIe though, the straight II and II+ have gotten pretty expensive, and will be more likely to have issues. The Apple IIe is as close to foolproof/bulletproof as you're likely to get with actual vintage hardware.

Single-board computers and trainers are also an excellent option. I'm partial to the Intel 8080/8085 and MOS 6502 myself. Many SBCs or trainers have built-in parallel I/O for controlling external circuitry. Boards like the Intel SDK-85 (8085 based) even have a large prototype area laid out for the hobbyist/engineer/experimenter to use. There are many vintage options, as well as modern reproductions and brand-new modern designs. I just finished designing an 8085 SBC for VCF East XIII, which happens in mid-May this year.

Some trainers have coursework that goes with them, as in full out study material with exercises and end-of-chapter questions. The Graymark 809 trainer comes to mind.

For assembler/disassembler work, start with doing it on paper, using either an opcode table or the CPU's datasheet. This is actually less work than learning an assembler, and you'll get very familiar with the low-level details of the CPU.


Get an XT or an XT clone. Everything is well documented, systems and parts are rather plentiful and reasonably priced and it's generic as well as open architecture.

I would specifically advise against starting with x86 if you don't have to -- it's not a very clean architecture to learn on.

Dwight Elvey
April 17th, 2018, 10:58 AM
It depends on what you want to get out of it. You can learn a lot from an Arduino to a IMSAI with a 8080. My favorite computer today is the STM32s. They are fast, small and cheap. There are new things to learn with the new parts but most of it hasn't changed since 1970.
Dwight

kgober
April 17th, 2018, 11:32 AM
A retro-computer *can* be good for learning the basics of computer architecture, but which computer you choose depends on what 'layer' of computer architecture you're interested in learning about. You may need to play with multiple systems to get good coverage of the various layers.

I would guess that the best place to start is with a system that has as simple a CPU as possible, with few registers. Anything with an 8080, Z80, 6502 or 6809 would do, as long as it has some kind of machine code monitor you can use. An Apple //e would work, or a Commodore 64. They are both fairly easy to get and not too expensive. Something like a KIM-1 would be fun (something with a keypad and an LED display) but such things can be hard to find nowadays. An x86-based PC would not be a good choice here.

But an x86 *is* an excellent choice when you start looking at system performance, because it's relatively easy to swap out a lower-performing component and see how your bottlenecks are shifted as a result. Something 80386-based with an ISA bus and optional cache would be my recommendation; the ISA bus is slow enough that it's a bottleneck all on its own and the ability to plug in both 8-bit and 16-bit expansion cards can be educational. Optional cache so you can see how the system behaves with a CPU cache and without. This would also be a good system to learn about the difference floating-point hardware can make compared to software math libraries.

KC9UDX
April 17th, 2018, 01:20 PM
I think a lot of people laugh at me when I say this, but I really feel the best possible way to start is one of these:

https://m.ebay.com/itm/Radio-Shack-Science-Fair-Microcomputer-Trainer-28-260-MP1312/282844430532?hash=item41dad780c4:g:F7UAAOSwMGVabKY j

glitch
April 17th, 2018, 01:31 PM
I think a lot of people laugh at me when I say this, but I really feel the best possible way to start is one of these:

https://m.ebay.com/itm/Radio-Shack-Science-Fair-Microcomputer-Trainer-28-260-MP1312/282844430532?hash=item41dad780c4:g:F7UAAOSwMGVabKY j

I learned a lot from old Science Fair/Radio Shack stuff...never had that particular one though.

tezza
April 17th, 2018, 01:46 PM
One thought...

Are there web-based "trainer-type" simulations which can help with this in the absence of a real machine? Might be cheaper and less hassle if the goal is to experiment in order to understand the basics?

Tez

KC9UDX
April 17th, 2018, 02:55 PM
I learned a lot from old Science Fair/Radio Shack stuff...never had that particular one though.

I found this one to be the best kit they made. Of course I didn't have or even see them all, but this one was different. I'd highly recommend getting one to play with, especially for the price. The price keeps going down.

Of all my "vintage computers", if I could only keep one it would be this. And I'd probably get time to add mass storage to it like I've planned for over three decades.


https://youtu.be/Axliu76S520

2icebitn
April 17th, 2018, 03:14 PM
Every book I've ever seen on computer architecture starts off by teaching machine language. Therefore that's where you need to start. I highly recommend embarking on this journey with an IBM compatible. It doesn't have to be a true blue IBM. In fact the argument could be made that a unit that differs some may enhance your learning experience. But regardless you need to learn assembly language (which in itself doesn't teach you what's going on electronically in the computet) and you can even start doing that with a modern pc booted with a dos cd (that has debug). The best text I've ever seen on 8086 assembly language is Peter Abel's IBM PC Assembly Language and Programming, 2nd. Ed. GET IT. From there numerous other books can teach you digital electronics and microciomputer fundamentals. Spending time with a trainer mentioned is also a good idea. I wouldn't bust my hump trying to obtain an actual microcomputer trainer with the keypad and all. But you may want to build one. My advice is to focus on a relevant architecture. The 68000 is my second recommendation. Whether the 80x86 is a clean architecture or not is irrelevant since most of the planet use one.

Stone
April 17th, 2018, 03:28 PM
I would specifically advise against starting with x86 ... it's not a very clean architecture to learn on.


Whether the 80x86 is a clean architecture or not is irrelevant since most of the planet use one.DITTOh

Caluser2000
April 17th, 2018, 04:15 PM
Theres a couple of kits on Amazon at quite good prices. https://www.amazon.com/Micro-Master%C2%AE-Computer-Training-Kit-MM-8000K/dp/B0002EWO2Q

glitch
April 17th, 2018, 04:22 PM
DITTOh

Just because the current descendant is the most popular desktop architecture doesn't make it the most suitable for learning. Getting the core concepts of computer architecture down before jumping into a more complicated ISA like x86 is, in my opinion, a good way forward.

Caluser2000
April 17th, 2018, 04:40 PM
One thought...

Are there web-based "trainer-type" simulations which can help with this in the absence of a real machine? Might be cheaper and less hassle if the goal is to experiment in order to understand the basics?

TezUnsure of a virtual trainer per sa but there certainly are the resources/tutorials etc out there http://www.cs.virginia.edu/~evans/cs216/guides/x86.html that page links to https://software.intel.com/en-us/articles/intel-sdm

https://www.tutorialspoint.com/assembly_programming/index.htm

https://www.youtube.com/watch?v=ViNnfoE56V8 Assembly tutorial based around an Rpi along with Code and Tanscript.

x86 Tutorial using Linux https://www.youtube.com/watch?v=wLXIWKUWpSs
x8 assembler for beginners http://ce.kashanu.ac.ir/sabaghian/assembly/8086%20tutorial/8086%20Assembler%20Tutorial%20for%20Beginners%20%2 8Part%201%29.htm

Found this very good https://www.youtube.com/watch?v=1FXhjErUz58

2icebitn
April 17th, 2018, 04:49 PM
When I referred to a trainer I meant one at a more basic level, one that teaches gates and such. Imho an actual microcomputer trainer teaches not much more then machine language, and therefore is unnecessary. You can learn all that by playing with debug.

KC9UDX
April 17th, 2018, 06:02 PM
I would never recommend x86 to a beginner. 65xx, yes.

The only reason in the world to learn x86 in this day and age is for writing demos for old PC/XT/AT compatibles.

There's no practical reason otherwise. For productivity it would make more sense to learn ARM. But for a beginner, nothing teaches good practises, simply, like 6502.

2icebitn
April 17th, 2018, 06:43 PM
Everyone is a beginner is some sense. Yes I had a C64 that arguably I played with a bit, not sure if it was before learning 8086 assembler. Having a ml monitor on a cart is actually pretty similar to playing with debug. And what use would learning assembler for the 6502/6510 serve? And if you were dropped into a curriculum where you had to learn 16 bit assembler or ibm mainframe/mini assembler (could be very similar), you had no choice but to learn it. Yeah 16 bit assembler is dated. But all the other architectures are hopelessly dated. Except ARM and perhaps 68k. And assembler is just the first step anyway. Digital architectures are similar regardless of what you're studying.

KC9UDX
April 17th, 2018, 07:11 PM
65xx embedded processors are everywhere.

There are likely jobs to be gotten programming them, I would assume.

Nobody anywhere likely programs x86 assembly for productivity anymore. All x86 embedded systems I've worked with in recent years are full AT clones at the minimum and all run Linux or Windows, assumedly programmed in C.

I don't know ARM, but everything I've been told is that ARM comes natural if you know 65xx.

smbaker
April 17th, 2018, 08:20 PM
If one starts with writing a 16-bit program that fits into a single segment (a COM file), x86 assembly is not bad at all. Calling BIOS routines or DOS int 21h routines is well-documented. Old hardware is plentiful and there's opportunity to do everything from writing a DOS application to modifying a BIOS. There's a wealth of excellent old books out there (IIRC Peter Norton's Assembly book was my intro, the Waite Group book was one of my other favorites). I wouldn't hesitate suggesting x86 as a first assembly language.

For the OP, I think it comes down to putting together a likely project scenario. In my experience, learning assembly and learning the machine was a function of need -- I had something I wanted to do, I owned hardware I wanted to do it on, and assembly was required for some reason (usually space or speed or closeness to the hardware). So pick a platform, pick a project, and just go for it.

Caluser2000
April 17th, 2018, 08:35 PM
Found this a good read http://www.eejournal.com/article/20091110-x86/ ;) Having a sense of humor helps.

Well said smbaker. It shouldn't really matter which platform is chosen as long as there is a good result at the end of it.


Nobody anywhere likely programs x86 assembly for productivity anymore.So what? The basics ideas are still the same no matter what architecture you're using-ie getting as close to the hardware as possible.

Just another point you can use an emulator if you don't have the hardware for example https://www.youtube.com/watch?v=GG6tfYyzzbM and https://www.youtube.com/watch?v=9hLGvLvTs1w So you can practice before
you aquire your Apple IIe, C64 or whatever.

Dwight Elvey
April 17th, 2018, 09:02 PM
I think Tezza said it best. There are really two sides to a computer. One is the hardware and the other is the software. Learning to experiment with the one you are interested in is the important part. Along the way, you'll learn about the other because you'll keep tripping over it while dealing with the other. You could read a lot of books about this that or the other but you can't learn to swim without getting wet.
I don't believe your choice of processor to start with is all that important. It is good to work with each types a little. Despite grumbling about the X86 it is not all that bad. A pure RISC chip today would be a poor performer today. Even the ARM processors are becoming more CISC like.
If you want to learn cheaply, an Arduino is the way to go. If you enjoy working with other types of things a KIM-1 or IMSAI is the way to go. The only disadvantage ( maybe advantage really ) is that these older machines may be nearing the end of their ability to function. For this you'll have to learn how to keep them running.
Dwight

KC9UDX
April 17th, 2018, 09:49 PM
Learning HP FOCAL, TMS1000, 6502, x86, 680x0, and PPC in that order was better for me than I think x86 first would have been. My point is that there's no reason to tie yourself down to any specific assembly today, so why not learn the simplest, most straightforward one first? We have emulators for everything. Heck HP FOCAL might even make sense to learn first today.

But again for learning the basics of both hardware and software, as well as simple logic, why not spend $5 or $30 or $50 and get one of the Radio Shack trainers I mentioned? They were meant to make it easy for anyone, and I think they did a great job.

Tor
April 17th, 2018, 11:32 PM
The 6502 is a great way to start learning what a microprocessor is and how it works. It must be simple so that you understand the concepts. Therefore, the x86 is not a particularly good choice - it would just take longer to "get" how a microprocessor works. That x86 is the grandfather of what's powering most PCs today is completely irrelevant in this context.
As such, an even simpler CPU is equally good, I still remember the day I "got it" - and that was a hypothetical microprocessor from a text book. But all the concepts were there, so later I could apply all of that to programming the 6502 (a very productive and fun experience, no roadblocks with quirky things that were added to e.g. x86) and minicomputer programming via the front panel.

2icebitn
April 18th, 2018, 12:55 AM
So what is the context whereby older far more obsolete architectures are more relevant? The irony is delectable. I'll of course let the op decide for his/her self. But most everything that came before pcs were toys by comparison any astute person would (or at least should) learn and quickly grow bored of assembler or machine fundamentals on anything 8 bit. But whatever.

KC9UDX
April 18th, 2018, 02:02 AM
Palo Alto was a toy?

CDC made toys?

ENIAC was a toy...

Tor
April 18th, 2018, 03:00 AM
So what is the context whereby older far more obsolete architectures are more relevant? The point is that it's *not* obsolete. The older architectures contain all the elements which creates a microprocessor. The difference is simply that on e.g. a 6502 you can see all those parts in front of you. Unlike e.g. a Xeon CPU. It lets you understand how the thing works. And *then* it becomes easy to apply that understanding to more complex CPUs (which nevertheless include the same fundamental parts as e.g. the 6502).

2icebitn
April 18th, 2018, 03:26 AM
Palo Alto was a toy?

CDC made toys?

ENIAC was a toy...

No, but neither is the op going to learn about computers on any of those. I was referring to consumer items.

2icebitn
April 18th, 2018, 03:27 AM
Omg please. Who said anything anywhere about Xeons???

Caluser2000
April 18th, 2018, 03:49 AM
So what is the context whereby older far more obsolete architectures are more relevant? The irony is delectable. I'll of course let the op decide for his/her self. But most everything that came before pcs were toys by comparison any astute person would (or at least should) learn and quickly grow bored of assembler or machine fundamentals on anything 8 bit. But whatever.

Bitness is nether here nor there. The 6502 is still in use. The fundamental concepts are still the same ie cpu, ram, registers, optcode etc. The C64(worlds most sold computer) had better graphics, sound compare to the original IBM PC, which was rather bland.

2icebitn
April 18th, 2018, 04:34 AM
Ibm's graphics offerings were bland initially. It wasn't intended for gaming. Millions of compatibles were sold that as stock had far better graphics then the c64. If you were lucky your c64 lasted a year (my original one didn't last but a month). This isn't a discussion about the merits of either, but rather where one's time is better spent. I wouldn't discourage the op from exploring the c64. It's just when it blows parts are way more difficult to find then an ibm or compatible. That's certainly something to keep in mind.

KC9UDX
April 18th, 2018, 04:39 AM
Year? The one I bought new lasted ten years until I decided I didn't need it anymore and cannibalised it for parts. The ones I use now are 35 years old. I never knew anyone back then that had trouble with them. Else I'd never have bought one.

You can learn a LOT from ENIAC. It really was an amazing architecture. I spent a lot of time programming it in simulation. I learnt a lot.

Tor
April 18th, 2018, 04:41 AM
No, but neither is the op going to learn about computers on any of those. I was referring to consumer items. You don't learn about computers just by fiddling with consumer items. You only learn about fiddling with consumer items.
The original poster wrote:
I've been reading about the fundamentals of computer architecture, but I think I could get a better grasp of the basics if I could could have an actual device to play with. So this is about learning the fundamentals of computer architecture. And that's what the discussion is about. For that, the 6502 or any other plain, but fundamentally complete microprocessor is ideal.

Omg please. Who said anything anywhere about Xeons??? Merely an example of something newer than the 6502! But if you really want to play games with words, be my guest.

Caluser2000
April 18th, 2018, 05:00 AM
Ibm's graphics offerings were bland initially. It wasn't intended for gaming. Millions of compatibles were sold that as stock had far better graphics then the c64. If you were lucky your c64 lasted a year (my original one didn't last but a month). This isn't a discussion about the merits of either, but rather where one's time is better spent. I wouldn't discourage the op from exploring the c64. It's just when it blows parts are way more difficult to find then an ibm or compatible. That's certainly something to keep in mind. https://www.retroleum.co.uk/commodore-64
http://www.unitechelectronics.com/comm64parts.htm
There are others as well.

Scali
April 18th, 2018, 05:29 AM
So what? The basics ideas are still the same no matter what architecture you're using-ie getting as close to the hardware as possible.

I agree there... Learning the basics of CPUs and machine language doesn't have much to do with job opportunities in writing x86 asm.
You can learn the basics on a variety of CPUs, x86 being one of them. The main thing x86 has going for it is its omnipresence.... x86 CPUs everywhere, and consequently also tools, documentation and other people who can assist you.

Having said that, I do believe that going down to the basics of digital circuits may be a better place to start. As in, learning about simple AND, OR, NOT, XOR gates and such, and how to string them together to perform basic addition, subtraction and all that.
Using an actual CPU is a logical progression from there (and bonus points for the 6502 since it only has addition and subtraction in hardware, if you want more complex stuff, like multiply, divide, square root, etc... let alone floating point, you have to do it yourself).

kgober
April 18th, 2018, 06:01 AM
So what is the context whereby older far more obsolete architectures are more relevant?

The relevance when learning computer architecture is that an older processor like the 6502 has a very direct mapping between instructions executed and bus cycles. Modern architectures do speculative fetching, fufill reads from cache (and defer writes) and have all kinds of other tricks to improve performance and functionality (with control registers and instructions to manage those features) and it just makes the processor manual thicker and harder to understand. Once you know what you're doing it's easy to identify the parts of the instruction set and register set that you can safely ignore for 'simple' programming, but when you're new it's easy to get lost in all the complexity. You and I both know that on the 80386 the EAX register is important, but CR3 is not, but for a beginner this isn't so clear.

The other relevance is in learning what is essential in a computer, versus what is simply nice to have. Notable examples here are lots of registers, lots of addressing modes, and useful (but not critical) instructions like multi-bit shifts and rotates, hardware integer multiply/divide, and of course all floating point instructions.

Dwight Elvey
April 18th, 2018, 06:09 AM
I think if one is to learn about computer architecture one needs to see various types of computers. My list would be: 68K, 1802, F8, 8051, x86 and NC4000. Each brings a different perspective about what is involved with how data is handled. It is not that I would design a computer like any of them but it helps to see the different ways problems were solved in each. One should apply different types of problems to each. Things like string processing, vector handling, simple switch statement and such.
Dwight

KC9UDX
April 18th, 2018, 02:36 PM
I very much agree. But I think it would be good to get a firm footing in one first.

2icebitn
April 18th, 2018, 05:03 PM
If a person has limited time (don't we all) I would recommend bypassing every bit of history and delving into something that will allow them to accomplish something. As I've said the 68k is a totally worthwhile chip family to investigate. So much of programming and microcomputer construction is an abstraction anyway (thank goodness). We don't have to know machine language to program in assembler. If we're constructing a single board computer say, we aren't building things up from individual gates (and yes you will certainly need to learn digital circuitry in order to design your own computer board, but not to simply build one from say plans). Personally I'd rather build and be able to utilize something on the modern side shall we say. Tons of software and docs for the 80x86 in particular.