ARGYLL Author: regregex Category: Christmas Challenge System: BBC Micro A/B/Master, Acorn Electron Language: 6502 assembler (MASM) Len source code: 1676 bytes Len exe file: 49 bytes Len code only: 49 bytes Instructions: Install and open BeebEm ( http://www.mkw.me.uk/beebem/ ). Click File -> Disc Options -> New Disc 0, enter argyll.ssd Click Edit -> Import Files to Disc -> Disc 0, select xargyll.inf At the BASIC prompt, type */X.ARGYLL 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 argyll.inf as above, then enter: *EDIT ARGYLL Shift+F10 (SHIFT+F0) hides newline markers. Description: The object code clears the screen, then loops through rows 19 to 1 of the shape and columns 19 to 1 of each row. At each position it adds the row number y to the column number x and tests whether: x + 127 + y == 0 (mod 6) If the sum divides then it prints an asterisk, forming the forward diagonals. Otherwise it modifies the column value and tests for: -x + 63 + y == 0 (mod 6) If this sum divides, the code branches to print an asterisk otherwise it inverts the column value again, finds it positive and falls through to print a space. The constants are chosen so that a single EOR operation negates x and modifies the constant term. The character itself is created by EORing zero (from a successful division) or 10 (otherwise) with 42, forming ASCII values 42 or 32 respectively. At the end of each row, the code calls a standard OS routine to print a newline. Once 19 rows are completed, it jumps into the OSRDCH entry point to read (and discard) a character of input and then return control to the user. Comments: Trailing spaces are printed on each line. The X.ARGYLL binary is relocatable.