PhilTipping-PlasMa-PleX-2023

Author: Phil Tipping
Category: Christmas Challenge
System:   PlasMa machine v5.13 & PlasMaSim simulator v5.15
Language: PleX, assembled with Plasm assembler v4.17
Len source code: 1200 bytes
Len exe file:    n/a
Len code only:   90 bytes (45 words)

Instructions:
1. Install & run PlasMaSim from philizound.co.uk/plasma/plasma.html
2. Follow startup instructions to load microcode 3 (PleX)
3. Set hex 3039 onto left-hand LOAD switches
4. Press 't' to load Challenge program from .plh file
5. Press Z (uppercase) to set PC to hex 10 (start address of program)
6. Press 'r' to run
.. or if you have a real machine:
1. Switch on and follow startup sequence to load microcode 3
2. Press RESET switch, press RUN switch
3. Assuming a bootstrap has been pre-programmed into fixed store,
machine will loop waiting for paper tape to be loaded.
4. Insert sd-card into 'paper tape reader' slot.
5. Press LOAD PTR switch.
6. Bootstrap will read paper tape and jump to address hex 10 to
start the challenge program.

Description:
The program draws a single diamond shape at multiple positions on the oper screen (operator's console).
The oper is character based and has extra-code routines for writing a character at a specified row and column. Lines 68-85 are a sub-routine for displaying a star/blob at a specific X/Y point, which are supplied via registers 2 & 3.

Lines 18-62 are an inner loop to draw a single diamond shape with an apex at X/Y position in registers 2 & 3.
The registers are preserved on the stack as they are incremented/decremented while each of the 4 sides of the diamond are plotted.

The outer loop from lines 15-64 adjust the apex start position by the size of the diamond.

All counters count down so the conditional test can just check for zero or negative values.

The number and sizes of the diamond shapes are defined with Equate statements on lines 4-7.

A few other points of interest:
Line 1 tells the assembler to expect PleX opcodes (as opposed to the other microcodes supported Toy-A and Toy-B).

Lines 3-10 define some Equates for code clarification.

Line 12 defines the memory address for the following code.

All 19 lines are plotted, but the oper screen only has 18 lines. There is no scroll feature on the system, so the last line is overlaid.

The PleX instruction set is described here:
http://www.philizound.co.uk/plasma/PlasMa-InstructionSet-PleX.pdf

Comments:
The 4 files with root names 3-LogikerChallenge-3039 are:
pls = source code
pll = assembler listing; the final line gives the code size
plh = hex output for simulator
pl8 = 8-hole punched 'paper tape' for real machine
(if you open it with a text editor, you'll see the holes)

The '3039' is just an arbitrary number using my conection for naming source files. The first '3' indicates a PleX program (1 is for Toy-A, and '2' is for Toy-B). The other digits are just a unique number.
These are the digits which are entered onto the simulator LOD switches to tell it which file to load when you press the 't' key.

The screenshot shows the PlasMaSim simulator result.
The 2 photos show the result on the PlasMa machine.