News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Z80?

Started by NoCforMe, March 25, 2024, 03:30:13 PM

Previous topic - Next topic

NoCforMe

A new member posed a question about Z80 programming. Question: is that too far outside of our domain here? Should we refer such questions to other forums? (There are a lot out there.) Or should we maybe have a sub-forum that deals with this topic? After all, the Z80 is at least a close cousin of the '86 series of microprocessors.

(My ulterior motive here is that I have an unfulfilled desire to learn to program this processor, which I believe is one of the most under-utilized and under-appreciated machines of the 20th century.)

What d'you think?
Assembly language programming should be fun. That's why I do it.

sinsi

The Z80 has a special place in my heart, it's the first Intel-based ASM that I learned. Based on the 8080 but could use 16-bit registers (BC, HL?), as well as an index register or two (IX and IY). Running CP/M 2.

There are a few emulators around
Fun times in the '80s  :eusa_boohoo:

NoCforMe

And don't forget that really kewl context-switch operation to handle interrupts. Way ahead of its time!
Assembly language programming should be fun. That's why I do it.

raymond

Quote from: sinsi on March 25, 2024, 03:44:51 PMThe Z80 has a special place in my heart.
Fun times in the '80s  :eusa_boohoo:

Same here.

The first computer I purchased (in the mid-80s) was a Radio Shack TRS-80 in a garage sale. It came with a manual explaining the Basic language. In that manual, there was a short section talking about "machine language". Being the curious type, I spent another $4 and purchased a manual providing all the relevant details on that subject.

The internet still being in its early infancy, assemblers were not readily available. Programs had to be hand coded and kept on floppies. I was rapidly sold on the virtues of assembly when I found out that programs would run like 100 times faster than those written in Basic!!!! I eventually wrote my own assembler to more easily make corrections or modifications to my programs.

It's also with the Z-80 that I wrote my first program to extract a square root with 10,000 significant digits (with only 64 kb memory on that TRS-80).

One detail I seem to remember about the Z-80 was that it had two sets of common 8-bit registers you could switch between each other without loosing their contents.
Whenever you assume something, you risk being wrong half the time.
https://masm32.com/masmcode/rayfil/index.html

NoCforMe

Quote from: raymond on March 26, 2024, 04:53:22 AMOne detail I seem to remember about the Z-80 was that it had two sets of common 8-bit registers you could switch between each other without loosing their contents.

Yes, those are the "shadow registers":
ex af,af' ;switch af with its shadow
exx ;switch bc, de, and hl with their shadows
Essentially doubles the number of available registers (and not just for interrupt processing as I stated above).
Assembly language programming should be fun. That's why I do it.

stoo23

So, with regard to NoCforMe's earlier suggestion, what is the 'vibe' regarding the Z80, having it's own section or sub-section ?? and if so, where ??  :smiley:

NoCforMe

#6
We should probably give that question time to simmer a bit before taking any action. Would like to hear more replies and POVs on this.

Playing devil's advocate here (since creating a new forum here was my idea), I can see valid arguments against that, since this is the MASM32 forum, and because there seem to be a number of other sites that are dedicated to Z80 programming. However, since I'm a big fan of that li'l CPU, I'll leave it to others here who've been here longer than I to decide.
Assembly language programming should be fun. That's why I do it.

stoo23


jj2007

The question is what would be the added value. It's a small community, and they already have their own forums. IMHO we should rather invest our efforts in getting x64 off the ground.

FORTRANS

Hi,

   I started out in assembly language with a Fairchild F8 kit.
Next computer was an Apple ][, no programming though.  Then
the Heath/Zenith H89 / Z90 with CPM and HDOS.  That had a Z-80,
And HDOS had an 8080 assembler.  Wrote a number of assembly
language programs for it.  Including an interface to an external
input device.  I seem to remember liking the Zilog mnemonics
more than Intel's.

   As far as a sub-forum, I do not see a need for it.  The
Orphanage sub-forum already allows non X86 hardware questions.


Regards,

Steve N.

daydreamer

my first asm programming never involved Z80,but read about newer Ti calculators than mine supported ASM programs and faster 15mhz Z80 capable of bank switching in few megabytes flash memory with apps and most important usb cable to connect to PC and downloadable program for cross-development ,backup,possible to download more fun apps and install
so I bought one at "school start" reduced price
never got anywhere in ASM programming,max 4kb asm program in RAM (unless you want to create a big app stored in flash memory )and bank switching complicates things compared to 80's Z80 equipped computers,but its nice to program anywhere in TiBASIC
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Vortex

Remembering for the good old days, Z80 was the microprocessor of ZX Spectrum 48K. Long READ-DATA lines in Basic programs to insert machine code.

NoCforMe

Quote from: jj2007 on March 26, 2024, 08:20:41 PMThe question is what would be the added value. It's a small community, and they already have their own forums. IMHO we should rather invest our efforts in getting x64 off the ground.
Good argument that I'd certainly be willing to live with.
Assembly language programming should be fun. That's why I do it.

sinsi

There were some weird instructions too, and some really useful ones.
A couple that I wish Intel used now are conditional calls and rets.

daydreamer

Quote from: sinsi on March 27, 2024, 12:57:33 PMThere were some weird instructions too, and some really useful ones.
A couple that I wish Intel used now are conditional calls and rets.

Interesting, write x86 macros for those two?, but might be more useful with conditional invoke macro for win32 coding
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding