The emulator described here - "ZCE" - is a "command-line" edition, which means a "K>" prompt is sent to stdout, and input is expected from stdin. Graphics may be sent to stdout as Sixel graphics. These can be viewed using newer XTerms and classical DECterms. The Sixel graphics appear between command line prompts, so not in a separate window. Sixel graphics files may be viewed by just using "cat" under Unix, and "TYPE" under VMS. The image below is displayed using JavaScript [if enabled in the browser].


Some Applications

1K Chess [after a match against itself :)]

This famous program was relocated to address 0x2000 and made accessible from BASIC. The board may then be displayed in different ways [although that should perhaps not be done...]. Here the AI routine, change of player, and the [Sixel] display of the board were called in a loop.

ZX81 1K Chess

Download the board as a Sixel graphics file.

Star Trek [1973 version]

This famous program was ported to ZX81 BASIC; currently it has a line count of about 700, and it needs more than 16K RAM. Here is an example run in command-line mode:

ZX81 Star Trek

An HTTP Client

Here is a session with a very basic HTTP client:

ZX81 HTTP Client

Server-side ZX81 Scripts

Click here for the listing of a server-side script. A$ may be assigned by appending the argument to the url such as here [seconds of the real-time clock as an example]. And click here for the listing of a simple message board :)

Example of single-stepping the ROM

k> r0     # zero all registers
k> z      # show registers
*pc: 0000  [pc]:   d3
 sp: 0000  [sp]: fdd3
  a:   00     f:   00
 bc: 0000    de: 0000    hl: 0000
 ix: 0000    iy: 0000
k> b0x416 # set breakpoint in initialization
k> j0     # run from start
 pc: 0416:     cd0702:  call  0207
 sp: fffd  [sp]: 3e00
  a:   1e     f:   40 z
 bc: 00fe    de: 0000    hl: 4099
 ix: 0000    iy: 4000
k> s      # start single-stepping
 pc: 0207:     213b40:  ld    hl,403b
 sp: fffb  [sp]: 0419
  a:   1e     f:   40 z
 bc: 00fe    de: 0000    hl: 4099
 ix: 0000    iy: 4000
k> s
 pc: 020a:         7e:  ld    a,(hl)
 sp: fffb  [sp]: 0419
  a:   1e     f:   40 z
 bc: 00fe    de: 0000    hl: 403b
 ix: 0000    iy: 4000
k> s
 pc: 020b:         17:  rla   
 sp: fffb  [sp]: 0419
  a:   40     f:   40 z
 bc: 00fe    de: 0000    hl: 403b
 ix: 0000    iy: 4000

Under development - I

Extended memory: some Z80 instructions such as call and ret were modified to allow switching to another bank, based on a bank indicator array. Emulator Z80 code, previously located in the first 64K has now been moved to above 64K. Certain POKEs at strategic positions allow PEEK, POKE and USR in another bank from within BASIC. For PEEK, this works because the LD A,(BC) was modified to look at the specified bank. Developing code is a bit difficult, because the indicator array has to be set manually.

Under development - II

See here, here, and here for examples of using the Mini-XML library for loading and saving programs: click right mouse to view the xml source. The first example is interpreted by reading it into the emulator; the second is a hexadecimal-only memory representation; the third shows the memory's contents after the example is run. The second form is useful if the memory is mainly occupied by machine code.

The Z80doku

This is one 4x4 part of a 16x16 nibble hexadoku:

A Z80 would execute: add a,b; sub c; and d; or e; ld c,h; ld e,l; ld l,(hl); ld a.a. Would it be possible to have a complete hexa- or z80doku which does not crash the ZX81 and preferably compute something useful?

The Source Code of the Emulator


Unofficial Versions of the z81 Emulator

Download version 2.2 with extensions to the z81/xz81 emulator with hires and Sixel graphics, or version 2.3 with these extensions, and special options for running ASZMIC.

Unofficial Version 2.2.0 of the sz81 Emulator

Download extensions to the sz81 emulator for hires graphics, Chroma, ASZMIC, and ZeddyNet support.

JSZeddy: a ZX81 emulator in JavaScript

JSZeddy and its manual.

The ZX Font, for HTML Screen Output

the quick brown fox jumps over the lazy dog
Inv.nums: áâãäåæçèéà
Specials: 12345678901234567
Specials: "$:?()><=+-*/;,.£
Inv.spcs: ÒÔêïØÙîìíÛÝÚßëÜÞ¤
Graphics: ° ± ² ³ ´ µ ¶ · ¸ ¹ º
Graphics: À Á Â Ã Ä Å Æ Ç È É Ê
Extra: !#%&'@[\]^_`{|}~
Extra: 1234567890123456

The Computer Image

Download the image as a Sixel graphics file.


Last updated February 10, 2015