Questions tagged [z80]

For questions regarding the Zilog Z80 microprocessor

Filter by
Sorted by
Tagged with
3
votes
1answer
192 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
191 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 ...
7
votes
1answer
316 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 ...
10
votes
1answer
613 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
273 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
429 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
182 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
617 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
247 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
185 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
172 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
265 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....
19
votes
2answers
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 ...
8
votes
1answer
481 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
320 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....
17
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
394 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
289 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
1k 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
176 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
3k 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
351 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 ...
6
votes
4answers
500 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
284 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
228 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
374 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 ...
7
votes
1answer
739 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
239 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
441 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
202 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
146 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
721 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
398 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
379 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
254 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
157 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 ...
49
votes
13answers
7k 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 ...
1
vote
0answers
238 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 ...
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 ...
18
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
378 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 ...
12
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 ...
12
votes
2answers
857 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 ...
11
votes
3answers
824 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 ...
7
votes
2answers
724 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 -----------------------...
0
votes
1answer
262 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
352 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. ...