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
5
votes
1answer
155 views

Z80 CPU and nested/reentrant NMI

According to multiple documentation sources, non-maskable interrupts (NMIs) can be nested (or reentrant) in a Z80 microprocessor. This is, upon a /NMI signal pulse, the CPU will interrupt the current ...
19
votes
5answers
3k views

How did old computers address far more than 64K of memory despite only having a 16 bit address bus?

I have an old Sharp PC-G830 pocket computer from the '80s that has 32K of RAM and 256K of ROM. I also have a simple single board computer I built with 128K of RAM and a few megabytes of ROM from a ...
12
votes
1answer
593 views

Z80 refresh pin, is it tri-state or not

I'm planning out a protocol bridge between ZX Spectrum clone system bus and an FPGA-based extension device. I am considering adding bus request/acknowledge support for DMA purposes, but reading "...
27
votes
2answers
4k views

Why did the Z80 break 8080 compatibility?

Although the Z80 is nearly fully backward compatible with the Intel 8080, there are minor differences such as the Z80 handling the parity flag differently with certain operations. Why? Would providing ...
3
votes
2answers
204 views

How does the serial port on the RC2014 get addressed?

I see on the schematic that /M1 and A7 go to CS0 and CS1 respectively. As I recall, both of these need to be high for the chip to be selected. And A6 goes to CS2, which needs to be low for the chip to ...
10
votes
4answers
1k views

Could the Z80 do interference-free video as the 6502 could?

Technically this isn't just about video since it applies to any regularly scheduled DMA¹ from a non-CPU subsystem, but video is the most common application of this technique so I'll use that as the ...
1
vote
1answer
178 views

How does RETN return from NMI on the Z80 in the event of nested NMI?

I was trying to learn how the Sega Master System works. The NMI occurs when the pause button on the console is pressed. So I wrote an NMI handler that makes a beep when the NMI occurs, then waits for ...
8
votes
1answer
1k views

Why does the Z80 JP (absolute) instruction always take 10 states to execute?

I've looked at a few different websites and they all agree that a JP nnnn instruction (where nnnn is a 16-bit address) always takes 10 states to execute. According to what I've read, all of the ...
11
votes
1answer
1k views

Is I/O port 0xFE reserved on the eZ80?

TL;DR Following on from OmarL's comment, to the closed question, Why did the Spectrum Next choose Z80 on FPGA?: But also, the eZ80 is not compatible with the ZX Spectrum because it uses port FE for ...
4
votes
1answer
236 views

ZX Spectrum coordinates to bitmap conversion subroutine acting strange

I originally posted this question on stackoverflow, but I wrote a little program that converts coordinates stored in the b and c registers of the z80 into their corresponding memory address for the ZX ...
3
votes
2answers
210 views

What would be the value on the data bus for a Jupiter ACE with the Z80 Interrupt Mode 2?

I am writing an emulator for the Jupiter ACE. I assumed the idle bus value would be 0xFF like the ZX Spectrum. Other emulators for the Jupiter ACE seem to assume the same. If there are no peripherals ...
9
votes
3answers
773 views

C++ compilation for the Z80 and 6502?

I know it's almost heresy to ask something like this, but ... We have C compilers for the Z80/6502 and there used to exist a thing called the Comeau C++ compiler, that produced C code as output. There ...
11
votes
1answer
1k views

Good Z80 disassembler/decompiler on modern equipment?

I have a hobby project with an old CP/M-80 system, where I now would like to disassemble/decompile some compiled code – a ROM and some small executables – into assembly source so I can regenerate the ...
5
votes
2answers
318 views

Is there a way to work around the maximum clock rate of Z80 PIO chips?

I would like to assign a Z80 PIO chip to my homebrew Z80 "computer". Unfortunately, what I've recently noticed in the datasheet, chip version which I actually have: Z0842006PSC can handle ...
7
votes
1answer
579 views

The proper way to shift a byte using a Z80

In a nutshell, why can I not shift a byte using this way? LD A, 11110000b ; I want this to be 00001111b LD C, 4 SRA C OUT (0), A ; doesn't give correct number What is the proper way of shifting a ...
4
votes
0answers
270 views

Source code for Logo in z80

I look for a source code for Logo written in z80 (the complete language, not only the turtle part). I found the dissasembly of Terrapin Logo for Apple 2e but it is 6502. Ideally, it would fit in 16K. ...
6
votes
2answers
690 views

Did any ZX Spectrum clones use the Z80's interrupt mode zero?

The standard Sinclair ZX Spectrum only used mode 1 and mode 2 interrupts but the Z80 also has a mode 0 interrupt that the original Speccy never used. But there were many exotic clones of the ZX ...
6
votes
3answers
1k views

How long are interrupt requests remembered on the Amstrad CPC?

I'm trying to emulate an Amstrad CPC 464. Currently, I'm working on interrupt handling and I'm wondering: Some Z80 instructions, like EI or decoding multiple consecutive 0xdd prefixes don't accept ...
4
votes
2answers
259 views

Cannot assemble BASIC with high memory workspace (Z80)

This is a homebrew Z80 computer, using Z80, 64K RAM, EEPROM as well as SIO/0. I am trying to run BASIC, however I need to set the workspace at 0xC000 or higher. The code I am using is similar to https:...
0
votes
1answer
202 views

Does this schematic of the Zilog Z80 central unit contain any other errors? [closed]

For an assigment I have to check this schematic of an Z80 and find possible errors. The schematic looks like this: The left side of this schematic is correct, but we have to find errors in the right ...
0
votes
2answers
188 views

Z80 - "LD (nn), dd" command cycle [closed]

For a university assignment, I have to describe and draw the command cycle of the LD (nn), dd command. To be exact, I was given this command: LD (0x1000), BC which I interpret as putting the low ...
3
votes
1answer
340 views

Z80 - SIO/0 Frequencies

Z80 board with a SIO/0. I am struggling to understand how CPU and SIO frequencies are related, if they are at all. SIO/0 datasheet didn't help much. If I clock both the CPU and the SIO(TX/RX) from a 1....
21
votes
3answers
2k 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 ...
9
votes
1answer
627 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 ...
4
votes
1answer
428 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....
18
votes
6answers
3k 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 ...
5
votes
2answers
467 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 ...
6
votes
3answers
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 (...
6
votes
1answer
341 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 ...
14
votes
1answer
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 ...
9
votes
3answers
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 ...
4
votes
2answers
199 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 ...
15
votes
8answers
4k 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. ...
12
votes
1answer
417 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 ...
9
votes
4answers
752 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 ...
3
votes
2answers
332 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 ...
0
votes
4answers
254 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 on the internet at information about old consoles it's pretty easy to find out information on CPUs like the 6502, 65816, 68000 & Z80 used in retro computers & consoles like the ...
5
votes
1answer
388 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 ...
8
votes
1answer
821 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 ...
1
vote
1answer
273 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 ...
9
votes
2answers
486 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 ...
1
vote
1answer
241 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 ...
2
votes
0answers
155 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 (...
4
votes
2answers
800 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 ...
1
vote
1answer
424 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 ...
5
votes
2answers
417 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, ...
5
votes
1answer
283 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 ...
2
votes
0answers
168 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 ...
50
votes
13answers
8k 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 designed to be an abstraction of a CPU for porting Unix) was not a very easy language to ...
2
votes
0answers
327 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 ...