Questions tagged [z80]

The Zilog Z80 microprocessor. Prefer [game-boy] instead for questions about the Game Boy CPU nicknamed the ‘GBZ80’.

Filter by
Sorted by
Tagged with
21 votes
3 answers
3k views

Z80 to x86 asm translator?

8086 is source code compatible with 8080. Zilog Z80 extended Intel 8080 with: An enhanced instruction set including bit manipulation, block move, block I/O, and byte search instructions New IX and IY ...
Schezuk's user avatar
  • 3,732
11 votes
1 answer
2k views

How does Master System backwards compatibility work on the Megadrive?

I know that the Megadrive contains the Z80 CPU to help control the soundchips for 16-bit games, and that it provides backwards compatibility for the CPU processing of Master System software, but ...
6502Assembly4NESgames's user avatar
4 votes
1 answer
885 views

Building a Memory Management Unit to expand the 16Bit Address space [closed]

I'm in the middle of making an 8Bit computer, I've selected Z80, the 20Mhz version, which is cheap and readily available. Since Z80 has a 16bit address line it can only address 64KB of memory location....
ilgaar's user avatar
  • 141
18 votes
6 answers
4k views

Are there other examples of CPU architectures mostly compatible with Intel 8080 other than Z80?

When the Zilog Z80 was released, it was marketed as being mostly ISA compatible with Intel 8080, while also providing enhanced features. Likewise, the CPU of the Nintendo Game Boy is a custom ...
nitro2k01's user avatar
  • 706
6 votes
3 answers
998 views

Z80, best way to page out EEPROM

Trying to design a Z80 based computer that starts from an EEPROM, loads CP/M to RAM and pages out (switches off) EEPROM to allow CP/M to access full 64K RAM. What is a good way of achieving this ? My ...
Charles's user avatar
  • 381
6 votes
3 answers
2k views

Z80 string iteration failing

First Z80 project after 6502, a simple looking piece of code giving me hard time. print_char is a working function which prints contents of A to the screen. My first issue is that the following code (...
Charles's user avatar
  • 381
6 votes
1 answer
617 views

Z80, do I need a resistor for pins to Vcc?

Building a Z80 computer after completing one with 65c02. Z80 on my project needs some pins to be tied high (INT, NMI, WAIT, BUSRQ), these are the ones that I don't need for the time being. There are ...
Charles's user avatar
  • 381
15 votes
1 answer
2k views

How can a Z80 assembly program find out the address stored in the SP register?

I'm wondering how to write a program in Z80 assembler that discovers the value stored in the SP register. From what I've seen, the only instructions that touch the SP register are: LD SP, HL/IX/IY EX ...
André Wagner's user avatar
9 votes
3 answers
1k views

Make the "z80asm" assembler place an instruction at a known memory address

I'm writing a very basic OS for my homebrew Z80 computer. As an absolute assembly language beginner, I managed to obtain a working "os plus memory monitor" that can show memory content and ...
penguin86's user avatar
  • 145
4 votes
2 answers
295 views

Replacing an 8" disk drive with a newer/smaller drive on an old 8-bit computer?

I used to have an out-phased Danish 8-bit computer as a hobby machine back in the 90's. It had two external 8" floppy drives, and I have kept the old floppies. Now I'd like to salvage my old ...
Thorbjørn Ravn Andersen's user avatar
16 votes
8 answers
5k views

Could a Z80 address a total of 128 KB of ROM and RAM?

In a nutshell, could the Z80 address 64 KB of ROM and 64 KB of RAM, or just 64 KB for both RAM and ROM? Unfortunately, I couldn't find an exact and a direct answer to my question while searching. ...
Shams M.Monem's user avatar
12 votes
1 answer
535 views

Ratio of code density between 8080 and Z80

The Z80 was (except for a handful of tiny incompatibilities) a superset of the 8080, adding a number of new instructions as well as the alternate register set. It seems therefore that it must have at ...
rwallace's user avatar
  • 58.4k
9 votes
4 answers
1k views

Better way to do Z80 "bank switch & call"?

I have a memory setup where the whole address space can be exchanged (default 2 slots with 2 banks each, but may change depending on "expansion cards" plugged in). Banks are switched by ...
nonchip's user avatar
  • 223
3 votes
2 answers
688 views

Z80: Interrupt (IM2) daisy chain for "foreign" peripherals

I'm looking for a way (apart from manually wiring up Fig.15 of The Z80 Family Program Interrupt Structure) to daisy chain "non-Z80-family" devices in an IM2 Z80 system i'm designing. So far ...
nonchip's user avatar
  • 223
0 votes
4 answers
546 views

How did graphics processing for old 8/16bit consoles work & what are the differences between an FPU/maths co processor & a graphics card? [closed]

When looking at information on the Internet about old consoles it's rather easy to find information on CPUs like the 6502, 65816, 68000 & Z80 used in retro computers & consoles like the NES, ...
6502Assembly4NESgames's user avatar
5 votes
1 answer
472 views

Why is my program outputting only zeros to the data bus during I/O operations?

I'm building a breadboard Z80-based computer. As now, I have the CPU hooked up to an EEPROM and an I/O device (an HD44780 character display) with appropriate decoding logic. The ROM chip starts at ...
penguin86's user avatar
  • 145
16 votes
1 answer
1k views

Why does the Z80 not have EX DE, IX?

Reading Decoding Z80 Opcodes, There's a section about the 0xDD prefix. This instruction prefix causes the next instruction to use the IX register instead of the HL register. That makes sense. HL and ...
Omar and Lorraine's user avatar
1 vote
1 answer
375 views

Do I need buffers to drive LEDs from the Z80's main bus? [closed]

I'm designing a Z80 based computer and I want to hook up LEDs to the data, address and control busses (for added cool value). So far, the design is gonna be something like this: One board that the Z80 ...
Jachdich's user avatar
  • 121
10 votes
2 answers
730 views

Single-stepping a Z80 - only first instruction is successful

I've wired up a simple Z80 circuit, and I've encountered a strange issue: after successfully executing one instruction, the M1 cycle of the NEXT instruction never completes successfully. Here are some ...
newbie21's user avatar
  • 129
1 vote
1 answer
405 views

Working on programming a retro z80 computer (SDCC error)

I am working on coding a driver of sorts for a Z80 based computer I am making. I am compiling with SDCC and I have been getting the following? ASlink-Warning-Undefined Global 'data' referenced by ...
benjamin black's user avatar
2 votes
0 answers
207 views

Help debugging a circuit/code for Z80 and TMS9918ANL

I am working on designing a Z80 computer that utilized the TMS9918ANL for graphics. I am currently just trying to make sure the TMS9918ANL is working, so I hooked up the control pins the bus (...
benjamin black's user avatar
4 votes
2 answers
1k views

Z80 PIO Keyboard [closed]

I am working on designing a Z80 computer and I would like to use a PS/2 Keyboard for input. I would like to use a PIO to communicate with it, but I am having trouble finding any documentation online ...
benjamin black's user avatar
2 votes
1 answer
581 views

Using Bresenham's circle algorithm (or another alternative algorithm) to draw an arc [closed]

I'm trying to create some graphics function for a ZX Spectrum (Z80) machine in assembler. I already have the basics except for the arc. I know that there must be some way to draw an arc using the ...
Gusman's user avatar
  • 129
5 votes
2 answers
557 views

Why when outputting registers' value the result is a wrong fluctuating value in a Z80 CPU?

I got an EEPROM AT28C64 and loaded it with instructions with my handmade STM32 EEPROM programmer, the instructions are very simple: Load A register with decimal number 85 which is, in binary, ...
Shams M.Monem's user avatar
6 votes
1 answer
390 views

Are all 64k x 4-bit ICs interchangeable for Amstrad-era ZX Spectrum 128k +2/+3?

There were 4 64k x 4-bit Integrated Circuit chips in the Amstrad-era Sinclair ZX Spectrum +2 and +3 models. These are known as the +2A, +2B (both +2 "black"), +3 and +3B (also both black cases). I ...
popeymon's user avatar
  • 423
4 votes
0 answers
280 views

Did the Mega Drive and/or Arcade version of the song "Afterburner" use FM synthesis or samples?

Does anyone know if the Mega Drive or Arcade version of Afterburner use FM synthesis or sound samples for orchestra hit in its song "Afterburner". I find oscilloscope views of each version but I'm not ...
Châu's user avatar
  • 505
55 votes
13 answers
10k views

What languages are better fit for generating efficient code for 8-bit CPU's than C?

I found Why do C to Z80 compilers produce poor code? very interesting as it pointed out that C (which was leveraged to be an abstraction of a CPU for porting Unix) was not a very easy language to ...
Thorbjørn Ravn Andersen's user avatar
2 votes
0 answers
414 views

Why did the Spectrum Next choose Z80 on FPGA? [closed]

I'm curious to understand why the Spectrum Next uses Z80 on an FPGA instead of something like at eZ80? I would have imagined they would choose the eZ80 since it is still a production part. Anyone ...
Duke Dougal's user avatar
13 votes
2 answers
3k views

In 2020 are there fully assembled z80 devices available at reasonable cost? [closed]

I'm wondering if it is possible to buy an sort of device currently in production that uses a z80 compatible CPU - not an FPGA. I don't want to build a kit or use a soldering iron. I'm also looking ...
Duke Dougal's user avatar
22 votes
2 answers
2k views

Will disassembling an 8080 program as Z80 code work?

The Z80 is "binary compatible" with the 8080. It adds a bunch of new instructions, but places them all in unused (well, undocumented) opcodes. Does this mean that if I disassemble an 8080 program (...
tobiasvl's user avatar
  • 1,459
11 votes
1 answer
687 views

How did ZX81 assembly debuggers implement breakpoints?

What techniques were used for implementing breakpoints on the ZX81? Traditionally for the 8086 int 3h is used, for the 8080 on CP/M with DDT RST 7 as single byte replacements, 6502 has the BRK ...
PeterI's user avatar
  • 5,277
12 votes
3 answers
3k views

Decoding Logic and Memory Systems for 8-bit computer - 64K address space

I am creating a minimal Z80 computer with serial output on a breadboard. I have kind of moved up from the last question, where I was executing instructions on Z80 using specific connection of ...
Nogard's user avatar
  • 533
13 votes
2 answers
1k views

Did the Commodore 128's Z80 CPU also have full access to the machine's custom hardware?

The C128 was a C64 with an extra CPU as well as extra memory. But the second CPU was a Zilog Z80 while the primary was the usual Commodore CPU, a MOS 6502. The Z80 was there so that CP/M software ...
hippietrail's user avatar
  • 6,333
15 votes
3 answers
2k views

Are there games for the C128 that run (mainly) on the Z80 rather than the 6502?

The Commodore 128 was a version of the Commodore 64 that also had a Z80 CPU along with its "native" 6502 CPU so the system could run CP/M as well as C64 software. (As well as more RAM and ...
hippietrail's user avatar
  • 6,333
11 votes
2 answers
1k views

Why does the .z80 emulator-snapshot format have separate fields for the 8-bit refresh register and bit 7 of R?

I've been looking at the .z80 file format for Sinclair ZX Spectrum games. Most docs discussing the format include pretty much this wording: Offset Length Description -------------------------...
hippietrail's user avatar
  • 6,333
0 votes
1 answer
425 views

4MHz Z80 timing and PAL video generation

Im trying to get some nice colored lines on some old Z80 system synced to the PAL screen, but having some sort of a problem. First I just need to know if my facts are right. I know that on Commodore ...
Natural Number Guy's user avatar
7 votes
2 answers
472 views

Floating control during bus sharing

I'm building a simple Z80 breadboard computer for my hobby. In this question I use Z80 as an example, but I think this may apply to many CPUs that allow for bus sharing. The problem is as follows. ...
JamMaster's user avatar
  • 173
20 votes
4 answers
4k views

How did integer multiplication work in 8-bit BASIC without CPU support

I've recently been teaching my 11 year old binary multiplication, which is on the UK maths syllabus at secondary school. We have used long multiplication, eg shift and add. This has made me wonder ...
Mark Williams's user avatar
4 votes
2 answers
830 views

ZX Spectrum scroll waiting for user input problem

I'm trying to compile a C program with z88dk for the ZX Spectrum. Using printf(), when the text hits the bottom line of the screen on line 24 the program stops executing until a key is pressed on the ...
cobbm's user avatar
  • 81
4 votes
5 answers
1k views

Z88DK ZX Spectrum "%f" printf not working

I'm attempting to compile a program in C for the ZX Spectrum using Z88DK. However, I'm facing an issue when trying to use printf to print out the value of a float. The code I'm trying to compile: #...
cobbm's user avatar
  • 81
4 votes
3 answers
1k views

When first CMOS versions of Z80 became available and were they ever used in (non-portable) home computers?

When Z80 first became available on the market in 1976 it was made using NMOS technology. It is the version that is likely to be most familiar to people interested in retro-computers. For example, to ...
introspec's user avatar
  • 4,142
14 votes
2 answers
929 views

Does the Z80 allow interrupts after processing and ignoring a 0xdd prefix?

I read here that if the Z80 encounters e.g. multiple 0xdd prefixes in sequence, for each 0xxdd except the last it acts almost like a NOP, but does not allow interrupts to occur immediately after "...
mdm's user avatar
  • 507
22 votes
6 answers
7k views

Why did the Z80 with 4-bit ALU out-perform the fully 8-bit Intel 8080?

Looking at the development and architecture of the Z80, it appears to be a scaled-down, cost-reduced (in terms of total system cost), clone of the Intel 8080. It only used a 4-bit ALU. I assume this ...
Brian H's user avatar
  • 60.1k
10 votes
2 answers
858 views

Zilog Z80 estimated time discrepancy

I am writing a basic Zilog Z80 assembly language interpreter and something I noticed as I went through the 8 bit load commands is that the estimated times for LD (IX+d), n and LD (IY+d), n are ...
mwarren's user avatar
  • 203
16 votes
12 answers
8k views

How can a Z80 assembly program find out its own memory address?

I'm wondering how to write a program in Z80 assembler that discovers its own memory location. I thought that maybe I could somehow load the program counter PC into, for example, BC. Is there a way ...
twisted's user avatar
  • 263
30 votes
2 answers
5k views

Zilog Z80 freezes while binary counting up to 65 536 (2^16)

A few days ago, I got Z80A CPU from eBay. So I tried to run it with classic 555 timer as a clock signal generator. I connected the 8-bit data bus of the CPU to the ground to "simulate ROM" (00 for NOP)...
Nogard's user avatar
  • 533
11 votes
2 answers
595 views

Where to share/who may be interested in IEEE 16 bit half float library for Zilog Z80?

I have recently developed a half-float/16-bit float library (link to Github) for Zilog Z80. It was a part of my project to run some neural network and graphics POCs for ZX Spectrum. The library uses ...
Artyom's user avatar
  • 263
15 votes
1 answer
2k views

What are the "ports" used via IN/OUT, vs. the PEEK/POKE address space?

This is something of a followup to How much control of TRS-80 Model III disk drives was possible from its Cassette (ROM) BASIC? but on a more general topic: I know that PEEK and POKE enable direct ...
natevw's user avatar
  • 2,917
12 votes
4 answers
3k views

Accelerators for Z80 micros?

I am familiar with the various accelerator products that were developed over the years to improve the performance of popular 6502 home micros. A short list of the particularly well known devices would ...
Brian H's user avatar
  • 60.1k
7 votes
1 answer
803 views

How much did it cost to develop the Z80 CPU?

How much did it cost, in dollars at the time, to develop the Zilog Z80 CPU? According to Wikipedia, The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. ...
rwallace's user avatar
  • 58.4k