Questions tagged [z80]
The Zilog Z80 microprocessor. Prefer [game-boy] instead for questions about the Game Boy CPU nicknamed the ‘GBZ80’.
202
questions
4
votes
2
answers
308
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 ...
7
votes
1
answer
553
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 ...
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", ...
3
votes
2
answers
365
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'...
0
votes
2
answers
214
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 ...
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. (...
4
votes
1
answer
333
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) ...
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
3
votes
1
answer
273
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 ...
3
votes
4
answers
674
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?
5
votes
2
answers
204
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 ...
9
votes
1
answer
614
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, ...
3
votes
1
answer
246
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?
4
votes
3
answers
651
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-...
5
votes
2
answers
666
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 (...
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 ...
2
votes
3
answers
655
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 ...
-2
votes
1
answer
222
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 ...
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 ...
16
votes
2
answers
914
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 ...
7
votes
2
answers
386
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 ...
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 ...
2
votes
1
answer
469
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 ...
8
votes
1
answer
781
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 ...
2
votes
1
answer
242
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 ...
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, ...
5
votes
1
answer
481
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)....
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 ...
3
votes
1
answer
446
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 ...
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 ...
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 ...
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 ...
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 ...
4
votes
3
answers
718
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 ...
5
votes
1
answer
800
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 ...
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 ...
6
votes
1
answer
560
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 ...
2
votes
2
answers
381
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 ...
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 ...
10
votes
2
answers
730
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 ...
5
votes
1
answer
631
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 ...
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 ...
13
votes
1
answer
872
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 "...
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 ...
4
votes
2
answers
426
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 ...
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 ...
1
vote
1
answer
422
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 ...
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 ...
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 ...
4
votes
1
answer
387
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 ...