CP/M pages
Home -> CP/M -> Digital Research LOGO

Digital Research LOGO

Digital Research LOGO (aka DR Logo, Dr. Logo) is, unsurprisingly, a port of the LOGO programming language to Digital Research's operating systems. The original version was announced for the IBM PC in February 1983, though development appears to have been protracted, with the product eventually being released in late 1983 and reviewed in March 1984.

The announcement says that the original version was written in C. This certainly seems to be true for the 16-bit versions available to me. It also suggests that the 8-bit versions would be written in LISP. I'm less sure about that; the header files at www.cpm.z80.de suggest that it was written in BDS C.

Versions

The following versions are known to me or referred to online:

16-bit versions

Original PC booter

The review in PC Mag describes DR Logo as booting from a copy-protected diskette (based on "SpeedStart CP/M", an "abridged version of CP/M that boots automatically"). As far as I know, this version has not been archived anywhere.

Supported hardware would have been PC CGA.

128k PCjr version

The May 1984 edition of DRI Micronotes announces the imminent introduction of a version of DR Logo that runs in 128k of RAM (the original version required 192k). This was particularly aimed at the PCjr, so would presumably have targeted its video hardware.

Generic 8-bit and 16-bit versions

The July 1984 edition of DRI Micronotes announces the availability of "generic" 8-bit and 16-bit (CP/M-86 and DOS) versions of DR Logo to OEMs. It would presumably then have been up to the OEM, rather than Digital Research, to write the hardware-specific functions for graphics output.

Dr Logo v2 for MS-DOS

Apparently never released, this was the last version of Dr Logo created for the IBM PC with CGA. It signs on as "Dr. Logo for the IBM PC/PCjr, Version 2.0" with a 1984 copyright date.

APC-III Dr. Logo

Released for the NEC APC-III under MS-DOS — dated 10 September 1984 (or maybe 9 October 1984). This version requires APC graphics hardware and BIOS, and will not work on IBM-compatible PCs.

Dr Logo for the Apricot F1

Released for the Apricot F1 under CP/M-86 — dated 19 April 1985. I used this version as the basis for my unofficial patches: VGALOGO (for the IBM PC with VGA) and 5271LOGO (for the IBM 3270 PC).

Generic Dr Logo for the Apricot

Released for the Apricot F1 under MS-DOS — dated 3 July 1985. This version uses GSX for its graphics and includes drivers for the Apricot PC/Xi and F1 series. In theory running it on other platforms is just a matter of swapping in the appropriate GSX driver. In practice you also need to have VT52 terminal emulation provided by VT52.SYS (as opposed to the more common ANSI.SYS)

Dr Logo for GEM (aka Atari ST Logo)

A port to the GEM environment and 68000 processor. Screenshots can be seen at atarimania.com.

Fragmentary source
A few source files can be found in the "Miscellaneous DRI disks" archive at www.cpm.z80.de.

8-bit versions

Dr. Logo for Sony SMC-777, Ver 1.4

museum.ipsj.or.jp mentions Dr. Logo as one of the applications supplied on diskette with the Sony SMC-777. It can indeed be found on the SMC-777 system diskette. Although it is in CP/M COM format, it is saved under the name LOGO.EXE. The copyright year is 1983; there does not appear to be a more exact build date.

Amstrad LOGO V1.1

Released for the Amstrad CPC464 / 6128 under CP/M 2.2. Again, the copyright year is 1983.

Unusually, LOGO is split between a .COM file (LOGO2.COM, which is exactly 32k in size) and the last 8k of the AMSDOS ROM. My guess is that this was the only way to fit 40k of LOGO interpreter into the CPC CP/M 2 memory map and still have some RAM available.

Amstrad LOGO V2.0

Two versions exist: for the Amstrad CPC6128 and PCW computers under CP/M Plus. The copyright year is 1985, and again there does not seem to be an exact build date.

Presumably the larger TPA under CP/M Plus allowed the use of the later and larger version of Logo.

Tatung Einstein

The manual for this can be found at tatungeinstein.co.uk. This suggests that it would have signed on as "Z80 DR. LOGO, EINSTEIN VERSION 1.0" with a 1983 copyright date.

Other versions?

Customisation

Apart from the 'Generic' Apricot version (which uses GSX for graphics output), each version includes system-specific code for graphics output. My guess is that in the case where graphics support was provided by the OEM, they would have received their master copy of Logo in the form of object files. They would then have written the necessary routines and linked them with the object files to create a suitable LOGO.COM / LOGO.CMD / LOGO.EXE.

I'm not aware of any OEM distribution surviving in this form, so people wanting to customise DR Logo for a new platform would have to resort to binary patching.

Amstrad LOGO for the PCW: Logo Input / Output System

The programmers adapting Logo for the Amstrad PCW took a slightly different approach from that outlined above. There still is a custom module linked into LOGO.COM, but it is a minimal stub that forwards (nearly) all operations to a separate RSX (JOYLIOS.RSX). This may have been done simply so that the graphics code could be sure of loading in the top 16k of memory, making it more convenient to page in the video RAM. However it also means that it's possible to target other systems without having to re-link LOGO itself, by removing the RSX and replacing it with one written for the required system.

(I did this in JOYCE to get a version of DR LOGO that displayed in 800×600 resolution).

The RSX is initialised by a call to 0005h with C=3Ch and DE giving the address of an RSX parameter block:

	DW	0		;RSX function 0
	DW	params		;Buffer to receive LOGO screen parameters
	DW	jumpblock	;Buffer to receive function jumpblock

The RSX should populate the buffers at 'params' and 'jumpblock'. It should then perform any necessary initialisation of the screen (such as turning off automatic wrap at end of line) and then jump to 0100h rather than returning (so that LOGO is restarted with the values in the now-populated parameter block).

The 'params' array is laid out as follows. Items marked '*' need to be populated:

params+00h	DW	* Text screen height, characters
params+02h	DW	* Text screen width, characters
params+04h	DW	* Text screen height, characters
params+06h	DW	* Text screen width, characters
params+08h	DW	* Standard split line
params+0Ah	DW	Default foreground ink
params+0Ch	DW	Default background ink
params+0Eh	DW	Text X-coordinate mask
params+10h	DW	* Maximum foreground ink number 
params+12h	DW	Maximum R/G/B value for SETPAL
params+14h	DW	Unknown - possibly a frequency limit for TONES?
params+16h	DW	Maximum paddle number (-1 for none)
params+18h	DW	* Graphics screen width, pixels
params+1Ah	DW	* Graphics screen height, pixels
params+1Ch	DW	Unknown - possibly character height in pixels
params+1Eh	DW	Maximum scrunch ratio (for SETSCRUNCH)
params+20h	DW	Nonzero if separate text and graphics screens
params+22h	DW	* Maximum background ink number
params+24h	DW	* Maximum split line (usually = text screen height)
params+26h	DW	* Pixel width  (for setting initial aspect ratio)	
params+28h	DW	* Pixel height
params+2Ah	DW	Address of program title, ASCIIZ
params+2Ch	DW	Address of "Edit", ASCIIZ
params+2Eh	DW	Address of "_" (used for drawing horizontal lines in
			text mode), ASCIIZ
The 'jumpblock' should be populated with jumps to functions within the RSX. The calling convention is C-like, with parameters on the stack. Values are returned in HL. Functions should preserve the BC register, but can do what they like with the others.
+0000	JP	init	;Any initialisation should already have been done 
			;when the RSX was called, so this is normally a no-op.
+0003	JP	bye	;Terminate Logo. Undo any initialisation and jump
			;to zero rather than returning.
+0006	JP	txtmode	;Switch to text mode, enable cursor.
+0009	JP	gfxmode	;Switch to graphics or split-screen mode. One 
			;parameter: 0 for fullscreen graphics, else split line.
+000C	JP	conin	;As the BIOS CONIN function, returning result in HL.
+000F	JP	const	;As the BIOS CONST function, returning result in HL.
+0012	JP	conout	;One parameter: Character to output. If not in 
			;fullscreen graphics mode, output it using the BIOS
			;CONOUT function.
+0015	JP	clrtext	;Clear some or all of the text screen. Two 
			;parameters (X,Y) giving the top left corner of the 
			;area to clear.
+0018	JP	setcurpos ;Set text cursor position. Two parameters (X,Y).
+001B	JP	scroll	;Scroll some or all of the text screen up one line. Two 
			;parameters (X,Y) giving the top left corner of the 
			;area to scroll.
+001E	JP	plot	;Plot a point. Four parameters: (X,Y,pen,colour)
			;where pen is 0 for PU, 1 for PD, 2 for PE, 3 for PX.
+0021	JP	draw	;Draw a line. Six parameters: (X1,Y1,X2,Y2,pen,colour)
+0024	JP	bg_set	;Set background colour. One parameter: the colour.
+0027	JP	clrgfx	;Clear graphic screen. Two parameters: colour, height
			;in pixels.
+002A	JP	beep	;Sound the beeper.
+002D	JP	memtop	;Return the top of memory in HL.	
+0030	JP	getpix	;Get the colour at the specified point. Two parameters
			;(X,Y). Returns the colour in HL.
+0033	JP	listst	;Return printer ready status in HL.
+0036	JP	list	;Send a byte to the printer. One parameter.
+0039	JP	nop	;Not called.
+003C	JP	nop	;Not called.
+003F	JP	nop	;Not called.
+0042	JP	nop	;Not called.
+0045	JP	nop	;Not called.
+0048	JP	savepic	;Save picture record. Two parameters; buffer address,
			;record number. Returns Z reset if buffer populated, 
			;set if no more records to be written.
+004B	JP	loadpic	;Load picture record. Two parameters: buffer address,
			;record number. Returns Z reset if record was OK,
			;set if file is invalid or end of file reached.

It is possible that the 'not called' entries were intended to be used by some primitives that PCW Logo doesn't implement (such as PAL, SETPAL, BUTTONP, PADDLE, TONES or WAIT). However as written, the module within PCW Logo as written does not forward these primitives to the RSX, so they are of no use.

Links

Return to archive listing