Skip to main content

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
4 votes
2 answers
281 views

Are a Z80 address pins tristate?

I been looking at the Z80 CPU recently and am wondering how difficult it would be to wire one up. The thing I'm interested in is how to connect it to some RAM. In particular, I'd like to know if the ...
Stormcloud's user avatar
7 votes
1 answer
529 views

How to best use IX as a return stack

I'm new to Z80 assembler and am porting a Forth interpreter from a J1 stack machine to a Z80 based board. The Z80 port uses SP for the data stack, and IX for the return stack. The port uses a normal ...
Look Alterno's user avatar
9 votes
3 answers
2k views

What is the purpose of the M1 pin on a Z80

I've been looking through bits of documentation about the (sadly recently discontinued) Z80 processor and the machines people have built with it. One thing I noticed is pin 27, called "M1", ...
Stormcloud's user avatar
3 votes
2 answers
348 views

NES vs SMS ROM speed

The NES used a 6502-derived CPU at 1.79 MHz. The Sega Master System used a Z80 at 3.58 MHz. How did they differ in terms of what speed grade ROM they required in their respective cartridges? I know it'...
rwallace's user avatar
  • 63.1k
0 votes
2 answers
207 views

ASM as a DSL of a HLL? [closed]

There used to be a lot of discussion as regards embedding DSLs (Domain Specific Languages) into high-level languages (HLLs). The only example, where this is possible, I know of, is c++ and I had ...
user1095108's user avatar
13 votes
3 answers
1k views

What are some tracing disassemblers for the Z80

What are some some tracing disassemblers for the Z80? I.e., disassemblers that will trace through the code and disassemble as instructions only the areas it traces through, leaving the rest as data. (...
cjs's user avatar
  • 27k
4 votes
1 answer
297 views

What is R register and DRAM refresh internal operation

Resources say that R value gets incremented by Z80 after each M-cycle, and that R is used in Dynamic RAM refresh mechanism (avoiding charge leakage). My questions: how concrete value of R (say, #11) ...
Max's user avatar
  • 285
14 votes
2 answers
1k views

Is there any way to read current Interrupt Mode in Z80 machine code?

Is there any way to read current Interrupt Mode in Z80 machine code? Official Z80 datasheet mentions IMFa/IMFb registers which keep the mode value. Thank you
Max's user avatar
  • 285
3 votes
1 answer
266 views

Does Altair Basic actually risk wiping itself out of memory in its auto-memsize initialization?

I've recently designed and built a modern Z80 single board computer based on a Z80 IPC chip. It's general purpose, and though I did not design it for compatibility to Altairs, I decided that my first ...
scm's user avatar
  • 1,129
3 votes
4 answers
654 views

Why is Z80 called a 8-bit CPU? [duplicate]

Z80 has a 16-bit address bus and 16-bit arithmetic instructions such as add hl,de. Why is it still called a 8-bit CPU?
xiaokaoy's user avatar
  • 141
5 votes
2 answers
198 views

Change text color in Z80 assembly for Amstrad CPC 464

I am trying to code this program, similar to game: "The Typing of The Dead" in Amstrad CPC 464 using Assembly language for the Z80 processor. The program consists in when you see a string of ...
reymagnus's user avatar
  • 173
8 votes
1 answer
601 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
231 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
642 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,760
5 votes
2 answers
655 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
634 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
213 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
897 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
  • 228k
7 votes
2 answers
352 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.8k
31 votes
6 answers
4k 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
  • 857
2 votes
1 answer
441 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
  • 555
8 votes
1 answer
762 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
  • 439
2 votes
1 answer
238 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
454 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
  • 152
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
407 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
  • 63.1k
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
683 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
792 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
548 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
379 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
15 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
719 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
620 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
22 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
  • 331
13 votes
1 answer
861 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
5k 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
415 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
13 votes
6 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
  • 27k
1 vote
1 answer
415 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
  • 4,406
4 votes
1 answer
383 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

1
2 3 4 5