
 1000         .TF CLEAR
 1010         .LIST OFF
 1020  *--------------------------------
 1030         .MA SPIRAL
 1040         >LEFT             move left side up
 1050  BOTLFT .SE BOTLFT-1        and move corner up
 1060         >BOTTOM           move bottom left
 1070  BOTRGT .SE BOTRGT-1        and move corner left
 1080         >RIGHT            move right side down
 1090  TOPRGT .SE TOPRGT+1        and move corner down
 1100         >TOP              move top right
 1110  TOPLFT .SE TOPLFT+1        and move corner right
 1120         .DO TOPLFT<13     done?
 1130         >SPIRAL           no, do it again
 1140         .FIN
 1150         .EM
 1160  *--------------------------------
 1170         .MA GETADR
 1180  ADRTO  .SE ADRFRM
 1190  BLOCK  .SE Y.CORD/8      hi, mid, or low, 0-2
 1200  BLK.AD .SE BLOCK*$28     block offset
 1210  TEMP   .SE BLOCK*8
 1220  LINE   .SE Y.CORD-TEMP   line within block, 0-7
 1230  LIN.AD .SE LINE*$80      line offset
 1240  ADRFRM .SE $400+BLK.AD+LIN.AD+X.CORD
 1250         LDA ADRFRM
 1260         STA ADRTO
 1270         .EM
 1280  *--------------------------------
 1290         .MA LEFT
 1300  Y.CORD .SE Y.CORD+1      down one step
 1310         >GETADR
 1320         .DO Y.CORD<BOTLFT done?
 1330         >LEFT             no, again
 1340         .FIN
 1350         .EM
 1360  *--------------------------------
 1370         .MA BOTTOM
 1380  X.CORD .SE X.CORD+1      right one step
 1390         >GETADR
 1400         .DO X.CORD<BOTRGT done?
 1410         >BOTTOM           no, again
 1420         .FIN
 1430         .EM
 1440  *--------------------------------
 1450         .MA RIGHT
 1460  Y.CORD .SE Y.CORD-1      up one step
 1470         >GETADR
 1480         .DO Y.CORD>TOPRGT done?
 1490         >RIGHT            no, again
 1500         .FIN
 1510         .EM
 1520  *--------------------------------
 1530         .MA TOP
 1540  X.CORD .SE X.CORD-1      left one step
 1550         >GETADR
 1560         .DO X.CORD>TOPLFT done?
 1570         >TOP              no, again
 1580         .FIN
 1590         .EM
 1600  *--------------------------------
 1610  BOTLFT .SE 23       bottom left Y coord
 1620  BOTRGT .SE 39       bottom right X coord
 1630  TOPRGT .SE 0        top right Y coord
 1640  TOPLFT .SE 1        top left X coord
 1650  X.CORD .SE 0        start with upper
 1660  Y.CORD .SE 0          left corner
 1670  ADRFRM .SE $400
 1680  *--------------------------------
 1690         LDX #960     do the loop 960 times
 1700         LDY /960
 1710         LDA #$A0     put space in center
 1720         STA $5B4
 1730  LOOP   >SPIRAL      do one spiral
 1740  END    DEX
 1750         BNE .1       branch if not done
 1760         DEY
 1770         BPL .1
 1780         JMP $3D0     exit to DOS
 1790  .1     JMP LOOP     go spiral again

