News:

The Savage///Circuits website has been upgraded to a more efficient theme.

Main Menu

Assembly?

Started by JKnightandKARR, Nov 02, 2025, 01:54 PM

Previous topic - Next topic

JKnightandKARR

Just a question. I've got a Z80 book from 1999 when i tried college, would that help me learn assembly? Would it sorta help learn other assembly such as P1/P2? Meaning some of the general concepts/how it works, not commands themselves be of any use??

granz

I have mentioned this before (possibly not here,) but the best way for a total beginner to learn assembly is CardIAC (https://en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_Computation.) I received one back in the mid-70s in high school, and actually have one still. I credit Bell Labs CardIAC for my understanding of assembly, and deep (electron-chasing level) knowledge of computer operations.

Michael Gardi (re-creater of many old systems) wrote an Instructable on building the CardIAC (https://www.instructables.com/CARDIAC-CARDboard-Illustrative-Aid-to-Computation-/.)

Start by downloading the excellent manual, from the 'Ible, and thoroughly reading all 63 pages (including covers, blank pages and lots of pictures.) After you have read the manual, build the CardIAC re-creation for yourself. Once you have built the "computer," go through the manual again, following all of the examples on your system.

Once you have done that, you could download an emulator (but not before you do the actual work on the cardboard computer - that is essential to the good understanding of assembler) and play around with some of the programs in the CardIAC manual. Next go to Drexel University's outstanding CardIAC page by Professor Stuart (https://www.cs.drexel.edu/~bls96/museum/cardiac.html.) Go through Professor Stuart's page for some more advanced topics, like subroutines, recursion and others.

When you have gone through these things, you will have a pretty solid understanding of assembly, machine code and how a computer processes code. From that foundation you can go on to more advanced stuff like the Z-80 (an excellent CPU.)

Chris Savage

Quote from: JKnightandKARR on Nov 02, 2025, 01:54 PMJust a question. I've got a Z80 book from 1999 when i tried college, would that help me learn assembly?

Is it a college course book, or just a book on Z80 assembly (name / ISBN)?

Quote from: JKnightandKARR on Nov 02, 2025, 01:54 PMWould it sorta help learn other assembly such as P1/P2? Meaning some of the general concepts/how it works, not commands themselves be of any use??

I feel like the difficulty in learning assembly is related to the platform you're on. Like many people from my generation, I learned BASIC on the Apple II and C= VIC-20 first. I then got an assembler for the VIC-20, which has a 6502 CPU. In BASIC, you print a character (or string) to the screen using the "PRINT" command. Using assembly to do the same thing can be daunting to some people, until you understand subroutines. Then you build a subroutine that prints a number of characters by passing the address of the data to the subroutine and call it. The speed is much faster than BASIC.

It can seem like you're writing a lot more code to do simple things, but like I said, if you learn to develop subroutines that you call for I/O and other functions, it really streamlines and simplifies the actual application code. A little planning goes a long way.

BTW, I guess I got a little off-track there. When I mentioned it depending on the platform, think about what I was saying with the VIC-20. You've got a computer with video generation built-in. You don't have to handle the things like generating sync and video, refreshing DRAM, etc. Also, some CPUs have different addressing modes, registers and capabilities for things like math. I found the Z80 to be the best platform to learn on, but that's after programming the 6502 and 6809. Your mileage may vary.

If you need help or have specific questions, feel free to post them. We're here to help.

                    Bringing concepts to life through engineering.

JKnightandKARR

Quote from: granz on Nov 02, 2025, 04:57 PMI have mentioned this before (possibly not here,) but the best way for a total beginner to learn assembly is CardIAC (https://en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_Computation.) I received one back in the mid-70s in high school, and actually have one still. I credit Bell Labs CardIAC for my understanding of assembly, and deep (electron-chasing level) knowledge of computer operations.

Michael Gardi (re-creater of many old systems) wrote an Instructable on building the CardIAC (https://www.instructables.com/CARDIAC-CARDboard-Illustrative-Aid-to-Computation-/.)

Start by downloading the excellent manual, from the 'Ible, and thoroughly reading all 63 pages (including covers, blank pages and lots of pictures.) After you have read the manual, build the CardIAC re-creation for yourself. Once you have built the "computer," go through the manual again, following all of the examples on your system.

Once you have done that, you could download an emulator (but not before you do the actual work on the cardboard computer - that is essential to the good understanding of assembler) and play around with some of the programs in the CardIAC manual. Next go to Drexel University's outstanding CardIAC page by Professor Stuart (https://www.cs.drexel.edu/~bls96/museum/cardiac.html.) Go through Professor Stuart's page for some more advanced topics, like subroutines, recursion and others.

When you have gone through these things, you will have a pretty solid understanding of assembly, machine code and how a computer processes code. From that foundation you can go on to more advanced stuff like the Z-80 (an excellent CPU.)
You mentioned it before. I gotta see if I can access it on my desktop.... right now got issues with it locking up for an unknown reason.  Pretty annoying...  I need to print it out on stiff paper.


Quote from: Chris Savage on Nov 03, 2025, 10:14 AM
Quote from: JKnightandKARR on Nov 02, 2025, 01:54 PMJust a question. I've got a Z80 book from 1999 when i tried college, would that help me learn assembly?

Is it a college course book, or just a book on Z80 assembly (name / ISBN)?

Quote from: JKnightandKARR on Nov 02, 2025, 01:54 PMWould it sorta help learn other assembly such as P1/P2? Meaning some of the general concepts/how it works, not commands themselves be of any use??

I feel like the difficulty in learning assembly is related to the platform you're on. Like many people from my generation, I learned BASIC on the Apple II and C= VIC-20 first. I then got an assembler for the VIC-20, which has a 6502 CPU. In BASIC, you print a character (or string) to the screen using the "PRINT" command. Using assembly to do the same thing can be daunting to some people, until you understand subroutines. Then you build a subroutine that prints a number of characters by passing the address of the data to the subroutine and call it. The speed is much faster than BASIC.

It can seem like you're writing a lot more code to do simple things, but like I said, if you learn to develop subroutines that you call for I/O and other functions, it really streamlines and simplifies the actual application code. A little planning goes a long way.

BTW, I guess I got a little off-track there. When I mentioned it depending on the platform, think about what I was saying with the VIC-20. You've got a computer with video generation built-in. You don't have to handle the things like generating sync and video, refreshing DRAM, etc. Also, some CPUs have different addressing modes, registers and capabilities for things like math. I found the Z80 to be the best platform to learn on, but that's after programming the 6502 and 6809. Your mileage may vary.

If you need help or have specific questions, feel free to post them. We're here to help.
It's a course book. The Z80 Microprocessor: Architecture, Interfacing, Programming, and Design by: Ramesh Gaonkar. ISBN: 0-02-340484-1. 

for me, I learn better by doing, and the only thing I got to learn assembly on is the P1/P2, and not really and material on learning that on there.... and not sure what to use on my old DOS systems or my newer ones to try and learn. Maybe I can find a Z80 emulator online??

Chris Savage

Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMIt's a course book. The Z80 Microprocessor: Architecture, Interfacing, Programming, and Design by: Ramesh Gaonkar. ISBN: 0-02-340484-1.

I'm reading it now on Internet Archive. Looks like a good book. If you're planning on building a Z80 computer, or other systems based on Von Neumann architecture, you should get the relevant parts and follow the book. That would give you a solid foundation for assembly programming.

There are free assemblers, and low-cost programmers for writing to EPROM, EEPROM or NVRAM. The free assembler runs on Windows 10, though I haven't yet tried it on Windows 11. I assume it would work.

Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMfor me, I learn better by doing, and the only thing I got to learn assembly on is the P1/P2, and not really and material on learning that on there.... and not sure what to use on my old DOS systems or my newer ones to try and learn.

So, with regards to the P1 / P2; while I would never dissuade anyone from learning assembly on any particular platform, you have to understand that the P1 / P2 are unlike most other platforms. Not just as multi-core MCUs, but the way the assembly is handled on the P1 / P2 is a bit different. My understanding is that the P2 can handle in-line assembly in the code. With the P1, you usually launch a new cog with your assembly code.

There are different pools of memory, shared access to I/O, etc. Just a number of things that would purport to complicate things when you're trying to learn. To a degree, I question the longevity of the P1 / P2. Parallax has become a shadow of what it once was. I'm not sure they have more than a dozen people left anymore, with many people wearing multiple hats. My favorite MCU for assembly used to be the ATmel stuff, though now that Microchip owns them, I haven't done anything with them in a while.

P.S. - Did you get any Z80 hardware to go with this book you have?

Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMMaybe I can find a Z80 emulator online??

                    Bringing concepts to life through engineering.

JKnightandKARR

#5
Quote from: Chris Savage on Nov 03, 2025, 12:35 PM
Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMIt's a course book. The Z80 Microprocessor: Architecture, Interfacing, Programming, and Design by: Ramesh Gaonkar. ISBN: 0-02-340484-1.

I'm reading it now on Internet Archive. Looks like a good book. If you're planning on building a Z80 computer, or other systems based on Von Neumann architecture, you should get the relevant parts and follow the book. That would give you a solid foundation for assembly programming.

There are free assemblers, and low-cost programmers for writing to EPROM, EEPROM or NVRAM. The free assembler runs on Windows 10, though I haven't yet tried it on Windows 11. I assume it would work.

Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMfor me, I learn better by doing, and the only thing I got to learn assembly on is the P1/P2, and not really and material on learning that on there.... and not sure what to use on my old DOS systems or my newer ones to try and learn.

So, with regards to the P1 / P2; while I would never dissuade anyone from learning assembly on any particular platform, you have to understand that the P1 / P2 are unlike most other platforms. Not just as multi-core MCUs, but the way the assembly is handled on the P1 / P2 is a bit different. My understanding is that the P2 can handle in-line assembly in the code. With the P1, you usually launch a new cog with your assembly code.

There are different pools of memory, shared access to I/O, etc. Just a number of things that would purport to complicate things when you're trying to learn. To a degree, I question the longevity of the P1 / P2. Parallax has become a shadow of what it once was. I'm not sure they have more than a dozen people left anymore, with many people wearing multiple hats. My favorite MCU for assembly used to be the ATmel stuff, though now that Microchip owns them, I haven't done anything with them in a while.

P.S. - Did you get any Z80 hardware to go with this book you have?

Quote from: JKnightandKARR on Nov 03, 2025, 12:01 PMMaybe I can find a Z80 emulator online??
No, I never have gotten or had any Z80 hardware, but I did find some Z80 emulators online. Between the book and that cardiac, should help.

EDIT: http://www.z80.info/z80emu.htm#EMU_CPU_W32

Chris Savage

Quote from: JKnightandKARR on Nov 03, 2025, 01:36 PMNo, I never have gotten or had any Z80 hardware, but I did find some Z80 emulators online. Between the book and that cardiac, should help.
http://www.z80.info/z80emu.htm#EMU_CPU_W32

Thomas Scherrer's Z80.info website has been around for a very long time. I still go there for reference stuff once in a while. Pretty sure I downloaded a Z80 disassembler from there. If you decide to go the Z80 route, I think you'll find a lot of help here from multiple Z80 users.  ;)

                    Bringing concepts to life through engineering.

granz

Quote from: Chris Savage on Nov 03, 2025, 10:14 AMI feel like the difficulty in learning assembly is related to the platform you're on.
I agree with what Chris said here; the simpler the platform the simpler the assembly language. That is why I recommended the Cardiac - that is almost the simplest computer that you can possibly get, and thus the simplest assembly language that you can get.

Quote from: JKnightandKARR on Nov 03, 2025, 01:36 PM
Quote from: Chris Savage on Nov 03, 2025, 12:35 PMP.S. - Did you get any Z80 hardware to go with this book you have?
No, I never have gotten or had any Z80 hardware, but I did find some Z80 emulators online. Between the book and that cardiac, should help.
The Sinclair ZX-80/ZX-81 (Timex Sinclair TS1000) computers were Z-80-based, and can usually be found pretty cheap. If you would like, I can send mine to you. I don't know which ones work, you would need to figure out which one(s) do work. But then you could start playing with actual Z-80 assembly.

Quote from: Chris Savage on Nov 03, 2025, 02:05 PMIf you decide to go the Z80 route, I think you'll find a lot of help here from multiple Z80 users.  ;)
Yep, I am one of them.

Chris Savage

Quote from: granz on Nov 04, 2025, 07:09 AM
Quote from: Chris Savage on Nov 03, 2025, 02:05 PMIf you decide to go the Z80 route, I think you'll find a lot of help here from multiple Z80 users.  ;)
Yep, I am one of them.

I know there are at least three of us on these forums that I would consider proficient with the Z80.  8)

                    Bringing concepts to life through engineering.

JKnightandKARR

Quote from: granz on Nov 04, 2025, 07:09 AM
Quote from: Chris Savage on Nov 03, 2025, 10:14 AMI feel like the difficulty in learning assembly is related to the platform you're on.
I agree with what Chris said here; the simpler the platform the simpler the assembly language. That is why I recommended the Cardiac - that is almost the simplest computer that you can possibly get, and thus the simplest assembly language that you can get.

Quote from: JKnightandKARR on Nov 03, 2025, 01:36 PM
Quote from: Chris Savage on Nov 03, 2025, 12:35 PMP.S. - Did you get any Z80 hardware to go with this book you have?
No, I never have gotten or had any Z80 hardware, but I did find some Z80 emulators online. Between the book and that cardiac, should help.
The Sinclair ZX-80/ZX-81 (Timex Sinclair TS1000) computers were Z-80-based, and can usually be found pretty cheap. If you would like, I can send mine to you. I don't know which ones work, you would need to figure out which one(s) do work. But then you could start playing with actual Z-80 assembly.

Quote from: Chris Savage on Nov 03, 2025, 02:05 PMIf you decide to go the Z80 route, I think you'll find a lot of help here from multiple Z80 users.  ;)
Yep, I am one of them.
Sure, that could help. Ihave access to my desktop, notsure whats making it lock, but i'll print the cardiac stuff out, just need ti get some stiff paper.  I tried the P1 assembly docs i have, but totally lost on the subject...

Quote from: Chris Savage on Nov 04, 2025, 09:55 AM
Quote from: granz on Nov 04, 2025, 07:09 AM
Quote from: Chris Savage on Nov 03, 2025, 02:05 PMIf you decide to go the Z80 route, I think you'll find a lot of help here from multiple Z80 users.  ;)
Yep, I am one of them.

I know there are at least three of us on these forums that I would consider proficient with the Z80.  8)
Good to know atleast you 2 are. Thanks for the help.

Chris Savage

Quote from: JKnightandKARR on Nov 04, 2025, 11:14 AMGood to know atleast you 2 are. Thanks for the help.

There's also MicroNut, who was also at the Meetup. He's currently working on a Z80 book. As I've said before, the Z80 has always been my favorite platform to develop on. It's fun, easy and powerful, while maintaining simplicity and backward compatibility (machine code) with two other previously popular platforms, including the 8080.

                    Bringing concepts to life through engineering.

JKnightandKARR

Quote from: Chris Savage on Nov 04, 2025, 11:39 AM
Quote from: JKnightandKARR on Nov 04, 2025, 11:14 AMGood to know atleast you 2 are. Thanks for the help.

There's also MicroNut, who was also at the Meetup. He's currently working on a Z80 book. As I've said before, the Z80 has always been my favorite platform to develop on. It's fun, easy and powerful, while maintaining simplicity and backward compatibility (machine code) with two other previously popular platforms, including the 8080.
Cool.

JKnightandKARR

#12
Quote from: granz on Nov 04, 2025, 07:09 AMThe Sinclair ZX-80/ZX-81 (Timex Sinclair TS1000) computers were Z-80-based, and can usually be found pretty cheap. If you would like, I can send mine to you. I don't know which ones work, you would need to figure out which one(s) do work. But then you could start playing with actual Z-80 assembly.
I found schematics last night along with the 16Kb RAM.

granz

Quote from: JKnightandKARR on Nov 05, 2025, 01:33 PM
Quote from: granz on Nov 04, 2025, 07:09 AMThe Sinclair ZX-80/ZX-81 (Timex Sinclair TS1000) computers were Z-80-based, and can usually be found pretty cheap. If you would like, I can send mine to you. I don't know which ones work, you would need to figure out which one(s) do work. But then you could start playing with actual Z-80 assembly.
I found schematics last night along with the 16Kb RAM.
So, do you have just the 16K RAM, or do you have more?

JKnightandKARR

#14
Quote from: granz on Nov 05, 2025, 03:29 PM
Quote from: JKnightandKARR on Nov 05, 2025, 01:33 PM
Quote from: granz on Nov 04, 2025, 07:09 AMThe Sinclair ZX-80/ZX-81 (Timex Sinclair TS1000) computers were Z-80-based, and can usually be found pretty cheap. If you would like, I can send mine to you. I don't know which ones work, you would need to figure out which one(s) do work. But then you could start playing with actual Z-80 assembly.
I found schematics last night along with the 16Kb RAM.
So, do you have just the 16K RAM, or do you have more?
as far as i know there is only a 16kb ram exp module, i wondered if more could be added??
https://www.retroisle.com/sinclair/zx81/Technical/Hardware/16KRamPackSchematics.php