10 REM DROPKICK header (Listing 1)
   20 REM by Jeff Tullin
   30 REM for Bas2 B/B+/E/M/C with SWR
   40 REM (c) BAU 1990
   50 :
   60  MODE6
   70 :
   80  osasci=&FFE3
   90  osnwl=&FFE7
  100  accum=&70
  110  length=&71
  120  string=&72
  130  address=&74
  140  currentstring=&76
  150 :
  160  FOR opt = 4 TO 6 STEP 2
  170    P%=&8000:O%=&3000
  180    [OPT opt
  190   :
  200    JMP  osnwl
  210    JMP  entry
  220    EQUB (&82)
  230    EQUB (copy)
  240    EQUB (0)
  250   .title
  260    EQUS ("DROPKICK SWR Utility")
  270    EQUB (13)
  280   .copy
  290    EQUB (0)
  300    EQUS ("(C) 1989 Jeff Tullin")
  310    EQUB (0)
  320    EQUB (13)
  330    EQUS ("    Syntax: *SEEK <text>")
  340    EQUB (13)
  350    EQUS ("    Load data into SWR at &8200")
  360    EQUB (13)
  370    EQUS ("    Current data: ")
  380    EQUB (0)
  390   .end
  400    EQUS ("No (more) records found")
  410    EQUB (13)
  420   :
  430   .entry
  440    STA accum
  450    LDA &F3
  460    PHA
  470    LDA &F2
  480    PHA
  490    TYA
  500    PHA
  510    TXA
  520    PHA
  530    LDX  #6
  540   .savezeropage
  550    LDA  &71,X
  560    PHA
  570    DEX
  580    BPL  savezeropage
  590   :
  600    LDA  accum
  610    CMP# 3
  620    BEQ  break
  630    CMP# 9
  640    BEQ  help
  650    CMP# 4
  660    BEQ  starcom
  670   :
  680   .tobasic
  690    LDX# 0
  700   .restorezeropage
  710    PLA
  720    STA  &71,X
  730    INX
  740    CPX# 7
  750    BNE  restorezeropage
  760    PLA
  770    TAX
  780    PLA
  790    TAY
  800    PLA
  810    STA  &F2
  820    PLA
  830    STA  &F3
  840    LDA  accum
  850    RTS
  860   :
  870   .printrecord
  880    TYA
  890    PHA
  900    LDY# 0
  910   .prloop
  920    LDA  (currentstring),Y
  930    JSR  osasci
  940    CMP# 13
  950    BEQ  out
  960    CMP# 0
  970    BEQ  out
  980    INC  currentstring
  990    BNE  prloop
 1000    INC  currentstring+1
 1010    BNE  prloop
 1020   .out
 1030    INC  currentstring
 1040    BNE  ok
 1050    INC  currentstring+1
 1060   .ok
 1070    LDA  currentstring
 1080    STA  address
 1090    LDA  currentstring+1
 1100    STA  address+1
 1110    PLA
 1120    TAY
 1130    RTS
 1140   :
 1150   .help
 1160   .break
 1170    CMP# 3
 1180    BEQ  hello
 1190    LDA  (&F2),Y
 1200    CMP# 13
 1210    BEQ  hello
 1220    JMP  tobasic
 1230   :
 1240   .hello
 1250    PHA
 1260    LDA# (title MOD 256)
 1270    STA  currentstring
 1280    LDA# (title DIV 256)
 1290    STA  currentstring+1
 1300    JSR  printrecord
 1310    PLA
 1320    CMP# 3
 1330    BEQ  morethanhelp
 1340    LDX# 6
 1350   .extratext
 1360    JSR  printrecord
 1370    DEX
 1380    BNE  extratext
 1390    JSR  filename
 1400   .morethanhelp
 1410    JSR  osnwl
 1420    JMP  tobasic
 1430   :
 1440   .command
 1450    EQUS ("SEEK")
 1460   :
 1470   .starcom
 1480    LDX# 0
 1490   .checkcommand
 1500    LDA  (&F2),Y
 1510    AND# 223
 1520    CMP  command,X
 1530    BNE  notforme
 1540    INX
 1550    INY
 1560    LDA  (&F2),Y
 1570    CMP# ASC"."
 1580    BEQ  abbreviation
 1590    CPX# 4
 1600    BEQ  action
 1610    BNE  checkcommand
 1620   :
 1630   .notforme
 1640    JMP  tobasic
 1650   :
 1660   .abbreviation
 1670    INY
 1680   .action
 1690   .removespaces
 1700    LDA  (&F2),Y
 1710    CMP# 32
 1720    BNE  text
 1730    INY
 1740    CLC
 1750    BCC  removespaces
 1760   .text
 1770    CLC
 1780    TYA
 1790    ADC  &F2
 1800    STA  string
 1810    LDA  &F3
 1820    ADC# 0
 1830    STA  string+1
 1840    
 1850    LDA# 0
 1860    STA  address
 1870    LDA# &82
 1880    STA  address+1
 1890   :
 1900    LDY# 255
 1910   .findlength
 1920    INY
 1930    LDA  (string),Y
 1940    CMP# 13
 1950    BNE  findlength
 1960    STY  length
 1970    :
 1980   .newrecord
 1990    LDA  address
 2000    STA  currentstring
 2010    LDA  address+1
 2020    STA  currentstring+1
 2030   :
 2040   .scan
 2050    LDY# 0
 2060    LDA  (address),Y
 2070    CMP# ASC("|")
 2080    BEQ  exit
 2090    CMP  (string),Y
 2100    BEQ  remainder
 2110   .nextbyte
 2120    CLC
 2130    INC  address
 2140    BNE  nocarry
 2150    INC  address+1
 2160   .nocarry
 2170    LDA  (address),Y
 2180    CMP# 13
 2190    BNE  scan
 2200    INC  address
 2210    BNE  newrecord
 2220    INC  address+1
 2230    BNE  newrecord
 2240   :
 2250   .remainder
 2260    LDY  length
 2270    DEY
 2280   .check
 2290    LDA  (address),Y
 2300    CMP  (string),Y
 2310    BNE  nextbyte
 2320    CPY# 0
 2330    BEQ  suitable
 2340    DEY
 2350    CLC
 2360    BCC  check
 2370   .suitable
 2380    JSR  printrecord
 2390    JMP  scan
 2400   .exit
 2410    LDA# (end MOD 256)
 2420    STA  currentstring
 2430    LDA# (end DIV 256)
 2440    STA  currentstring+1
 2450    JSR  printrecord
 2460    JSR  osnwl
 2470    LDA #0
 2480    STA  accum
 2490    JMP  tobasic
 2500   :
 2510   .filename
 2520    LDA# &82
 2530    STA  address+1
 2540    LDA# 0
 2550    STA  address
 2560    TAY
 2570   .findname
 2580    LDA  (address),Y
 2590    CMP# ASC"|"
 2600    BEQ  found
 2610    INC  address
 2620    BNE  findname
 2630    INC  address+1
 2640    BNE  findname
 2650   .found
 2660    INY
 2670   .printfilename
 2680    LDA  (address),Y
 2690    CMP# 13
 2700    BEQ  endoftitle
 2710    CMP# 32
 2720    BCC  nogood
 2730    CMP# 123
 2740    BCS  nogood
 2750    JSR  osasci
 2760    INY
 2770    CPY# 16
 2780    BCC  printfilename
 2790   .endoftitle
 2800    JMP  osnwl
 2810   .nogood
 2820    INY
 2830    BNE  printfilename
 2840   :
 2850    NOP:NOP
 2860    EQUS  "|None"
 2870    EQUB  (13)
 2880   ]
 2890  NEXT
 2900 :
 2910 :
 2915 PRINT"Press SPACE to save code":REPEATUNTILGET=32
 2920 *SAVE "header" 3000 +208 8000 8000