Sharp logo
Details about the K & P 80-column interface (MZ-700) 
written by Bernd Krueger-Knauber / Germany  

Overview


The K&P 80-column interface increases the MZ-700 40-columns screen to 80-columns per line. It uses the Synertek SY6845E chip which is one of the 6845 CRT controller family. The interface is equipped with a 2048 byte video RAM and a 2048 byte character ROM. The character set contains 128 characters including the standard SHARP ASCII characters ( refer to appendix A ). Each character is represented by a 8 x 10 dot matrix. This results to a resolution of 640 x 250 dots.

It is impossible to set any pixel by this interface. Pixels can be set or reset only by using one dot matrix of the character set.

The K&P 80-column interface can be used with CP/M 2.2 and the K&P SFD700 single floppy drive(s). The disks will have a capacity of 360kb and are compatible to the format of the MZ-80A / MZ-80B. This means, that all programs which are executable under these systems, also can be used with an MZ-700. The free RAM space is 50kb.

Terminal emulation: ADM 3 A

General


The transparent address mode is one of the SY6845E extended features. Using this mode the video memory is entirely controlled by the SY6845E and uses 3 additional registers: R18, R19, and R31 ( which don't exist in the regular 6845 chip ).

R18 and R19 function as a pointer to the video RAM. If a write access occurs the register pair is automatically incremented by the chip. This internal technique makes the access much more faster.

If a read access occurs the CPU directly reads from a video RAM location - the SY6845E is not selected and thus, can't set the registers R18/R19. R18/19 must be programmatically supplied with a new pointer and an access to register R31 is also required to signal that R18/R19 contain valid values.

The interface uses the following I/O ports:

Port Function
$70
read one byte from the video RAM
$71
write one byte to the video RAM
$72
select a register for write access
or read the status register
$73
read or write a data byte from/to the selected register

Initialization of the SY6845E ( default values ):

Register Stored Info. Value Meaning
R0
total chars per line 0x7F = 127  
R1
displayed chars per line 0x50 = 80 80 characters per line
R2
H-Sync position 0x64 = 100  
R3
HSYNC pulse width 0x0C = 12  
R4
V-Total 0x1E = 30  
R5
V-TotalAdjust 0x02 = 2  
R6
displayed character rows 0x19 = 25 25 character rows
R7 V-Sync pos in characters 0x1C = 28  
R8

 

mode control
0x78 =     0
update occurs during h and v blanking
1
pin 34 functions as update strobe
1
delay CursorEnable for 1 char clock cycle
1
delay DisplayEnable for 1 char clock cycle
1
transparent memory access
0
straight binary addressing
00
non interlaced
R9
scanlines per character 0x09 = 9 height 10 dots
R10
cursor start register 0x60 = 96 blinking with 1/32 field rate, scanline 0
R11
cursor end register 0x09 = 9 scanline 9
R12
start address high 0x00 = 0  
R13
start address low 0x00 = 0  
R14
cursor address high 0x00 = 0  
R15 cursor address low 0x00 = 0  

Summary of intialization:

Screen size: 80 characters x 25 lines.
Dot matrix: 8 x 10 dots.
Cursor: blinking block 8 x 10 dots.
The first character to be displayed resides in the video RAM at location 0.

Example of the initialization using the values shown above:

tab6845	db	#7F,#50,#64,#0C,#1E,#02,#19,#1C,#78,#09,#60,#09,#00,#00,#00,#00

CRT_Init
	LD	BC,1072h	;B = 16, C = $72
	LD	HL,tab6845	;HL = pointer to the init values
	XOR	A		;A = 0
CRT_Init_Loop
	OUT	(C),A		;$72 set register
	INC	C		;$73
	LD	D,(HL)		;load the next init value in D
	OUT	(C),D		;$73 address
	DEC	C		;$72
	INC	HL		;tab + 1
	INC	A		;reg + 1
	DJNZ	CRT_Init_Loop	;loop for 16 registers

Next the screen should be immediately cleared with spaces, because all characters in the video RAM have an initial value of $00 ( = ASCII "@", see Appendix A ), otherwise 2000 @-characters would be displayed.

Printing a character


To printout a character on the screen the pointer to the video RAM address must be set viaR18/19 and an access ( select ) to the register R31 is required to signal that the contents of R18/R19 are valid.

Next wait for the ready state of the SY6845E ( indicated by bit 7 = 1 of the status register at port $70 ).

Now a data byte can be outputted via port $71. The character will be displayed at the specified position on the screen. The video RAM pointer R18/19 is automatically incremented.

To print further characters you have to check the status register first.

Set R18/R19 again if the sequence of your data position isn't continuous.

Example:

Put a space character at the first two locations

	LD	A,18		; register 18
	OUT	(72h),A		; select it
	LD	A,0		; load 0
	OUT	(73h),A		; in register 18
	LD	A,19		; register 19
	OUT	(72h),A		; select it
	LD	A,0		; load 0
	OUT	(73h),A		; in register 19
	LD	A,31		; register 31
	OUT	(72h),A		; select it (now the new pointer will be used)
    
WaitForUpdate1:
	IN	A,(#72)		;read address/status register
	BIT	7,A		;if bit 7 = 1 then update is ready
	JNZ	UpdateReady1
	JR	WaitForUpdate1

UpdateReady1:
	LD	A,' '		; load ' '
	OUT	(71h),A

WaitForUpdate2:
	IN	A,(#72)		;read address/status register
	BIT	7,A		;if bit 7 = 1 then update is ready
	JNZ	UpdateReady2
	JR	WaitForUpdate2	

UpdateReady2:
	LD	A,' '		; load ' '
	OUT	(71h),A

Reading a character


As mentioned above, each read access requires the setting of the pointer registers R18/R19. Data can be read by port $70.

Example:

Put a space character at the first two locations

	LD	A,18		; register 18
	OUT	(72h),A		; select it
	LD	A,0		; load 0
	OUT	(73h),A		; in register 18
	LD	A,19		; register 19
	OUT	(72h),A		; select it
	LD	A,0		; load 0
	OUT	(73h),A		; in register 19
	LD	A,31		; register 31
	OUT	(72h),A		; select it (now the new pointer will be used)

WaitForUpdate1:
	IN	A,(#72)		;read address/status register
	BIT	7,A		;if bit 7 = 1 then update is ready
	JNZ	UpdateReady1
	JR	WaitForUpdate1

UpdateReady1:
	IN	A,(70h)		; read the first location
	LD	A,18		; register 18
	OUT	(72h),A		; select it
	LD	A,0		; load 0
	OUT	(73h),A		; in register 18
	LD	A,19		; register 19
	OUT	(72h),A		; select it
	LD	A,1		; load 1
	OUT	(73h),A		; in register 19
	LD	A,31		; register 31
	OUT	(72h),A		; select it (now the new pointer will be used)

WaitForUpdate2:
	IN	A,(#72)		;read address/status register
	BIT	7,A		;if bit 7 = 1 then update is ready
	JNZ	UpdateReady2
	JR	WaitForUpdate2

UpdateReady2:
	IN	A,(70h)	; read the second location

Scrolling


Scrolling is simple but a bit confusing: The size of the RAM is 2048 bytes, whereas the screen size is 2000 bytes only.

Generally scrolling is done by using the display start registers R12/13. This register pair points to the first video RAM position. If this register pair is incremented by 80, the screen scrolls one line up. The new last line contains the last 48 unused bytes now, and additional, the first 32 bytes of the former first line. This line must be programmatically erased.

Scrolling down is similar: The register pair R12/13 must be decremented by 80.

If the scrolling is done the 'offset' must be used for the video RAM pointer registers R18/19. Now the pointer value 0 is no longer the first displayed character.

Cursor positioning and cursor dimensions


The cursor position depends on the values contained in the cursor position registers R14/15. The 'offset' value of the display start registers must be programmatically calculated for this position.

The size of the cursor can be set by the registers R10/R11. It is also possible to switch the cursor off by register R10.

Downloads and Technical References

You can download the following manuals (PDFs):

Type Description Download size ( Kb ) Pages
SY6545-1 CRT Controller. This chip is the predecessor of the SY6845E (SYNERTEK)
866
14
SY6845E CRT Controller Product Specification (CAST)
311
5
MC6845 CRT Controller Advance Information (Motorola)
745
19
Description German Hardware Description including the circuit diagram.
(Source: pp. 15-19 of the MZ700 / 800 Anwendermagazin No. 2 / 1985
from the former "Sharp MZ 700/800 Anwenderclub / Aachen / Germany")
384
5
Library Some programs written by Bernd Krueger-Knauber. The programs initiate the interface and you can output characters etc. The source code is included.
2
ZIP-file
ROM Character ROM 2k for the K & P 80-column interface.
1
ZIP-file

Download and read information about the K&P 80-column Disk Basic.

Read an overview and view pictures of the interface.

I do not have the original data sheet of the SY6845E, but I think, the manuals shown above will help in most cases. Please contact me if you can support me with the data sheet.

 

Appendix A (Character set)

  0 (00)    1 (01)    2 (02)    3 (03)    4 (04)    5 (05)    6 (06)    7 (07)
--------  --------  --------  --------  --------  --------  --------  --------

  OOO      OOO       O           OOO        OO               OO
 O   O     O         O             O       O         O         O
 O OOO     O          O            O       O         O         O
 O O O     O           O           O       O         O         O        O
 O OOO     O            O          O     OO          O          OO     O OO O
 O         O             O         O       O         O         O           O
  OOO      OOO           O       OOO       O         O         O
                                           O         O         O
                                            OO               OO
--------  --------  --------  --------  --------  --------  --------  --------


8 (08h)   9 (09h)   10 (0Ah)   11 (0B)   12 (0C)   13 (0D)   14 (0E)   15 (0F)
--------  --------  --------  --------  --------  --------  --------  --------

  O          OO       OOO       OOO         O       O         O         O O
   O        O  O     O   O     O           O         O         O
  OOO        OO      O         OOOO       OOO      O   O      OOO
     O               O         O   O     O   O     O   O     O   O
  OOOO               O   O     O   O     OOOO      O   O     OOOO
 O   O                OOO       OOOO     O         O   O     O
  OOO O                 O          O      OOOO      OOOO      OOOO
                      OO        OOO

--------  --------  --------  --------  --------  --------  --------  --------


 16 (10)   17 (11)   18 (12)   19 (13)   20 (14)   21 (15)   22 (16)   23 (17)
--------  --------  --------  --------  --------  --------  --------  --------



                                                                      OOOOOOOO
                                                            OOOOOOOO  OOOOOOOO
                                                  OOOOOOOO  OOOOOOOO  OOOOOOOO
                                        OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO
                              OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO
                    OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO
          OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO
--------  --------  --------  --------  --------  --------  --------  --------


 24 (18)   25 (19)   26 (1A)   27 (1B)   28 (1C)   29 (1D)   30 (1E)   31 (1F)
--------  --------  --------  --------  --------  --------  --------  --------
                    OOOOOOOO  OOOOOOOO                      OOOOOOOO  OOOOOOOO
          OOOOOOOO  OOOOOOOO  OOOOOOOO                      OOOOOOOO  OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO                      OOOOOOOO  OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO                      OOOOOOOO  OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO                      OOOOOOOO  OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO            OOOOOOOO            OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO            OOOOOOOO            OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO            OOOOOOOO            OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO            OOOOOOOO            OOOOOOOO
OOOOOOOO  OOOOOOOO  OOOOOOOO  OOOOOOOO            OOOOOOOO            OOOOOOOO
--------  --------  --------  --------  --------  --------  --------  --------


 32 (20)   33 (21)   34 (22)   35 (23)   36 (24)   37 (25)   38 (26)   39 (27)
--------  --------  --------  --------  --------  --------  --------  --------

             O         O O      O O        O       OO          O          O
             O        O O       O O       OOOO     OO  O      O O        O
             O       O O       OOOOO     O O          O       O O       O
             O                  O O       OOO        O        OO
                               OOOOO       O O      O        O O O
                                O O      OOOO      O  OO     O  O
             O                  O O        O          OO      OO O


--------  --------  --------  --------  --------  --------  --------  --------


 40 (28)   41 (29)   42 (2A)   43 (2B)   44 (2C)   45 (2D)   46 (2E)   47 (2F)
--------  --------  --------  --------  --------  --------  --------  --------

    O       O
   O         O         O         O                                         O
  O           O      O O O       O                                        O
  O           O       OOO      OOOOO               OOOOO                 O
  O           O      O O O       O        OO                            O
   O         O         O         O        OO                  OO       O
    O       O                              O                  OO
                                          O

--------  --------  --------  --------  --------  --------  --------  --------


 48 (30)   49 (31)   50 (32)   51 (33)   52 (34)   53 (35)   54 (36)   55 (37)
--------  --------  --------  --------  --------  --------  --------  --------

  OOO        O        OOO      OOOOO        O      OOOOO       OO      OOOOO
 O   O      OO       O   O        O        OO      O          O            O
 O  OO       O           O       O        O O      OOOO      O            O
 O O O       O          O         O      O  O          O     OOOO        O
 OO  O       O         O           O     OOOOO         O     O   O      O
 O   O       O        O        O   O        O      O   O     O   O      O
  OOO       OOO      OOOOO      OOO         O       OOO       OOO       O


--------  --------  --------  --------  --------  --------  --------  --------


 56 (38)   57 (39)   58 (3A)   59 (3B)   60 (3C)   61 (3D)   62 (3E)   63 (3F)
--------  --------  --------  --------  --------  --------  --------  --------

  OOO       OOO                             O                 O         OOO
 O   O     O   O      OO        OO         O                   O       O   O
 O   O     O   O      OO        OO        O        OOOOO        O         O
  OOO       OOOO                         O                       O       O
 O   O         O      OO        OO        O        OOOOO        O        O
 O   O        O       OO        OO         O                   O
  OOO       OO                   O          O                 O          O
                                O

--------  --------  --------  --------  --------  --------  --------  --------


 64 (40)   65 (41)   66 (42)   67 (43)   68 (44)   69 (45)   70 (46)   71 (47)
--------  --------  --------  --------  --------  --------  --------  --------

  OOOO      OOO      OOOO       OOO      OOO       OOOOO     OOOOO      OOOO
 O         O   O     O   O     O   O     O  O      O         O         O
  OOO      O   O     O   O     O         O   O     O         O         O
 O   O     OOOOO     OOOO      O         O   O     OOOO      OOOO      O  OO
  OOO      O   O     O   O     O         O   O     O         O         O   O
     O     O   O     O   O     O   O     O  O      O         O         O   O
 OOOO      O   O     OOOO       OOO      OOO       OOOOO     O          OOOO


--------  --------  --------  --------  --------  --------  --------  --------


 72 (48)   73 (49)   74 (4A)   75 (4B)   76 (4C)   77 (4D)   78 (4E)   79 (4F)
--------  --------  --------  --------  --------  --------  --------  --------

 O   O      OOO       OOOO     O   O     O         O   O     O   O      OOO
 O   O       O          O      O  O      O         OO OO     O   O     O   O
 O   O       O          O      O O       O         O O O     OO  O     O   O
 OOOOO       O          O      OO        O         O O O     O O O     O   O
 O   O       O          O      O O       O         O   O     O  OO     O   O
 O   O       O       O  O      O  O      O         O   O     O   O     O   O
 O   O      OOO       OO       O   O     OOOOO     O   O     O   O      OOO


--------  --------  --------  --------  --------  --------  --------  --------


 80 (50)   81 (51)   82 (52)   83 (53)   84 (54)   85 (55)   86 (56)   87 (57)
--------  --------  --------  --------  --------  --------  --------  --------

 OOOO       OOO      OOOO       OOOO     OOOOO     O   O     O   O     O   O
 O   O     O   O     O   O     O           O       O   O     O   O     O   O
 O   O     O   O     O   O     O           O       O   O     O   O     O   O
 OOOO      O   O     OOOO       OOO        O       O   O     O   O     O O O
 O         O O O     O O           O       O       O   O     O   O     O O O
 O         O  O      O  O          O       O       O   O      O O      O O O
 O          OO O     O   O     OOOO        O        OOO        O        O O


--------  --------  --------  --------  --------  --------  --------  --------


 88 (58)   89 (59)   90 (5A)   91 (5B)   92 (5C)   93 (5D)   94 (5E)   95 (5F)
--------  --------  --------  --------  --------  --------  --------  --------
                               O   O     O   O     O   O
 O   O     O   O     OOOOO                                     O
 O   O     O   O         O      OOO       OOO      O   O      O O
  O O       O O         O      O   O     O   O     O   O     O   O
   O         O         O       OOOOO     O   O     O   O
  O O        O        O        O   O     O   O     O   O
 O   O       O       O         O   O     O   O     O   O
 O   O       O       OOOOO     O   O      OOO       OOO                OOOOO


--------  --------  --------  --------  --------  --------  --------  --------


 96 (60)   97 (61)   98 (62)   99 (63)  100 (64)  101 (65)  102 (66)  103 (67)
--------  --------  --------  --------  --------  --------  --------  --------

  O                   O                     O
   O                  O                     O                   OO
    O      OOO        OOO        OO       OOO        OO        O         OOO
              O       O  O      O  O     O  O       O  O      OOO       O  O
           OOOO       O  O      O        O  O       OOO        O        O  O
           O  O       O  O      O        O  O       O          O         OOO
           OOOOO     OOOO        OOO      OOOO       OOO       O           O
                                                                        OOO

--------  --------  --------  --------  --------  --------  --------  --------


104 (68)  105 (69)  106 (6A)  107 (6B)  108 (6C)  109 (6D)  110 (6E)  111 (6F)
--------  --------  --------  --------  --------  --------  --------  --------

  O                             O         OO
  O          O          O       O          O
  OOO                           O  O       O       OOOO       OOO       OO
  O  O      OO          O       O O        O       O O O      O  O     O  O
  O  O       O          O       OO         O       O O O      O  O     O  O
  O  O       O          O       O O        O       O O O      O  O     O  O
  O  O      OOO       O O       O  O      OOO      O O O      O  O      OO
                       O

--------  --------  --------  --------  --------  --------  --------  --------


112 (70)  113 (71)  114 (72)  115 (73)  116 (74)  117 (75)  118 (76)  119 (77)
--------  --------  --------  --------  --------  --------  --------  --------


                                           O
  OOO       OOO       O OO       OOO      OOO      O  O      O   O     O   O
  O  O     O  O       OO        O          O       O  O      O   O     O   O
  O  O     O  O       O          OO        O       O  O       O O      O O O
  OOO       OOO       O            O       O O     O  O       O O      O O O
  O           O       O         OOO         O       OOOO       O        O O
  O           O

--------  --------  --------  --------  --------  --------  --------  --------


120 (78)  121 (79)  122 (7A)  123 (7B)  124 (7C)  125 (7D)  126 (7E)  127 (7F)
--------  --------  --------  --------  --------  --------  --------  --------

                               O  O      O  O      O  O       OOO      O O O
                                                             O   O      O O
 OO  O      O  O      OOOO     OOO        OO       O  O      O   O     O O O
   OO       O  O        O         O      O  O      O  O      O  O       O O
   O        O  O       O       OOOO      O  O      O  O      O   O     O O O
  OO         OOO      O        O  O      O  O      O  O      O   O      O O
 O  OO         O     OOOO      OOOOO      OO        OOOO     O OO      O O O
             OO                                              O

--------  --------  --------  --------  --------  --------  --------  --------


Go to the top of this page Home

last updated January 31, 2004
Bernd Krueger-Knauber