ZXpert

Products: ZXpert
Date: 1987
Type: Program
Platform(s): TS 2068

ZXpert lets you build an expert system on any subject and then consult it. A rule base is entered and changed in the Edit option; Run starts a consultation in which the program asks questions to be answered Y (yes), N (no) or U (unknown) and works through its rules until it can report the probable cause of a problem and its solution, or says it is stumped. Rule bases are saved and loaded as a pair of CODE files, and Print lists one on the printer. The sample rule base on this tape, the “Photo Fault Finder for colour snapshots”, diagnoses sharpness, exposure and focus problems in prints.

The screens read “ZXpert version 1.0” and “ZXpert Copyright ©1987 NovelSoft”; NovelSoft sold it as an artificial-intelligence system for creating an expert system on any topic. The sample rule file was named PHOTO on the disk.

Program Analysis

Structure

Almost all of ZXpert is machine code: ZXPERT.C1, 13,618 bytes loaded at 32000 after CLEAR 31999, draws the main menu (Edit, Run, Load, Save, New, Print, Quit) and runs the editor and inference engine. The short BASIC program only handles files. It calls the code with RANDOMIZE USR 32000, and when the user picks Load, Save or Quit the code returns with a flag in address 65535 (2, 3 or 4). BASIC then asks for a file name and loads or saves the rule base as name.C1 (7,702 bytes at 54809) and name.C2 (8,202 bytes at 46391) before calling the code again.

Notable Techniques

  • A one-byte mailbox at 65535 passes the menu choice from machine code back to BASIC.
  • File names are cut to six characters before saving, matching the disk system’s name length.
  • Keyboard click and caps lock are switched with POKE 23658 around the input prompts.

Potential Issues

  • The rule base is two fixed-size CODE blocks, so the knowledge base size is limited to the reserved areas whatever the rules contain.
  • An empty file name returns to the menu, but a name that is not on the tape leaves the loader searching until BREAK is pressed.

This copy came from a Larken disk and was converted for tape: the RANDOMIZE USR 100 disk prefixes were removed, so the rule-base LOAD and SAVE lines now work on tape by name, and the Larken disk backup routine at lines 8099–8225 was removed. The PHOTO rule base follows the engine on the tape: choose Load and type PHOTO. It was tested in ZEsarUX.

A second rule base, ANALYST, follows PHOTO on the tape. It comes from an unlabeled Oliger disk (as ANALYST.r and ANALYST.f, renamed ANALYST.C1 and ANALYST.C2 so that ZXpert finds them) and “tries to determine the shape of a person’s intelligence based on their handwriting”. It asks about two dozen yes/no questions on word spacing, legibility, punctuation, ties between letters, size and slant, then lists traits such as “Logical mind” or “Detail-minded”. Choose Load and type ANALYST. It was tested in ZEsarUX.

Related Products

Artificial intelligence system. Create an expert system on any topic.

Image Gallery

Source Code

    1 POKE 23658,0: RANDOMIZE USR 32000
    2 POKE 23658,8: LET flag=PEEK 65535
    3 IF flag=2 THEN GO TO 1000
    4 IF flag=3 THEN GO TO 2000
    5 IF flag=4 THEN STOP 
    6 GO TO 1
  999 REM LOAD 
 1000 PRINT AT 20,1;"Filename: ";: INPUT "->";f$: PRINT f$
 1010 IF f$="" THEN GO TO 1
 1012 POKE 23658,8
 1019 REM TAPE LOAD DATA
 1020 PRINT AT 19,0: LOAD f$+".C1"CODE 54809,7702
 1030 PRINT AT 19,0: LOAD f$+".C2"CODE 46391,8202
 1040 GO TO 1
 1999 REM SAVE 
 2000 PRINT AT 20,1;"Filename: ";: INPUT "->";f$: PRINT f$
 2010 IF f$="" THEN GO TO 1
 2011 IF LEN F$>6 THEN LET F$=F$( TO 6)
 2012 POKE 23658,8
 2020 SAVE f$+".C1"CODE 54809,7702
 2030 SAVE f$+".C2"CODE 46391,8202
 2040 GO TO 1
 7999 REM LARKEN DISK STARTUP
 8010 REM Prepare for loading 
 8015 PAPER 6: INK 6: BORDER 6: POKE 23658,8: CLEAR 31999
 8025 PRINT AT 14,0: LOAD "ZXPERT.C1"CODE 32000
 8030 GO TO 8500
 8099 REM  removed (LKDOS-only)
 8100 REM  removed (LKDOS-only)
 8105 REM  removed (LKDOS-only)
 8110 REM  removed (LKDOS-only)
 8115 REM  removed (LKDOS-only)
 8125 REM  removed (LKDOS-only)
 8200 REM  removed (LKDOS-only)
 8205 REM  removed (LKDOS-only)
 8220 REM  removed (LKDOS-only)
 8225 REM  removed (LKDOS-only)
 8499 REM Start ZXpert
 8500 POKE 65535,0
 8505 POKE 23658,0
 8510 GO TO 1

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.