HiSoft-C
Disassembled code of HiSoft C compiler version 1.3 for ZX Spectrum
1. Introduction
HiSoft C is c compiler available for ZX Spectrum and Amstrac CPC. The compiler uses old K&R notation so you can use ansi2kr converter for conversion of your ANSI C source code into K&R version. Then you can use c2tap utility for conversion of your source to tap file format.
An interesting fact is HiSoft C was written in BDS C of Leor Zolman and then disassembled and optimized manually.
There are various libraries for HiSoft C. For example:
2. Resources
- Original HiSoft C manual for ZX Spectrum in PDF
- Original HiSoft C manual for Amstrad CPC in PDF
- Article ZX Magazín - HiSoft C 1.1 in PDF
- Article Historické kompilátory jazyka C na vlastní kůži (2)
3. How to compile
3.1 Prerequisities
- z80asm
- skoolkit 6.4
- ZX spectrum emulator, ZEsarUX recommended
3.2 Compilation
z80asm cc.asm -o cc-tmp.bin ; bin2tap.py -o 25200 cc-tmp.bin cc.tap
4. Original process of disassembling
4.1 Decompilation
z80dasm -a -t -l -g 25200 -b blocks.txt code.bin > code.asm
4.2 Recompilation
z80asm code.asm -o code-tmp.bin ; bin2tap.py -o 25200 code-tmp.bin cc.tap
5. HiSoft Editor usage
To start editor press capshift 1
and ENTER
(or EDIT
)
5.1 File operations
p [m,n,s]
put into cassetteg [,,s]
get from cassette
5.2 Compiler
c enter
back to compiler#include [file name]
compile programsymbolshift i
run program#error
to sacrifice error messages and yield more memory
5.3 Basic
b enter
go to basicRANDOMIZE USR 25200
back to compiler
5.4 Editor commands
i [m,n]
insert textl [m,n]
listk n
set number of lines listed on screenw [m,n]
write text to printerd [m,n]
delete linesm [m,n]
move linen [m,n]
renumber linee n
edit linev
view defaults
5.5 Special keys
SS F
{SS G
}SS I
EOFSS Q
<=SS W
<>SS E
>=