Questions tagged [z80]

For questions regarding the Zilog Z80 microprocessor

Filter by
Sorted by
Tagged with
0
votes
1answer
136 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 ...
10
votes
3answers
456 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 other ...
1
vote
0answers
105 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
1answer
472 views

Z80 PIO Keyboard

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 ...
16
votes
12answers
6k 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 ...
41
votes
12answers
6k 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 ...
15
votes
2answers
635 views

What is known about the internal workings of the Z80?

There is a wonderful project called Visual6502, and I've used it from time to time to figure things out, like exactly the difference between rti and rts. It is good to see which control lines were ...
33
votes
16answers
9k views

Did anyone ever use the extra set of registers on the Z80?

The Z80 has the surprising feature of a second set of registers. I suppose these were intended to be used for rapid task switching or interrupt handling, though I think if I were programming a Z80 ...
12
votes
2answers
653 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 ...
28
votes
4answers
6k views

What's the difference between “opcode” and “instruction” in this Zilog ad?

In a Zilog ad from 1976 comparing the Z80 and Intel 8080, the following table is presented: What is the difference here between "Instructions" and "OP Codes"? In my experience, the two terms are ...
30
votes
3answers
3k views

What are the registers W and Z inside a Z80?

Looking at the Z80's architecture diagram, there is the obvious register file in pink near the middle of the diagram. But four of those registers are not usable by programmers. Those are W, W', Z and ...
5
votes
2answers
315 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, ...
1
vote
1answer
194 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 ...
4
votes
5answers
528 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: #...
5
votes
1answer
193 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 ...
7
votes
4answers
4k views

How can a Z80/8080/6502 use VGA?

I've come across a couple of projects that manage to get VGA working with the Z80 and similar CPUs: Veronica (6502 CPU, VGA signal generation by AVR) ZC160 (Z80 CPU, VGA signal generation by GAL) c-...
1
vote
0answers
122 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 ...
11
votes
3answers
2k 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 ...
13
votes
2answers
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 ...
1
vote
0answers
120 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 ...
17
votes
1answer
1k 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 (...
10
votes
1answer
297 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 ...
19
votes
4answers
3k 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 ...
8
votes
2answers
1k views

Is the Game Boy Sharp LR35902 object-compatible with the 8080/Z-80?

(Note: by "object-compatible" I mean that the opcodes and their following operands are the same—the assembler produces the same output for equivalant assembler mnemonics. This of course ...
3
votes
2answers
404 views

Sinclair ZX Spectrum with DivMMC load issue

I use a Sinclair ZX Spectrum Issue 2 with a DivMMC EnJOY! Pro One and the boot process shows no error and I'm even able to enter the file browser but if I choose any game/demo/program I get always ...
18
votes
5answers
3k views

Why does the Z80 have a half-carry bit?

The Z80 apparently had a 4-bit ALU, and computes 8-bit values in two stages. The half-carry bit preserves the carry from bits 3 to 4. Why did the designers of this chip choose to preserve that value ...
14
votes
3answers
2k views

Why do only the low 7-bits of the R register increment?

On the Z80 the R register is 8 bits wide, as evidenced by LD A,R and LD R,A And every M1 cycle, R increments by 1. But the uppermost bit does not participate in this increment. R will not go from 0x7F ...
7
votes
2answers
578 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 -----------------------...
15
votes
1answer
1k 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 ...
10
votes
3answers
1k views

Comparing Signed Numbers on Z80 (8080) in Assembly

How do you compare two signed numbers in Z80 assembly? According to this site, To compare stuff, simply do a CP, and if the zero flag is set [then] the argument[s] were equal, else if the carry ...
34
votes
2answers
2k views

Can the two CPUs in a Commodore 128 run at the same time?

The Commodore 128 has two CPUs. One is some variant of the 6502, and the other is a Z80. One CPU is there for compatibility with the Commodore 64 and the other is there presumably to give basic ...
0
votes
1answer
168 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 ...
7
votes
2answers
312 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. ...
4
votes
2answers
224 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 ...
2
votes
1answer
216 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 ...
11
votes
3answers
2k views

Role of the Z80 co-processor in GBA games

The Nintendo Game Boy Advance had a Z80-like processor which was typically used for backwards compatibility with GB and GBC games. According to its Wikipedia page, an uncited comment claims that the ...
14
votes
2answers
764 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 "...
16
votes
5answers
5k 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 ...
10
votes
2answers
742 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 ...
24
votes
5answers
4k views

DIY Project using 1970s 8-bit CPU, is it possible?

I've recently really wanted to try and design a computer system around a retro 8-bit CPU such as the Zilog Z80 or the Intel 8080, and I would appreciate some sanity checks! I was inspired by Ben Eater'...
9
votes
4answers
2k views

How do Z80 Block Transfer instructions work?

I'm familiar with the Hitachi 6309's block transfer instructions (TFM). It can work as a "poor man's" DMA controller or Blitter, and is one of the things that makes the 6309 the best 8-bitter of all ...
30
votes
2answers
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)...
13
votes
7answers
2k views

Z80 and video chip contending for random access

Back in the 8-bit days, I used 6502 computers, where the story about memory access was easy to understand. RAM chips of the late seventies and early eighties could do 2 MHz (or a bit more e.g. 2.6 in ...
9
votes
2answers
319 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 ...
13
votes
4answers
2k 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 ...
2
votes
1answer
459 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. ...
4
votes
2answers
948 views

Z80 Interrupt Mode 2 - How does the CPU know the device address of the interrupting device to execute IN A,(*)?

I've read about the Z80 interrupt priority daisy chain and it hasn't answered my question. When using interrupt mode 2, the Z80 needs to form a 16-bit address for an interrupt service routine. The ...
12
votes
3answers
2k views

Why does this ZX Spectrum machine code “Hello World” routine not produce the expected result?

This is probably an easy one, but I'm stumped. I want to run this ZX Spectrum Hello World routine on my Sinclair ZX Spectrum 48k. I'm going to describe all the steps I took so it's easier to see ...
37
votes
5answers
6k views

Did any computers use the Z80B?

The Z80 was one of the most popular CPUs of the seventies and eighties. In almost all cases that I know of, the version used was the Z80A, rated for 4 MHz, sometimes clocked a little slower in order ...
38
votes
10answers
11k views

Fastest non-emulated CP/M Z80-based computer ever built?

What was the fastest CP/M computer ever built? I'll restrict this to the Z80 variant of CP/M, no CP/M-86, CP/M-68k etc. Z80 compatibles with higher clock frequencies or more instructions/clock or ...