Questions tagged [z80]

The Z80 is an 8-bit CPU designed by Zilog to be a backwards-compatible enhancement of the Intel 8080. It has been in continuous wide use since 1976 and was formerly popular in microcomputers, such as models of the Tandy (Radio Shack) TRS-80 microcomputer and their derivatives, the ZX Spectrum and the MSX standard. Presently its main use is in embedded systems.

Resources on the Internet:

The Zilog Z80 CPU User Manual

Rodnay Zaks wrote a classic book on the Z80: Programming the Z80

See also:

182 questions
5
votes
3 answers

List for TI-84 z80 assembly calls?

I am searching for a list of all assembler functions/calls, but seem to be unable to find any for the TI-84 or TI-83 (their assembler code is nearly the same). Additionally, I could neither find a list of the standard functions of TI-Basic for z80…
Ninto
  • 123
  • 5
5
votes
2 answers

Operands are not assignment compatible

I have the following code: struct something { char *(*choices)[2]; }; char* arr[2] = {"foo", "bar"}; int main(void) { struct something obj; obj.choices = &arr; return 0; } When I compile this using a normal C compiler (gcc), I get no…
TrakJohnson
  • 1,755
  • 2
  • 18
  • 31
5
votes
3 answers

Do computers still use the Z80 CPU?

I have seen that some people are asking questions about assembly programming using the Z80 CPU. I used it years ago. It it still being used in new pieces of hardware or is it totally obsolete?
Rob Anthony
  • 1,743
  • 1
  • 13
  • 17
5
votes
1 answer

What is the purpose of the reserved/undefined bit in the flag register?

In the flag register of Z80, 8080, 8085, and 8086 processors, what is the purpose of bits 1, 3, 5, which are documented as "reserved" or "undefined"?
Joseph
  • 55
  • 7
5
votes
14 answers

Why is there no Z80 like LDIR functionality in C/C++/rtl?

In Z80 machine code, a cheap technique to initialize a buffer to a fixed value, say all blanks. So a chunk of code might look something like this. LD HL, DESTINATION ; point to the source LD DE, DESTINATION + 1 ; point to the…
EvilTeach
  • 28,120
  • 21
  • 85
  • 141
5
votes
1 answer

SPI Hardware interface to z80

I am attempting to make a retro computer using a z80 and ideally would like to give it the ability to boot from an SD card. I am 100% set on using a z80 and do not want to use a microcontroller with an internal SPI hardware interface. I want to…
KeatonB
  • 213
  • 2
  • 10
5
votes
2 answers

Z80 Register Endianness

Considering this sample code: ZilogZ80A cpu = new ZilogZ80A(); cpu.GeneralRegisters.H.FromUInt(229); cpu.GeneralRegisters.L.FromUInt(90); Console.WriteLine("H : " + cpu.GeneralRegisters.H.ToString()); Console.WriteLine("L : " +…
ChristopheD
  • 112,638
  • 29
  • 165
  • 179
5
votes
2 answers

Z80 (TI-83+) stops working on CALL

Every time I assemble an application for the TI-83+ calculator (Z80 processor), it stops running at CALL. Here is an example ("Hello") — it starts running just fine, but the calculator freezes at the CALL instruction. Anything I put before CALL…
c4757p
  • 1,728
  • 4
  • 18
  • 25
5
votes
1 answer

TI-84: call a function from the catalog with z88dk

I'm programming my TI-84 in C with z88dk. I need to call things like normalcdf and Ztest. I know they can be called from ti-BASIC, but how do I call them from C or inline assembly?
5
votes
1 answer

Minimal assembler program for CP/M 3.1 (z80)

I seem to be losing the battle against my stupidity. This site explains the system calls under various versions of CP/M. However, when I try to use call 2 (C_WRITE, console output), nothing much happens. I have the following code. ORG 100h LD…
Andrew J. Brehm
  • 4,448
  • 8
  • 45
  • 70
5
votes
2 answers

How do I get started reverse engineering z80 machine code?

I have a .z80 memory dump. How do I reverse engineer it? What do I need to know? How can I minimize manual labour?
Umber Ferrule
  • 3,358
  • 6
  • 35
  • 38
4
votes
2 answers

How does C programming work with no headers?

I'm familiar with the C programming language and z80 assembly and I have made a simple z80 "computer" with just the cpu with 32k of ram, 32k of rom, and an 8255 pia for io control. I have gotten the 8255 to bling an LED with my system through an…
4
votes
0 answers

How to do ROM cartridge banking, in VASM Z80 assembly, for a 32K MSX-1 Cartridge?

This question is about z80 and cartridge ROM banking on the old MSX computers. I am making a MSX game on PC and using openMSX for emulation and testing. I am making a 32K ROM cartridge. The MSX standard divides this 32 ROM memory into two 16K…
John
  • 41
  • 2
4
votes
3 answers

Is there a way to have two variables of different sizes share a memory address without declaring them as pointers?

I'm working on a personal project, an emulator. Let's say there are two registers H and L, each one byte long. So we could write to H or L with one byte. However, some instructions require that you write two bytes to H and L, or HL. First byte goes…
yhtrjdtryh
  • 73
  • 4
4
votes
1 answer

Can't figure out how to write interrupt handler for Z80 using SDCC

I'm developing a program in C for the Z80 and compiling using SDCC. I can't figure out how to create interrupt handlers for the NMI interrupt that starts at 0x0066 and the IM1 interrupt that starts at 0x0038. I'm using these calls: void…
ajcrm125
  • 323
  • 2
  • 12
1 2
3
12 13