Z80 Input & Output Ports for MTX Peripherals

Derived from the original table by Andy Key.

Revised by Bill Brendling.

Motherboard
00 -OIOBYTE: Memory control:
BitFunction
0-3RAM page address
4-6ROM page address
70 = ROM based system, 1 = RAM based system
00 I-Printer strobe
01 IOVDP data
02 -OVDP control
02 I-VDP status
03 -OTape output:
BitFunction
0Output to tape
1-7Reserved
03 I-Sound strobe, motherboard doesn't drive bus, REMEMOTECH and REMEMOrizer drive the value 03
04 -OPrinter data output
04 I-Printer status:
BitFunction
0Printer busy (active high)
1Printer error (active low)
2Paper empty (active high)
3Printer selective (active high)
4-7Reserved
05 -OKeyboard drive
05 I-Keyboard sense
06 I-Keyboard sense:
BitFunction
0-1Two most significant keyboard sense lines
2-3Country code
4-7Reserved
06 -OSound
07 IOPIO
08 IOCTC channel 0
09 IOCTC channel 1
0A IOCTC channel 2
0B IOCTC channel 3
RS232
0C IODART
0D IODART
0E IODART
0F IODART
SDX Floppy Disc Controller
10 -OFDC command
10 I-FDC status:
BitFunction
0Busy
1Index / DRQ
2Track 00 / Lost data
3CRC error
4Seek error / Not found
5Head loaded / Deleted data
6Write protect
7Not ready
11 IOFDC track
12 IOFDC sector
13 IOFDC data
14 -ODrive control:
BitFunction
00 = Drive 0, 1 = Drive 1
10 = Side 0, 1 = Side 1
2Motor On
3Motor Ready
40 = Single density, 1 = Double density
5-7Reserved
14 I-Drive status:
BitFunction
00 = Head load, 1 = No Head Load
10 = Double sided, 1 = Single sided
20 = 80 Tracks, 1 = 40 Tracks
30 = 2 Drives, 1 = 1 Drive
4Link
5Ready
6INT
7DRQ
Cassette controller
1F -OCassette start/stop
MFX Video (FPGA v2.00 or higher)
28 -OSet low byte of VRAM copy count and initiate copy
28 I-Read low byte of outstanding copies
29 -OSet high byte of VRAM copy count
29 I-Read high byte of outstanding copies
2A IOLow byte of VRAM copy source address
2B IOHigh byte of VRAM copy source address
2C IOLow byte of VRAM target address. Writing to this port resets the address increment to one
2D IOHigh byte of VRAM target address. Writing to this port resets the address increment to one
2E -OWrite byte at VRAM target address and increment the target address
2E I-Read byte at VRAM target address and increment the target address
2F -OSet the address increment for read, write and copy operations
2F I-Read byte at VRAM target address without changing the address
31 -OAddress high & Write enable bits:
BitFunction
0-3Bits 11-8 of character address
4Enable write of second attribute
5Enable write of first attribute
6Enable write of character code
70 = Read data, 1 = Write data
80 column & MFX (all versions)
30 I-Ring the bell (FDX only)
30 -OAddress low. Writing to this address triggers a character read or write
31 -OAddress high & Write enable bits:
BitFunction
0-3Bits 11-8 of character address
4Reserved (Enable write of second attribute for MFX FPGA v2.00 or higher)
5Enable write of first attribute
6Enable write of character code
70 = Read data, 1 = Write data
32 IOCharacter data
33 IOAttribute data
38 IO80-Column control register select (See table below)
39 IO80-Column control register data
MFX (all versions)
34 IO80-column repeat count. Writing to this address generates the specified number of repeats of the last character written
35 -OInitialise location in FPGA read only serial number register
35 I-Read serial number register (auto increments location)
OffsetFunction
0 Owner Initial 1 (ASCII)
1 Owner Initial 2 (ASCII)
2 Serial Number (BCD)
3 PCB Major Version (BCD)
4 PCB Minor Version (BCD)
5 FPGA Major Version (BCD)
6 FPGA Minor Version (BCD)
7 (not used) (Byte)
38 IO80-Column control register select (See table below)
39 IO80-Column control register data
3A IOFPGA control register:
BitFunction
0Enable multiple character write
1 & 2Reserved
3Enable hum bars
4VGA frequency: 0 = 50Hz, 1 = 60Hz
5Colour palette: 0 = Retro, 1 = Vivid
6Select display: 0 = 80-column, 1 = VDP
7Enable disk activity display
3B I-Read value of memory page port
MFX Video (FPGA v2.00 or higher)
36 -OSelect character for font read / write.
Sets the font pointer to the first row of the character
36 I-Character currently being read / updated
37 IOReads / sets pixels for one row of current character.
The font pointer is advanced to the next row (top to bottom) after the read or write.
After the last row the pointer is advanced to the next character
3C IOIndex into colour palette
3D IORed (bits 0-3) and green (bits 4-7) components of selected palette colour
3E IOBlue (bits 0-3) component of selected palette colour
3F IOSecond attribute byte for character
FDX Floppy Disc Controller
40 -OFDC command
40 I-FDC status
41 IOFDC track
42 IOFDC sector
43 IOFDC data
44 IOFDC control/status port
45 IOFDC drive change
46 IOFDC DMA low
47 IOFDC DMA high
Silicon Disc
50 IOF: sector address low
51 IOF: sector address high
52IOF: MEMU Huge Silicon Disc: sector address highest
53 IOF: data
54 IOG: sector address low
55 IOG: sector address high
56IOG: MEMU Huge Silicon Disc: sector address highest
57 IOG: data
58 IOH: sector address low
59 IOH: sector address high
5AIOH: MEMU Huge Silicon Disc: sector address highest
5B IOH: data
5C IOI: sector address low
5D IOI: sector address high
5EIOI: MEMU Huge Silicon Disc: sector address highest
5F IOI: data
CFX-II Video
60 -OOutput characters, control and escape sequences to 80-column display
60 I-Test space available in CFX-II output buffer
61 -OControl access to CFX-II internal memory. Writing 0xFF resets
61 I-Read back contents of CFX-II internal memory
Compact Flash (CFX, MTXplus+)
6C IO82C55 PPI, PIO port A, IDE data bus, lower 8 bits
6D IO82C55 PPI, PIO port B, IDE data bus, upper 8 bits
6E -O82C55 PPI, PIO port C, IDE control lines
BitFunction
0-2IDC Address lines
3IDC Chip Select 0 (Inverted)
4IDC Chip Select 1 (Inverted)
5IDC Write (Inverted)
6IDC Read (Inverted)
7IDC Reset (Inverted)
6F -O82C55 PPI, PIO control register
DS12887 Real Time Clock (MTXplus+)
70 -ODS12887 address register
71 IODS12887 data register
MFX (FPGA v4.00 or higher)
70 -ODS 3231 Real Time Clock address register
71 IODS 3231 Real Time Clock data register
72 -OI2C command port:
1 = Read RTC data
2 = Write RTC data
72 I-I2C status port:
BitFunction
0Busy
1-6Reserved
7Error
73 -OWrites data to 1KB memory buffer.
Auto-increments write address.
Resets read address.
73 -IReads data from 1KB memory buffer.
Auto-increments read address.
First read after a write is stale and should be discarded.
Resets the write address.
Ethernet (MFX (all versions) & NFX)
90 -OWIZnet W5100 control
91 -OWIZnet W5100 address (high)
92 -OWIZnet W5100 address (low)
93 IOWIZnet W5100 data
MFX (FPGA v4.00 or higher), REMEMOrizer r3 and REMEMOTECH r2 Accelerator extras
A0 IORead / write top of stack - Mantissa bits 0 to 7 (lsb)
A1 IORead / write top of stack - Mantissa bits 8 to 15
A2 IORead / write top of stack - Mantissa bits 16 to 23
A3 IORead / write top of stack - Sign bit (bit 7) and mantissa bits 24 to 30.
Mantissa bit 31 = 1
A4 IORead / write top of stack - Exponent
A5 -OCommand:
ValueMeaning
0x00Initialise
0x01Push zero onto top of stack
0x02Push a second copy of top of stack
0x03Pop value from top of stack
0x04Exchange top of stack and next of stack
0x05Push a copy of next of stack
0x06Set OK status
0x10Load integer 1 on top of stack (replaces previous value)
0x2032 bit integer negation
0x2132 bit integer bitwise not
0x2232 bit integer logical shift left
0x2332 bit integer logical shift right
0x2432 bit integer arithmetic shift right
0x2532 bit integer absolute value
0x2632 bit sign (result is -1, 0 or 1)
0x3032 bit integer addition
0x3132 bit integer subtraction
0x3232 bit integer unsigned multiplication
0x3332 bit integer signed multiplication
0x3432 bit integer unsigned division
0x3532 bit integer signed division
0x3632 bit integer unsigned modulus
0x3732 bit integer signed modulus
0x38Push bits 32 to 63 of multiply result to top of stack
0x40Load 1.0 on top of stack (replaces previous value)
0x41Load 2.0 on top of stack
0x42Load 10.0 on top of stack
0x43Load pi on top of stack
0x44Load pi/2 on top of stack
0x45Load 2pi on top of stack
0x46Load 1/2 on top of stack
0x47Load 1/3 on top of stack
0x48Load 1/5 on top of stack
0x49Load 1/7 on top of stack
0x4ALoad 1/9 on top of stack
0x4BLoad 1/11 on top of stack
0x4CLoad 1/13 on top of stack
0x4DLoad 1/15 on top of stack
0x4ELoad 1/17 on top of stack
0x4FLoad 1/3! on top of stack
0x50Load 1/4! on top of stack
0x51Load 1/5! on top of stack
0x52Load 1/6! on top of stack
0x53Load 1/7! on top of stack
0x54Load 1/8! on top of stack
0x55Load 1/9! on top of stack
0x56Load 1/11! on top of stack
0x57Load 1/13! on top of stack
0x58Load log_2(e) on top of stack
0x59Load log_e(2) on top of stack
0x60Floating point negation
0x61Floating point absolute value
0x62Floating point sign
0x63Round to integer value (towards zero)
0x70Floating point addition
0x71Floating point subtraction
0x72Floating point multiplication
0x73Floating point division
0x8032 bit unsigned integer to floating point
0x81Floating point to 32-bit unsigned integer
The arithmetic accelerator has a 10 deep stack.
Unitary operations are performed on the top of stack with the value replaced by the result.
Binary operations pop the two arguments from the top of stack and push the result.
A5 I-Result:
ValueMeaning
0Busy
1OK
2Divide by zero
3Overflow
4Underflow
CFX-II Compact Flash
B0 IOData Register (IDC register 0)
B1 -OFeature Register (IDC Register 1)
B1 I-Error Register (IDC Register 1)
B2 -OCount Register (IDC Register 2)
B3 -OLBA low (IDC Register 3)
B4 -OLBA mid (IDC Register 4)
B5 -OLBA high (IDC Register 5)
B6 -OLBA top (IDC Register 6)
B7 -OCommand (IDC Register 7)
B7 I-Status (IDC Register 8)
REMEMOrizer Speculator extras
B0 I-REMEMOrizer Speculator sound transition counter (low)
B1 I-REMEMOrizer Speculator sound transition counter (high)
B2 I-Video active indicator
B2 -ORow type and number select
B3 I-Run size
B3 -OClear leftmost cell in run
B4 I-CPU address low
B5 I-CPU address high
B6 I-VDP address low
B7 I-VDP address high
REMEMOTECH specific bells and whistles
C0 IO7 segment digits 1 and 0
C1 IO7 segment digits 3 and 2
C2-C3 IOSpace left for further 7 segment displays in future
C4 IOGreen LEDs, LEDG7..LEDG0
C5 I-Keys, KEY2..KEY0 (KEY3=reset)
C6 IOSpace left for future features
C7 I-Extra keys, mainly numeric pad
C8-CF IOSpace left for future features
REMEMOTECH and REMEMOrizer address mapping
D0 IOPage register 1
D1 IOPage register 2
D2 IOREMEMOrizer page register 3
D3 IOREMEMOrizer page register 4, controls ROM 2 sub-page
MFX SD Card (FPGA version 1.xx)
D4 -OSD control:
BitFunction
0-5Clock divisor
7Card select
SD clock frequency = 2MHz / (Divisor + 1)
D4 I-SD status:
BitFunction
0SD card data out
1-5Reserved
6Card activity flag
7Write status (0 = Busy, 1 = Complete)
D6 IOSD data
D7 I-SD data, with implied send FF
MFX SD Card (FPGA version 2.00 or higher)
D4 -OSD control:
BitFunction
0-6Clock divisor
7Card select
SD clock frequency = 25MHz / (Divisor x Scale + 1)
D4 I-SD status:
BitFunction
0SD card data out
1-5Reserved
6Card activity flag
7Write status (0 = Busy, 1 = Complete)
D5 IOSD card mode:
BitFunction
0SD card clock (bit-bash mode)
1SD card data in (bit-bash mode)
2SD card select (bit-bash mode)
3-5Reserved
6SD clock scale (0 = x16, 1 = x1)
7Mode select (0 = SPI, 1 = Bit-bash)
D6 IOSD data
D7 I-SD data, with implied send FF
SD Card (REMEMOTECH & REMEMOrizer)
D4 IOSD control/status
D5 IOSpace left for future SD card enhancements
D6 IOSD data
D7 I-SD data, with implied send FF
REMEMOTECH and REMEMOrizer misc stuff
D8 I-Clock divider (REMEMOrizer hard codes result of 05)
D9 IOREMEMOrizer specific flags
DA IOMore REMEMOrizer and REMEMOTECH specific flags
DB-DF IOSpace left for future features
MEMU diagnostics (if enabled by -diag-chip-log)
EE IOInserts a character into the MEMU log file.
The following control characters have special effects:
0x00Disable logging from Z80
0x01Enable logging from Z80
0x02Disable logging of Z80 instructions
0x03Enable logging of Z80 instructions
0x0AFlush a line of Z80 logged data to the file
EF IOInserts a byte (in hex) into the MEMU log file
Speculator (original only)
x11xxxxxIOPartial address decode, covers 7E,7F,FB,FE,FF, and maybe more?
xxx11111IOPartial address decode, covers 1F, and maybe more?
Speculator (original, REMEMOrizer, MEMU)
1F IOKempston Joystick
7E I-Read emulated Spectrum border
7E -OWrite emulated Spectrum keyboard, first low bit in A15-A8 selects row
7F IOFuller joystick (00 written only, no button pressed)
FB IOZX Printer (40 written only, printer not connected)
FE -OWrite emulated Spectrum border
FE I-Read emulated Spectrum keyboard, first low bit in A15-A8 selects row
FF -ONMI write register
MAGROM
FB -OPage register for 512KB data ROM

80-Column Control Registers

Memotech 80-column (6845)
00 Horizontal total
01 Horizontal displayed
02 Horizontal sync position
03 Sync width
04 Vertical total
05 Vertical total adjust
06 Vertical displayed
07 Vertical sync position
08 Interlace mode and skew
09 Maximum scan line address
MFX & Memotech 80-column (6845)
0A Cursor start
0B Cursor end
0C Display start address (high)
0D Display start address (low)
0E Cursor address (high)
0F Cursor address (low)
MFX
1E Colour control:
BitFunction
0For 1-bit and 2-bit 320x240 graphics modes:
0 = 2 colours per character cell
1 = 6 colours per character cell
1For text mode:
0 = Forground & background colour bits in both attribute bytes
1 = Foreground colour in first attribute, background colour in second attribute
2-5Reserved
6-7For text mode: Bits 6-7 of the index into the colour palette
1F Monitor configuration:
BitFunction
0-3Display mode:
0 = 24 x 80 Text
1 = 48 x 80 Text
2 = 320 x 240 x 1-bit Graphics
4 = 320 x 240 x 2-bit Graphics
8 = 320 x 240 x 3-bit graphics
4Reserved
5Bit 13 of the display location in VRAM for mode 0
6Bit 14 of the display location in VRAM for modes 0-2
7Reserved