10DIM code 255:FOR pass=0 TO 3 STEP 3:P%=code:[OPT pass
20.s:   SWI"OS_WriteS":EQUD&416 \Select MODE 4
30      MVN     R2,#23          \loop for 24 rows, first 5 are blank
40.r:   ADR     R1,d-1          \R1 ;= PC + constant to point to d
50      SWI     "OS_NewLine"    \move cursor down, row 0 also blank
60      LDRB    R1,[R1,-R2]     \fetch row R2 of bitmap into R1
70      MOV     R3,#&80000000   \set up mask for centre column
80      CMN     R2,#10          \test if it is the centre row
90      ORR     R1,R3,R1,LSL #23 \set top bit and set up 8 bits below
100     MOV     R3,#20          \meanwhile column ;= -20
110     ORREQ   R1,R1,#2^22     \if so then fill in ninth point of arm
120.c:  MOV     R0,#32          \preset character to print to " "
130     TEQ     R1,R1,LSL R3    \put R3'th MSB (inverted) in N
140     TEQMI   R1,R1,ROR R3    \if N set (" ") then shift the other way
150     CMNPL   R2,#19          \if N clear ("*") check row within shape
160     MOVPL   R0,#42          \if in bounds then character ;= "*"
170     SWI     "OS_WriteC"     \Print chosen character
180     CMN     R3,#9           \test if column = 9
190     SUB     R3,R3,#1        \then decrement column
200     BNE     c               \loop until last column reached
210     ADDS    R2,R2,#1        \else increment and test row
220     BCC     r               \loop until row number overflows
230     SWI     "OS_ReadC"      \collect input character and discard it
240     SWI     "OS_Exit"       \exit cleanly to system
250.d:  EQUD    &C8A4000        \Bitmap of half snowflake, 19 rows
260     EQUD    &4920904E
270     EQUD    &4992FF92
280     EQUD    &C4E9020
290     EQUD    &408A
300.x:  ]
310NEXT                         :REM Loop to perform second pass
320SYS "OS_File",10,"snow",&FF8,,s,x :REM Save application with filetype
330*Run snow
