home *** CD-ROM | disk | FTP | other *** search
/ ISV Strong Games / ISV_STRONG_GAMES.iso / arcade / bombs / !Bombs / Code / GetSprs (.txt) next >
RISC OS BBC BASIC V Source  |  1993-03-24  |  15KB  |  680 lines

  1.  > <Bombs$Dir>.Code.GetSprs
  2.  *** Some help: skip all code to the next REM
  3.  base 250<<10,sprarea 128<<10
  4. <sprarea!0=128<<10:sprarea!4=0:sprarea!8=16:sprarea!12=16
  5.  13+128:
  6.  "OS_SpriteOp",256+10,sprarea,"<Bombs$Dir>.Code.Over13"
  7. H%=init:
  8. H%=sprinit:
  9. getsprites
  10.  "OS_File",10,"<Bombs$Dir>.GameSpr",&FFD,,!sprites,!sprites+!eos
  11. "FX 15":
  12. $;" at line ";
  13. getsprites
  14.  y%=0 
  15.  x%=0 
  16.  "OS_SpriteOp",256+34,sprarea,"pattern",x%*64,y%*64-40
  17. EA%=0:B%=0:C%=64:D%=32:E%=tb+masked:F%=256:G%=0:H%=convertspr:
  18.  0,0,C%*4-1,D%*4-1
  19.  *** Don't change the dimensions of these sprites!
  20. get_pat("t_empty0",tb+EM)
  21. get_pat("t_empty1",tb+masked+1)
  22. get_pat("t_empty2",tb+masked+2)
  23. get_pat("t_empty3",tb+masked+3)
  24.  *** Nor these!
  25. get("t_floor",tb+FL,0,0)
  26. get("t_riveted",tb+RI,0,0)
  27. get("t_dissolver",tb+DI,0,0)
  28. get("t_ice",tb+IC,0,0)
  29. get("t_teleport",tb+TR,0,0)
  30. get("t_spin",tb+SP,0,0)
  31.  f%=0 
  32. get("t_slot"+
  33. ~f%,tb+SL+f%,0,0)
  34.  *** You can change these, but make sure that all the frames of
  35.  *** an animation are the same size!
  36.  *** Align the sprites by the following rules: the last two parameters
  37.  *** of the PROCget are the offsets, positive offsets mean right and up.
  38.  *** If you specify an offset larger than 128, the sprite is centered,
  39.  *** but after that an extra offset is added by subtracting 256. So:
  40.  *** 256,-4 means the sprite is centered horizontally, but moved vertically
  41.  *** by four pixels down.
  42.  *** 256,256+2 means the sprite is fully centered, but after that it's
  43.  *** moved up two pixels.
  44.  f%=1 
  45. get("limb_right"+
  46. f%,f%-1,256,0)
  47. get("limb_left"+
  48. f%,f%+4,256,0)
  49. get("limb_up"+
  50. f%,f%+9,256,0)
  51. get("limb_down"+
  52. f%,f%+14,256,0)
  53.  f%=1 
  54. get("droid"+
  55. f%,droidspr+f%-1,256,256)
  56. get("switch",switchspr,256+4,256+8)
  57. get("c_3",cb,256,32)
  58. get("c_2",cb+1,256,32)
  59. get("c_1",cb+2,256,32)
  60. get("bomb_small",bb,256,256+3)
  61. get("bomb_medium",bb+1,256,256+4)
  62. get("bomb_large",bb+2,256,256+4)
  63. get("bomb_mine",bb+minei-1,256,256+8)
  64. get("bomb_mine",bb+minei,256,256+8)
  65. get("bomb_mine",bb+minei+1,256,256+8)
  66. get("explosion1",eb,256,256)
  67. get("explosion2",eb+1,256,256)
  68. get("explosion3",eb+2,256,256)
  69. get("explosion4",eb+3,256,256)
  70. get("explosion5",eb+4,256,256)
  71.  e%=0 
  72. get("#"+
  73. e%,digitb+e%,256,0)
  74. get2("t#"+
  75. e%,digitb+e%+10,0,0)
  76. get2("patt2",pattern2,0,0)
  77. get("time",dispb,3,0)
  78. get("level",dispb+1,3,0)
  79. get("pass",dispb+2,3,0)
  80. get("score",dispb+3,0,0)
  81. get("copyright",dispb+4,0,0)
  82. get("lives",dispb+5,3,0)
  83. get(s$,s%,I%,G%)
  84. getspr(1)
  85. get2(s$,s%,I%,G%)
  86. getspr(0)
  87. getspr(m%)
  88.  "OS_SpriteOp",256+40,sprarea,s$ 
  89.  A,A,A,W%,H%
  90.  I%>127 
  91.  I%=-W%/2+I%-256
  92.  G%>127 
  93.  G%=-H%/2+G%-256
  94. F%=I% 
  95. 3:K%=I% 
  96. C%=W%+K%
  97. e)C%=(C% 
  98. 3)-4*((C% 
  99. 3)>0):D%=H%:E%=s%
  100.  F%<0 
  101.  F%=128-F%
  102.  G%<0 
  103.  G%=128-G%
  104.  "OS_SpriteOp",256+34,sprarea,s$,K%*4
  105. i.A%=0:B%=0:F%=F% 
  106.  m%<<8:H%=convertspr:
  107.  0,0,C%*4-1,D%*4-1
  108. get_pat(s$,n%)
  109.  "OS_SpriteOp",256+34,sprarea,s$
  110. o9A%=0:B%=0:C%=64:D%=32:E%=n%:F%=256:G%=0:H%=getsp:
  111. p0A%=0:B%=0:C%=0:D%=tb+masked:H%=dosprite:
  112. q)A%=0:B%=0:C%=1:D%=n%:H%=dosprite:
  113. r>A%=0:B%=0:C%=64:D%=32:E%=n%:F%=256:G%=0:H%=convertspr:
  114.  0,0,C%*4-1,D%*4-1
  115. w"pix%=2:xres%=320:bitspercol%=8
  116. numanims=5
  117. droidspr=numanims*4
  118. switchspr=droidspr+5
  119. patternspr=switchspr+1
  120. cb=patternspr+1
  121. bb=cb+3
  122. eb=bb+6
  123. dispb=eb+5
  124. digitb=dispb+8
  125. pattern2=digitb+20
  126. tb=pattern2+1
  127. masked=60
  128. EM=0:FL=1:RI=2
  129. DI=3:IC=4:TR=5
  130. SP=6:SL=7
  131. pulsei=0:minei=4:droidi=7
  132.  tb+masked+3>256-64 
  133.  1,"Too many sprites"
  134. empty=12:sp=13:link=14
  135.  opt%=0 
  136. P%=base:[OPT opt%
  137. setempty
  138. MOV PC,R7
  139.     .init
  140. STMFD    (sp)!,{link}
  141. MOV      R0,#150
  142. adr    (1,tmp)
  143. STR      R0,[R1]
  144. MOV      R0,#149
  145. STR      R0,[R1,#4]
  146. MVN      R0,#0
  147. STR      R0,[R1,#8]
  148. MOV      R0,R1
  149. "SWI      "OS_ReadVduVariables"
  150. LDR      R0,[R1,#4]
  151. str    (0,ss)
  152. str    (0,to)
  153. ADD      R0,R0,#80*1024
  154. str    (0,from)
  155. ldr    (0,filemax)
  156. adr    (1,file)
  157. ADD      R0,R1,R0
  158. str    (0,sprites)
  159. LDMFD    (sp)!,{PC}^
  160. .sprinit
  161. ldr    (0,sprites)
  162. MOV      R1,#&400
  163. STR      R1,eos
  164. ADD      R1,R0,R1
  165. MOV      R2,#0
  166. .clears
  167. STR      R2,[R0],#4
  168. CMP      R0,R1
  169. BNE      clears
  170. MOV      PC,link
  171. index=6:mask=7:dp=8
  172. scr=9:wd=10:ht=11
  173. [OPT opt%
  174. .dosprite
  175.  STMFD    (sp)!,{R0-R12,link}
  176. STR      R0,xc
  177. STR      R1,yc
  178. STRB     R2,maskf
  179. STR      R3,sprn
  180. LDR      R0,sprn
  181. ldr    (dp,sprites)
  182. LDR      R0,[dp,R0,ASL #2]
  183. CMP      R0,#0
  184. BNE      kn
  185. SWI      "OS_WriteS"
  186. -EQUS     "No such sprite":EQUD &D0A:ALIGN
  187. MOV      PC,#0
  188. ADD      dp,dp,R0
  189. LDRB     wd,[dp]
  190. STR      wd,sw
  191. LDRB     ht,[dp,#1]
  192. STR      ht,sh
  193. MOV      index,wd
  194. LDR      R0,xc
  195. LDRB     R1,[dp,#2]
  196. CMP      R1,#129
  197. %ADDLT    R0,R0,R1,ASL #640 
  198. xres%
  199. SUBGE    R1,R1,#128
  200. %SUBGE    R0,R0,R1,ASL #640 
  201. xres%
  202. BIC      R0,R0,#15
  203. LDR      R1,yc
  204. LDRB     R2,[dp,#3]
  205. CMP      R2,#129
  206. ADDLT    R1,R1,R2,ASL #2
  207. SUBGE    R2,R2,#128
  208. SUBGE    R1,R1,R2,ASL #2
  209. STR      R1,yc
  210. BL       calc
  211. SUB      scr,scr,#4
  212. STR      scr,offset
  213. ldr    (1,clipx2)
  214. CMP      R0,R1
  215. BGE      skipsprite
  216. ldr    (1,clipx)
  217. CMP      R0,R1
  218. ADDLT    R0,R0,#1280*64
  219. 'MOV      R0,R0,LSR #2 
  220. (xres% 
  221. STMFD    (sp)!,{R0}
  222. LDR      R0,yc
  223. ldr    (1,clipy2)
  224. CMP      R0,R1
  225. LDMGEFD  (sp)!,{R0}
  226. BGE      skipsprite
  227. ldr    (1,clipy)
  228. CMP      R0,R1
  229. RSBLT    R0,R0,R1
  230. MOV      R0,R0,LSR #2
  231. ADD      R1,R0,ht
  232. MLALT    dp,R0,wd,dp
  233. 8SUBLT    scr,scr,R0,ASL #5+xres% 
  234. 640+bitspercol% 
  235. 8SUBLT    scr,scr,R0,ASL #7+xres% 
  236. 640+bitspercol% 
  237. SUBLT    ht,ht,R0
  238. CMP      ht,#0
  239. LDMLEFD  (sp)!,{R0}
  240. BLE      skipsprite
  241. ldr    (2,clipy2)
  242. CMP      R1,R2,LSR #2
  243. RSBGE    ht,R0,R2,LSR #2
  244. STR      scr,offset
  245. LDMFD    (sp)!,{R0}
  246. ldr    (2,clipx2)
  247. :MOV      R2,R2,LSR #2 
  248.  (xres% 
  249. 320)+(4 
  250.  bitspercol%)
  251. CMP      R0,R2,ASL #1
  252. BGT      neg
  253. ADD      R1,R0,wd
  254. CMP      R1,R2
  255. RSBGE    index,R0,R2
  256. STR      index,si
  257. LDRB     R0,maskf
  258. CMP      R0,#0
  259. BEQ      nmask
  260. B        maski
  261. <SUB      R0,R0,#1280*64 
  262. (2*8 
  263. bitspercol%*(640 
  264. xres%))
  265. ADD      index,R0,wd
  266. ldr    (2,clipx)
  267. :MOV      R2,R2,LSR #2 
  268.  (xres% 
  269. 320)+(4 
  270.  bitspercol%)
  271. CMP      index,R2
  272. BLE      skipsprite
  273. SUB      R1,R2,R0
  274. ADD      scr,scr,R1
  275. ADD      dp,dp,R1
  276. SUB      index,wd,R1
  277. STR      index,si
  278. LDRB     R0,maskf
  279. CMP      R0,#0
  280. BEQ      nmask
  281. .maski
  282. LDRB     R0,sw
  283. LDRB     R1,sh
  284. MLA      mask,R0,R1,dp
  285. BL       masking
  286. .skipsprite
  287. LDMFD    (sp)!,{R0-R12,PC}^
  288. .nmask
  289. BL       nomask
  290. LDMFD    (sp)!,{R0-R12,PC}^
  291. .masking
  292. LDR      R0,[scr,index]
  293. LDR      R1,[mask,index]
  294.       R0,R0,R1
  295. LDR      R1,[dp,index]
  296. R      R0,R0,R1
  297. STR      R0,[scr,index]
  298. SUBS     index,index,#4
  299. BNE      masking
  300. SUBS     ht,ht,#1
  301. QS   PC,link
  302. ADD      dp,dp,wd
  303. ADD      mask,mask,wd
  304. LDR      R0,offset
  305. SUB      R1,R0,scr
  306. ,2SUB      scr,R0,#bitspercol% 
  307. 4*xres% 
  308. 320*160
  309. STR      scr,offset
  310. SUB      scr,scr,R1
  311. MOV      R0,index
  312. LDR      index,si
  313. B        masking
  314. .nomask
  315. LDR      R0,[dp,index]
  316. STR      R0,[scr,index]
  317. SUBS     index,index,#4
  318. BNE      nomask
  319. SUBS     ht,ht,#1
  320. QS   PC,link
  321. ADD      dp,dp,wd
  322. LDR      R0,offset
  323. SUB      R1,R0,scr
  324. <2SUB      scr,R0,#bitspercol% 
  325. 4*xres% 
  326. 320*160
  327. STR      scr,offset
  328. SUB      scr,scr,R1
  329. LDR      index,si
  330. B        nomask
  331. .convertspr
  332. STMFD    (sp)!,{R0-R6}
  333. ldr    (6,to)
  334. ADD      R6,R6,#80<<10
  335. SUB      R6,R6,#320
  336. SUB      R6,R6,R1,ASL #8
  337. SUB      R6,R6,R1,ASL #6
  338. ADD      R0,R6,R0
  339. MOV      R4,#0
  340. .convloop
  341. LDRB     R1,[R0]
  342. CMP      R1,#3
  343. Q    R1,#0
  344. CMP      R1,#208
  345. Q    R1,#3
  346. STRB     R1,[R0],#1
  347. ADD      R4,R4,#1
  348. CMP      R4,R2
  349. BNE      convloop
  350. MOV      R4,#0
  351. SUB      R0,R0,R2
  352. SUB      R0,R0,#320
  353. SUBS     R3,R3,#1
  354. BNE      convloop
  355. LDMFD    (sp)!,{R0-R6}
  356. .getsp
  357. [ STMFD    (sp)!,{R0-R12,link}
  358. setempty
  359. BIC      R0,R0,#15
  360. STR      R0,xc
  361. STR      R1,yc
  362. MOV      wd,R2
  363. S     R2,wd,#3
  364. RSB      R2,R2,#4
  365. ADDNE    wd,wd,R2
  366. MOV      ht,R3
  367. STR      R4,sprn
  368. STR      wd,sw
  369. STR      ht,sh
  370. BL       calc
  371. SUB      scr,scr,#4
  372. STR      scr,offset
  373. LDR      R0,sprn
  374. ldr    (14,sprites)
  375. ADD      dp,R14,R0,ASL #2
  376. LDR      R0,[dp]
  377. CMP      R0,#0
  378. BNE      known
  379. .unknown
  380. MOV      R0,wd
  381. MOV      R1,ht
  382. LDR      R2,eos
  383. STR      R2,[dp]
  384. MUL      R0,R1,R0
  385. TST      R5,#1<<8
  386. MOVNE    R0,R0,ASL #1
  387. ADD      R1,R0,R2
  388. ADD      R1,R1,#4
  389. STR      R1,eos
  390. .known
  391. ldr    (0,sprites)
  392. LDR      dp,[dp]
  393. ADD      dp,dp,R0
  394. STRB     wd,[dp]
  395. STRB     ht,[dp,#1]
  396. STRB     R5,[dp,#2]
  397. STRB     R6,[dp,#3]
  398. LDR      R0,yc
  399. ldr    (1,clipy2)
  400. CMP      R0,R1
  401. BGE      skipget
  402. ldr    (1,clipy)
  403. CMP      R0,R1
  404. RSBLT    R0,R0,R1
  405. MOV      R0,R0,LSR #2
  406. ADD      R1,R0,ht
  407. MLALT    dp,R0,wd,dp
  408. 8SUBLT    scr,scr,R0,ASL #5+xres% 
  409. 640+bitspercol% 
  410. 8SUBLT    scr,scr,R0,ASL #7+xres% 
  411. 640+bitspercol% 
  412. SUBLT    ht,ht,R0
  413. CMP      ht,#0
  414. BLE      skipget
  415. ldr    (2,clipy2)
  416. CMP      R1,R2,LSR #2
  417. RSBGE    ht,R0,R2,LSR #2
  418. STR      scr,offset
  419. LDR      R0,xc
  420. ldr    (2,clipx2)
  421. CMP      R0,R2
  422. BGE      skipget
  423. ldr    (1,clipx)
  424. CMP      R0,R1
  425. ADDLT    R0,R0,#1280*64
  426. 'MOV      R0,R0,LSR #2 
  427. (xres% 
  428. :CMP      R0,R2,LSR #2 
  429.  (xres% 
  430. 320)+(4 
  431.  bitspercol%)
  432. BGT      negget
  433. ADD      R1,R0,wd
  434. CMP      R1,R2
  435. RSBGE    index,R0,R2
  436. MOVLT    index,wd
  437. STR      index,si
  438. TST      R5,#1<<8
  439. BNE      getmasked
  440. B        r_data
  441. .negget
  442. <SUB      R0,R0,#1280*64 
  443. (2*8 
  444. bitspercol%*(640 
  445. xres%))
  446. ADD      index,wd,R0
  447. ldr    (2,clipx)
  448. :MOV      R2,R2,LSR #2 
  449.  (xres% 
  450. 320)+(4 
  451.  bitspercol%)
  452. CMP      index,R2
  453. BLE      skipget
  454. SUB      R1,R2,R0
  455. ADD      scr,scr,R1
  456. ADD      dp,dp,R1
  457. SUB      index,wd,R1
  458. STR      index,si
  459. TST      R5,#1<<8
  460. BNE      getmasked
  461. .r_data
  462. LDR      R0,[scr,index]
  463. STR      R0,[dp,index]
  464. SUBS     index,index,#4
  465. BNE      r_data
  466. SUBS     ht,ht,#1
  467. BEQ      skipget
  468. LDR      R0,offset
  469. SUB      R1,R0,scr
  470. 2SUB      scr,R0,#bitspercol% 
  471. 4*xres% 
  472. 320*160
  473. STR      scr,offset
  474. SUB      scr,scr,R1
  475. LDR      index,si
  476. ADD      dp,dp,wd
  477. B        r_data
  478. .getmasked
  479. LDRB     R0,sw
  480. LDRB     R1,sh
  481. MLA      mask,R0,R1,dp
  482. .r_mask
  483. LDR      R0,[scr,index]
  484. STR      R0,[dp,index]
  485. STR      R1,[mask,index]
  486. SUBS     index,index,#4
  487. BNE      r_mask
  488. SUBS     ht,ht,#1
  489. BEQ      skipget
  490. LDR      R0,offset
  491. SUB      R1,R0,scr
  492. 2SUB      scr,R0,#bitspercol% 
  493. 4*xres% 
  494. 320*160
  495. STR      scr,offset
  496. SUB      scr,scr,R1
  497. LDR      index,si
  498. ADD      dp,dp,wd
  499. ADD      mask,mask,wd
  500. B        r_mask
  501. .skipget
  502. LDMFD    (sp)!,{R0-R12,PC}^
  503.     .calc
  504. STMFD    (sp)!,{R0-R1,link}
  505. MOV      R1,R1,LSR #2
  506. RSB      R1,R1,#255
  507. LDR      scr,to
  508. 8ADD      scr,scr,R1,ASL #5+xres% 
  509. 640+bitspercol% 
  510. 8ADD      scr,scr,R1,ASL #7+xres% 
  511. 640+bitspercol% 
  512.       R1,R0,#8*640 
  513. xres%*8 
  514. bitspercol%-1
  515. SUB      R0,R0,R1
  516. :ADD      scr,scr,R0,ASR #640/xres%+(bitspercol% 
  517. MOV      R0,scr
  518. LDMFD    (sp)!,{R0-R1,PC}^
  519.     .sprn
  520. EQUD 0
  521. EQUD 0
  522. EQUD 0
  523. EQUD 0
  524. .offset
  525. EQUD 0
  526. EQUD 0
  527. EQUD 0
  528. EQUD 0
  529.     .corx
  530. EQUD 0
  531.     .cory
  532. EQUD 0
  533.     .xoff
  534. EQUD 0
  535.     .yoff
  536. EQUD 0
  537. EQUD 0
  538.     .from
  539. EQUD 0
  540. EQUD 0
  541. .clipx
  542. EQUD 0
  543. .clipx2
  544. EQUD 1280
  545. .clipy
  546. EQUD 0
  547. .clipy2
  548. EQUD 1024
  549. .sprites
  550. EQUD 0
  551. .filemax
  552. EQUD 0
  553. .maskf
  554. EQUB 0
  555.     ALIGN
  556. .worksp
  557. res(5)
  558.     .file
  559. res(sp%)
  560. sp%=sp%<<2
  561.  opt%=0 
  562.  P%+=sp%:=0
  563. [OPT 
  564. #%EQUS 
  565. sp%+(sp%-255)*(sp%>255),
  566. sp%-=255
  567.  sp%<=0
  568. resb(sp%)
  569.  opt%=0 
  570.  P%+=sp%:=0
  571. [OPT 
  572. ,%EQUS 
  573. sp%+(sp%-255)*(sp%>255),
  574. sp%-=255
  575.  sp%<=0
  576.  bitspercol%=4 
  577. [OPT 
  578. MOV      R0,R0,LSR #1
  579. [OPT 
  580. MOV      R1,#0
  581. mask%=2^bitspercol%-1
  582.  l%=0 
  583.  bitspercol%
  584. [OPT 
  585. TST      R0,#mask%<<l%
  586. ADDEQ    R1,R1,#mask%<<l%
  587. ldr(reg,adr)
  588. [OPT 
  589. E$LDR      reg,[empty,#adr-worksp]
  590. str(reg,adr)
  591. [OPT 
  592. J$STR      reg,[empty,#adr-worksp]
  593. ldrb(reg,adr)
  594. [OPT 
  595. O$LDRB     reg,[empty,#adr-worksp]
  596. strb(reg,adr)
  597. [OPT 
  598. T$STRB     reg,[empty,#adr-worksp]
  599. setempty
  600. num=worksp-(P%+8)
  601.  num>&FFFF 
  602.  (opt% 
  603.  2,"Bad tileaddress offset"
  604. [OPT 
  605. [ ADD      empty,PC,#num 
  606. \%ADD      empty,empty,#num 
  607.  &FF00
  608. adr(reg,adr):
  609. num=adr-worksp
  610.  (opt% 
  611. (num)>&FFFF 
  612.  2,"Bad tileaddress offset"
  613.  num>=0 
  614. [OPT 
  615. ADD reg,empty,#num 
  616. ADD reg,reg,#num 
  617. &FF00
  618.  num=-num
  619. [OPT 
  620. SUB reg,empty,#num 
  621. SUB reg,reg,#num 
  622. &FF00
  623. =(opt%>>1)<<1
  624. mov(reg,num%)
  625. A%=num%
  626.  first%,pos%
  627. first%=
  628.  num%>=0 
  629. pos%=-2
  630.  pos%+=2
  631.  pos%>31 
  632.  (num% 
  633.  3<<pos%)<>0
  634.  pos%<32 
  635.  first% 
  636.  first% 
  637. [OPT opt% 
  638. ~"MOV      reg,#num% 
  639.  &FF<<pos%
  640. first%=
  641. [OPT opt% 
  642. &ADD      reg,reg,#num% 
  643.  &FF<<pos%
  644. pos%+=6
  645.  pos%>31
  646. num%=-(num%+1):pos%=-2
  647.  pos%+=2
  648.  pos%>31 
  649.  (num% 
  650.  3<<pos%)<>0
  651.  pos%<32 
  652.  first% 
  653.  first% 
  654. [OPT opt% 
  655. "MVN      reg,#num% 
  656.  &FF<<pos%
  657. first%=
  658. [OPT opt% 
  659. &SUB      reg,reg,#num% 
  660.  &FF<<pos%
  661. pos%+=6
  662.  pos%>31
  663. sc(c$)
  664. 4c%=(
  665. "EQNECSCCMIPLVSVCHILSGELTGTLEALNV",c$)-1)/2
  666. %P%!-4=(P%!-4 
  667. (&F<<28)) 
  668.  c%<<28
  669.  bitspercol%=4 
  670. [OPT 
  671. MOV      R0,R0,LSR #1
  672. [OPT 
  673. MOV      R1,#0
  674. mask%=2^bitspercol%-1
  675.  l%=0 
  676.  bitspercol%
  677. [OPT 
  678. TST      R0,#mask%<<l%
  679. ADDEQ    R1,R1,#mask%<<l%
  680.