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
8 votes
1 answer
586 views

Size-optimization of a 256-byte "LDIR" adapter

I'm working on tweaking ABC-800 BASIC II machine code, and there's a routine there that does a "256-byte" equivalent of LDIR. B is not used, C=0 transfers 256 bytes, C=1 transfers 1 byte, ...
Kuba hasn't forgotten Monica's user avatar
3 votes
1 answer
204 views

Do Z80 datalines need termination [closed]

If I am using a z80 can you just tie all data lines to the ROM 28c16 or do they need termination via 10k ohm resistors to ground?
Mwendt's user avatar
  • 31
4 votes
3 answers
615 views

Compressing a list of records so it can be uncompressed elementwise [closed]

I have a bunch of lists of generic items (byte sequences) and I would like to store them compressed. There are several tools out there that run on modern computers to compress data into as-small-as-...
Cactus's user avatar
  • 2,700
5 votes
2 answers
621 views

ZX Spectrum+ 48K with faulty memory writing address

I have ZX Spectrum+ 48k (board issue 6a) with writing to memory issue. When I try to write a value by POKE command to address 49152 (C000h) then it overwrites additionally value with address 16384 (...
vikkk's user avatar
  • 51
13 votes
3 answers
2k views

What's the convention for < > low/high-byte in 8-bit assembler?

It's a little hard to Google for greater-than and less-than symbols in assembler math... If you saw, let's say, 6502 code like... lda #>SOME_LABEL or Z80 code like... ld a,>SOME_LABEL ...would ...
Luxocrates's user avatar
2 votes
3 answers
571 views

Z80 to 68000 translator for CP/M

CP/M was mostly portable across systems but most of them were z80 based. It was ported to 8086, 68000 and maybe more but without binary compatibility. No z80 systems that wanted CP/M compatibility ...
Valentino Miazzo's user avatar
-2 votes
1 answer
186 views

With reference to the Z80-MBC2 retro computer's SD card module: Is it possible to hook it up for dual access by let's say a Pi Zero [closed]

With reference to the Z80-MBC2 retro computer's SD card module: Is it possible to hook it up for dual access by let's say a Pi Zero. So my idea is that if I could do a little hack on the SD card ...
Susan's user avatar
  • 99
8 votes
4 answers
2k views

"Mainframe" with Z80 [closed]

Maybe a silly question but has there ever been a mainframe OS running on a Z80 system, of course with sufficient memory and memory management unit? I'm thinking of a ported MVS running, with TSO, the ...
Hennes's user avatar
  • 183
16 votes
2 answers
827 views

Long Term Prevalence of 8080 Code Over Z80 Code in Software Packages

TL;DR: The Z80 was introduced not long after the 8080 and replaced it quickly and almost entirely for personal computing. Still, a large chunk of new software written stayed with 8080 code, making no ...
Raffzahn's user avatar
  • 219k
4 votes
1 answer
234 views

Was the S-83 Personal CP/M CPU used in commercial computers?

The June 1984 edition of Practical Computing magazine (page 43) refers to the American Microsystems Incorporated S-83 CPU as a Z80 compatible CPU with an 8K mask ROM capable of holding Digital ...
scruss's user avatar
  • 21.5k
31 votes
6 answers
3k views

Managing registers/memory effectively on the Z80

I've been writing assembly for the Z80 for some time, lately. Initially, I had no experience with working with 8-bit processors, but after going through a tutorial for my platform and spending a lot ...
v-rob's user avatar
  • 455
2 votes
1 answer
337 views

Is NEC's PC-88VA compatible with N88-BASIC(86)

First, N88-BASIC runs on all PC-88. It's a japanese Z80 computer, but PC-88VA are 16-bit, like the PC-98 and wonderswan. Instead, PC-98 runs N88-BASIC(86), which is different. I think only the PC-98DO ...
Ciel Ruby's user avatar
  • 545
8 votes
1 answer
703 views

Z80 interrupt acknowledging

I have a question about the Z80 interrupt handling. This processor has 3 modes: 0, 1, and 2. Modes 0 and 2 are supposed to fetch something from the data bus, and a protocol exists to inform the ...
ozw1z5rd's user avatar
  • 429
2 votes
1 answer
214 views

Why does Z80 RC2014 ROM image 88 not have CP/M or BASIC boot options?

While trying to boot to CP/M automatically on my RC2014 Z80, I encountered a problem getting SCM to show a CP/M boot option. According to the docs, ROM address 4000 (88 on the ROM label) is SCM with ...
Nick Bolton's user avatar
9 votes
4 answers
1k views

Testing "8-bit readiness" with an emulator or pre-packaged kit

I'm working on a project that intends to implement a dynamically typed language on 8-bit systems. (That is, a CPU with 16-bit pointers and a maximum of 64 kB of RAM. Some language tricks are involved, ...
Jim Pivarski's user avatar
5 votes
1 answer
391 views

Z80 Bus Control by External Device: /BUSRQ or /RESET?

I'm designing a Z80 system from scratch. My approach is to only have one memory device, a big SRAM, that covers the entire 64 KB memory block. A sub-system on the board will be a microcontroller (MCU)....
Smith's user avatar
  • 153
17 votes
4 answers
4k views

Was the ZX Spectrum used for serious number crunching?

From Eurogamer’s obituary of Sir Clive Sinclair: Sinclair never intended for his computers to be games machines, but that was what the market decided they were. Within the space of a few years, the ...
user1095108's user avatar
3 votes
1 answer
315 views

Why memory read (M2) cycle in Z80 is three T cycles and not two?

In Z80 memory read cycle is three T cycles, but, 2nd cycle only does "WAIT", and it appears timing would work with just two cycles unless the "WAIT" does something important. What ...
BipedalJoe's user avatar
8 votes
2 answers
2k views

Can the Z80 Bus Request be used as an NMI?

I was reading the Z80's official manual by Zilog, and there's a passage in the description for the BUSREQ pin that states "Bus Request contains a higher priority than NMI and is always recognized ...
aofarmakis's user avatar
27 votes
5 answers
5k views

Did underclocking the early Z80 chips improve yield?

The Z80, one of the most successful and well-known of the 8-bit microprocessors, was released in July 1976 at an initial clock speed of 2.5 MHz. The TRS-80 Model I, released the following year, is ...
rwallace's user avatar
  • 60.3k
3 votes
3 answers
1k views

Z80: asymmetric use of B in DJNZ (B is a low byte) vs. BC in LDIR (where B is a high byte)

Am I missing something or is Z80 weird in its use of the B and C registers? If I want to copy memory, I have this super cool LDIR instruction which copies (HL) to (DE) BC times and incrementing HL and ...
Gunther Schadow's user avatar
16 votes
3 answers
3k views

Z80 is making weird relative jump errors. How can that be?

My little Z80 breadboard project got stuck in the mud where I am pulling my hair out. It looks like the CPU is making a calculation error on a relative jump. Here is my code, and I don't think ZX ...
Gunther Schadow's user avatar
4 votes
3 answers
586 views

Z80: can you transfer the program counter (PC) to a general register (e.g., HL)? [duplicate]

New to Z80, coming from 6502, the instruction set appears hugely CISCY. And yet, I cannot find a simple method to inspect the PC (transfer PC to a general purpose register, e.g., HL). I need this to ...
Gunther Schadow's user avatar
5 votes
1 answer
743 views

Is there a way to boot CP/M automatically on a Z80 RC2014?

I'm using the RC2014 (Z80), running CP/M. The "24886009" ROM chip (photo below) comes with 32k BASIC, 56k BASIC, SCM and CP/M for SIO/2 serial. When you run CP/M from the RC2014 ROM, you ...
Nick Bolton's user avatar
6 votes
2 answers
2k views

How can SPI be used with a Z80 CPU to control an RFM95 LoRa module?

I’m trying to communicate with my Z80 computer (RC2014) using a wireless radio. The easy way to do this is to use something like an ESP8266 (and there’s even an RC2014 module for this), but where’s ...
Nick Bolton's user avatar
6 votes
1 answer
493 views

How do I read a port value using Turbo Pascal inline code on CP/M?

After successfully using port[0] to read a port value in Turbo Pascal, I thought I'd try to understand how to do this using inline assembly/machine code. I'm able to write to the port (my OutPort ...
Nick Bolton's user avatar
2 votes
2 answers
371 views

From an electrical and software engineering perspective, ignoring available software, should I go for the Z80 or 65C02? [closed]

This might be a weird title but I noticed that recommendations for one over the other usually go into a direction that is not too helpful for me. I would like to build an 8 bit computer and picked ...
Asyx's user avatar
  • 29
14 votes
5 answers
4k views

How did early video terminals convert ASCII into font graphics?

I'm building a Z80-based breadboard computer from scratch to learn more about simple processors, and I'm a bit stumped when it comes to the base concepts of building a text-based terminal. I've got an ...
lowercasename's user avatar
10 votes
2 answers
678 views

Simulating a 8085 using a Z80?

I am studying the replacement of a 8085 with a Z80 (I am aware that they are not pin-compatible, the solution is to be made in a board of new design rather than on the old board). The sole reason is ...
Borg Drone's user avatar
5 votes
1 answer
552 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 ...
Alvaro Polo's user avatar
21 votes
5 answers
4k 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 ...
Shades's user avatar
  • 321
13 votes
1 answer
826 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 "...
Vlad's user avatar
  • 1,541
32 votes
2 answers
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 ...
Paolo Amoroso's user avatar
4 votes
2 answers
377 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 ...
Omar and Lorraine's user avatar
11 votes
4 answers
2k 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 ...
cjs's user avatar
  • 25k
1 vote
1 answer
326 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 ...
puppydrum64's user avatar
  • 1,638
9 votes
1 answer
2k 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 ...
puppydrum64's user avatar
  • 1,638
12 votes
1 answer
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 ...
Greenonline's user avatar
  • 3,994
4 votes
1 answer
362 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 ...
Keolai's user avatar
  • 43
4 votes
3 answers
359 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 ...
Kpalser's user avatar
  • 143
9 votes
3 answers
2k 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 ...
user1095108's user avatar
14 votes
1 answer
4k 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 ...
Thorbjørn Ravn Andersen's user avatar
5 votes
2 answers
570 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 ...
RaspbJan's user avatar
7 votes
1 answer
2k 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 ...
Shams M.Monem's user avatar
6 votes
1 answer
750 views

Source code for Logo in Z80 assembly

I am looking for a source code for Logo written in Z80 assembly (the complete language, not only the turtle part). I found the disassembly of Terrapin Logo for Apple 2e but it is 6502. Ideally, it ...
joaopa's user avatar
  • 169
7 votes
2 answers
970 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 ...
hippietrail's user avatar
  • 6,636
7 votes
3 answers
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 ...
mdm's user avatar
  • 507
4 votes
2 answers
308 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:...
Charles's user avatar
  • 381
0 votes
1 answer
534 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 ...
Mateusz Szebestik's user avatar
0 votes
2 answers
459 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 ...
nooblet's user avatar