Questions tagged [z80]
The Zilog Z80 microprocessor. Prefer [game-boy] instead for questions about the Game Boy CPU nicknamed the ‘GBZ80’.
217 questions
7
votes
0
answers
262
views
Z80 Memory Bank Switching
Edit: sorry it's so many words. I thought it might be helpful to share as much as I have learned so far as possible.
Also, here's the link to service manual that includes the schematics.
https://www....
1
vote
3
answers
420
views
How to automatically set the random seed in Microsoft Z80 BASIC?
I am trying to find a way to automatically set the random seed in Microsoft Z80 Basic 4.7b on an RC 2014, as one would in Sinclair BASIC with RAND or RANDOMIZE.
I have got as far as understanding that ...
11
votes
3
answers
1k
views
16-bit comparisons setting both zero and carry flag on 8080/Z80
I have a routine cpBCHL that compares the contents of BC and HL and returns the carry set appropriately:
; ----------------------------------------------------------------------
; ♠BCHL ♣A ♡* ...
20
votes
4
answers
3k
views
What was the last commercial Z80-based computer sold?
Obviously, with the rise of retro in computing, today there are lots of Z80-based machines in the retro market. Thus, I would exclude anything later than maybe 2005 or obviously targeted at the "...
9
votes
2
answers
2k
views
Space Invaders ships remaining not initialized
I'm referencing this Space Invaders code.
(I'm porting this to another processor and I'm trying to understand it.)
The p1ShipsRem variable doesn't seem to be initialized, but it is tested early in the ...
8
votes
1
answer
479
views
Original Space Invaders message routine with delay
I'm referencing this Space Invaders code.
Could someone explain why the PrintMessageDel routine checks for a delay value of one instead of zero?
The interrupt service routine decrements the isrDelay ...
4
votes
0
answers
217
views
CF Card Issues - DIY Z80 COMPUTER from scratch - CP/M frozen after boot
has anyone here ever had a similar problem? I'm basically trying to use my CF card interface board that used to work with another memory card, which unfortunately got damaged (my fault). Now I only ...
11
votes
0
answers
337
views
What was and where can I find OS-1 for the Z80?
On page 269 of the June 1980 issue of BYTE there is an advertisement from Electrolabs (in Stamford, CT) for an operating system called OS-1, a "new Unix-like operating system for Z-80."
Did ...
4
votes
1
answer
217
views
What's the max output current for Z80 PIO output pins - (Z84C2010VE6)?
I'm working with a Zeal 8bit board and I want to connect the pins from Z80 PIO Port A to external components, let says LEDs. With a 2.2k resistor and a 5V power supply the calculated current is 1.5 mA....
4
votes
1
answer
329
views
In a 48K Spectrum why are there 5 successive contended cycles in JR?
In a 48K Spectrum, the contention pattern for the JR instruction (see e.g. https://sinclair.wiki.zxnet.co.uk/wiki/Contended_memory) is:
pc:4, pc+1:3, pc+1:1, pc+1:1, pc+1:1, pc+1:1, pc+1:1
There is ...
18
votes
1
answer
2k
views
Why does the ZX Spectrum ROM set I register, then wait 24 T-states?
I’m doing some low-level, interrupt-based Z80 Spectrum programming, and, investigating the ROM, found this oddity (clipped from The Complete Spectrum ROM Disassembly), in the ROM initialisation/...
9
votes
1
answer
612
views
Is there a mistake in the code sample in “Programming the Z80” performing 16-bit by 8-bit division?
Programming the Z80 (3rd edition) has the following code sample (section 3 p.135) for division of a 16-bit dividend by an 8-bit divisor returning an 8-bit quotient in L and an 8 bit remainder in H:
...
7
votes
1
answer
462
views
How does the Z80 NMI edge detection work?
The Z80 user manual (um0080.pdf) is basically useless for finding out many details about NMI. The diagram is broken and there's no mention that it's edge-triggered rather than level-triggered like INT ...
10
votes
3
answers
1k
views
How was MP/M’s time sharing implemented?
MP/M, the multi-user sibling of Digital Research ubiquitous CP/M, implemented time-sharing in a way that appears to be very efficient. Processes don’t appear to see each other’s memory and performance ...
9
votes
1
answer
266
views
Triggering Amstrad BASIC/System errors from machine code
I'm writing some machine code that's intended to be executed from BASIC with a CALL and I'd like to trigger genuine errors just like running ERROR 5 (Improper argument) from BASIC.
I have the book The ...
5
votes
2
answers
409
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
696
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
3k
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
498
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
256
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 ...
14
votes
3
answers
2k
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. (...
5
votes
1
answer
599
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
332
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
860
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
273
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
654
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
302
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
705
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
785
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
3k
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
797
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
266
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 ...
17
votes
2
answers
1k
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
458
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 ...
39
votes
6
answers
5k
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 ...
3
votes
1
answer
640
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
898
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
306
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
641
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)....
20
votes
6
answers
5k
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
629
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
920
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
917
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 ...