binutils-gdb/gdb/features/z80.c
Sergey Belyashov 3dab9e15d3 Add basic Z80 CPU support
Supported ISAs:
- Z80 (all undocumented instructions)
- Z180
- eZ80 (Z80 mode only)

Datasheets:
Z80: https://www.zilog.com/manage_directlink.php?filepath=docs/z80/um0080&extn=.pdf
Z180: https://www.zilog.com/manage_directlink.php?filepath=docs/z180/ps0140&extn=.pdf
eZ80: http://www.zilog.com/force_download.php?filepath=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTlWVFRBd056Y3VjR1Jt

To debug Z80 programs using GDB you must configure and embed
z80-stub.c to your program (SDCC compiler is required). Or
you may use some simulator with GDB support.

gdb/ChangeLog:

	* Makefile.in (ALL_TARGET_OBS): Add z80-tdep.c.
	* NEWS: Mention z80 support.
	* configure.tgt: Handle z80*.
	* features/Makefile (XMLTOC): Add z80.xml.
	* features/z80-cpu.xml: New.
	* features/z80.c: Generate.
	* features/z80.xml: New.
	* z80-tdep.c: New file.
	* z80-tdep.h: New file.

gdb/stubs/ChangeLog:

	* z80-stub.c: New file.

Change-Id: Id0b7a6e210c3f93c6853c5e3031b7bcee47d0db9
2021-07-17 10:17:30 -04:00

45 lines
1.8 KiB
C

/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
Original: z80.xml */
#include "defs.h"
#include "osabi.h"
#include "target-descriptions.h"
struct target_desc *tdesc_z80;
static void
initialize_tdesc_z80 (void)
{
target_desc_up result = allocate_target_description ();
set_tdesc_architecture (result.get (), bfd_scan_arch ("z80"));
struct tdesc_feature *feature;
feature = tdesc_create_feature (result.get (), "org.gnu.gdb.z80.cpu");
tdesc_type_with_fields *type_with_fields;
type_with_fields = tdesc_create_flags (feature, "af_flags", 2);
tdesc_add_flag (type_with_fields, 0, "C");
tdesc_add_flag (type_with_fields, 1, "N");
tdesc_add_flag (type_with_fields, 2, "P/V");
tdesc_add_flag (type_with_fields, 3, "F3");
tdesc_add_flag (type_with_fields, 4, "H");
tdesc_add_flag (type_with_fields, 5, "F5");
tdesc_add_flag (type_with_fields, 6, "Z");
tdesc_add_flag (type_with_fields, 7, "S");
tdesc_create_reg (feature, "af", 0, 1, NULL, 16, "af_flags");
tdesc_create_reg (feature, "bc", 1, 1, NULL, 16, "uint16");
tdesc_create_reg (feature, "de", 2, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "hl", 3, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "sp", 4, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "pc", 5, 1, NULL, 32, "code_ptr");
tdesc_create_reg (feature, "ix", 6, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "iy", 7, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "af'", 8, 1, NULL, 16, "af_flags");
tdesc_create_reg (feature, "bc'", 9, 1, NULL, 16, "uint16");
tdesc_create_reg (feature, "de'", 10, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "hl'", 11, 1, NULL, 16, "data_ptr");
tdesc_create_reg (feature, "ir", 12, 1, NULL, 16, "uint16");
tdesc_z80 = result.release ();
}