ZX Like Pascal cross-compiler

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
Post Reply
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

ZX Like Pascal cross-compiler

Post by Andrew771 »

ZX Like Pascal is cross-compiler from Pascal program to Spectrum assembler. Download here
Full documentation only in Russian in the archive. I would be grateful if someone was able to translate into English, I myself write crookedly. :D
Here I will write briefly on English.

Supported:

Font for 4x8 characters (64 symbols per string)

Types:
byte
word
string[N] (N=1..255)
1- and 2-dimensional arrays of byte and word
1-dimensional arrays of string[N]

Constants: numeric 0..65535

Arithmetic expressions with:
+
-
*
/ (div)
% (mod)
( )
Random(x)

String expressions with concatenation

Standard operators supported:
:=, write(ln), read(ln), case, clrscr, delay, for-to-downto, gotoXY, if-then-else, randomize, readkey(key1,key2) (no standard realization), repeat-until, textbackground, textcolor, while-do, asm(procedure_name)

Operators for color setting:
border(x)
color(x) - x=attribute byte (flash+bright+paper+ink)

Operators for tiled sprites:
SpritePutClear(sprite_name,color,x,y)
SpritePutAnd(sprite_name,color,x,y)
SpritePutOr(sprite_name,color,x,y)
SpritePutXor(sprite_name,color,x,y)
SpritePutMirrorClear(sprite_name,color,x,y)
SpritePutMirrorAnd(sprite_name,color,x,y)
SpritePutMirrorOr(sprite_name,color,x,y)
SpritePutMirrorXor(sprite_name,color,x,y)

Sprites are defined by codes after last "end" of pascal program

Operators for windows:
WindowSet(x,y,width, height) - set of window tile parameters for next operators
WindowClear
WindowGet - window image to memory
WindowPut - window image from memory
WindowScrollUp - on 1 pixel
WindowScrollDown - on 1 pixel
WindowScrollLeft - on 1 pixel
WindowScrollRight - on 1 pixel

Operators for maps:

Map is 2-dimensional labirint, landscape, playing field... Map is associated with 2-dimensional array of byte. Array contains ID of cells. Sprite bitmap is sequence of sprite codes for ID (after last "end" of pascal program).

MapSet(array_name,sprite_bitmap_name,x,y,width, height) - set of array and bitmap names and screen tile coordinates for map output
MapPut1x1(x,y) - output of 1x1 tile map to screen from x,y cells at array
MapPut2x2(x,y) - output of 2x2 tile map to screen from x,y cells at array
MapSearch(...) - search a cell ID at map array for various criteria

Other operators:
ArrayClear(array_name) - quick cleaning of numeric or string array
ScreenThaw
SoundEffect(wave_n,wave_time,wave_frequency) - wave sound effect for beeper
VirtScreenClear - cleaning of virtual (shadow) screen in memory
VirtScreenPut - output virtual screen from memory to real screen

Filling the virtual screen with texts and sprites occurs as well as the real screen, with the special compilation flag turned on.

After last "end" of pascal program are placed a codes of sprites, assembler procedures and other information. It is copied without changes to the assembler file.
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
Post Reply