PRESENT
Author: regregex
Category: Christmas Challenge
System: BBC Micro A/B/Master, Acorn Electron
Language: 6502 assembler (MASM)
Len source code: 333 bytes
Len exe file: 67 bytes
Len code only: 67 bytes
Instructions:
Install and open BeebEm ( http://www.mkw.me.uk/beebem/ ).
Click File -> Disc Options -> New Disc 0, enter present.ssd
Click Edit -> Import Files to Disc -> Disc 0, select xpresent.inf
At the BASIC prompt, type */X.PRESENT and press RETURN.
To reproduce the screenshots:
Click Hardware -> BBC Model -> BBC Master 128
Enter the following:
*INSERT 9
*CONFIGURE FILE 9
*CONFIGURE MODE 4
Press Ctrl+F12 (CTRL+BREAK), releasing Ctrl last.
Then follow the instructions above.
To show the editor screen, import present.inf as above, then enter:
*EDIT PRESENT
Shift+F5, 4, RETURN hides the function key display.
Shift+F10 (SHIFT+F0) hides newline markers.
Description: The object code first selects display MODE 4, an ASCII mode
with square pixels that has the backslash character; this automatically
clears the screen and places the cursor at the top left. It positions
the cursor with six newlines and 19 spaces, then prints the bow on the
centreline and leaves the cursor to its right.
For each of the nineteen rows of the box, the program prints a newline
followed by eleven spaces to move the cursor towards the centre. Then
the nineteen characters of each row are printed, each selected from a
four-character string according to whether the X and/or Y co-ordinates
are non-zero, modulo 9. (SGN is the most efficient way to decide as the
inequality operators are non-associative and return a negative result
when true.) 256 spaces are printed inside the box to align the ribbon
and right edge vertically. Finally it waits for a keypress, then exits.
Comments:
Suitable for an SBC running BASIC if selection of MODE 4 is removed.
Delete values ,4,22 from the source or patch the binary with bytes
&FF, &FF.