]> git.cryptolib.org Git - arm-crypto-lib.git/blob - bmw/bmw_small-tinyasm.ps
updated bmw standard implementation
[arm-crypto-lib.git] / bmw / bmw_small-tinyasm.ps
1 %!PS-Adobe-3.0
2 %%BoundingBox: 18 36 577 806
3 %%Title: Enscript Output
4 %%Creator: GNU enscript 1.6.4
5 %%CreationDate: Tue Apr  6 12:07:47 2010
6 %%Orientation: Landscape
7 %%Pages: (atend)
8 %%DocumentMedia: A4 595 842 0 () ()
9 %%DocumentNeededResources: (atend)
10 %%EndComments
11 %%BeginProlog
12 %%BeginResource: procset Enscript-Prolog 1.6 4
13 %
14 % Procedures.
15 %
16
17 /_S {   % save current state
18   /_s save def
19 } def
20 /_R {   % restore from saved state
21   _s restore
22 } def
23
24 /S {    % showpage protecting gstate
25   gsave
26   showpage
27   grestore
28 } bind def
29
30 /MF {   % fontname newfontname -> -     make a new encoded font
31   /newfontname exch def
32   /fontname exch def
33
34   /fontdict fontname findfont def
35   /newfont fontdict maxlength dict def
36
37   fontdict {
38     exch
39     dup /FID eq {
40       % skip FID pair
41       pop pop
42     } {
43       % copy to the new font dictionary
44       exch newfont 3 1 roll put
45     } ifelse
46   } forall
47
48   newfont /FontName newfontname put
49
50   % insert only valid encoding vectors
51   encoding_vector length 256 eq {
52     newfont /Encoding encoding_vector put
53   } if
54
55   newfontname newfont definefont pop
56 } def
57
58 /MF_PS { % fontname newfontname -> -    make a new font preserving its enc
59   /newfontname exch def
60   /fontname exch def
61
62   /fontdict fontname findfont def
63   /newfont fontdict maxlength dict def
64
65   fontdict {
66     exch
67     dup /FID eq {
68       % skip FID pair
69       pop pop
70     } {
71       % copy to the new font dictionary
72       exch newfont 3 1 roll put
73     } ifelse
74   } forall
75
76   newfont /FontName newfontname put
77
78   newfontname newfont definefont pop
79 } def
80
81 /SF { % fontname width height -> -      set a new font
82   /height exch def
83   /width exch def
84
85   findfont
86   [width 0 0 height 0 0] makefont setfont
87 } def
88
89 /SUF { % fontname width height -> -     set a new user font
90   /height exch def
91   /width exch def
92
93   /F-gs-user-font MF
94   /F-gs-user-font width height SF
95 } def
96
97 /SUF_PS { % fontname width height -> -  set a new user font preserving its enc
98   /height exch def
99   /width exch def
100
101   /F-gs-user-font MF_PS
102   /F-gs-user-font width height SF
103 } def
104
105 /M {moveto} bind def
106 /s {show} bind def
107
108 /Box {  % x y w h -> -                  define box path
109   /d_h exch def /d_w exch def /d_y exch def /d_x exch def
110   d_x d_y  moveto
111   d_w 0 rlineto
112   0 d_h rlineto
113   d_w neg 0 rlineto
114   closepath
115 } def
116
117 /bgs {  % x y height blskip gray str -> -       show string with bg color
118   /str exch def
119   /gray exch def
120   /blskip exch def
121   /height exch def
122   /y exch def
123   /x exch def
124
125   gsave
126     x y blskip sub str stringwidth pop height Box
127     gray setgray
128     fill
129   grestore
130   x y M str s
131 } def
132
133 /bgcs { % x y height blskip red green blue str -> -  show string with bg color
134   /str exch def
135   /blue exch def
136   /green exch def
137   /red exch def
138   /blskip exch def
139   /height exch def
140   /y exch def
141   /x exch def
142
143   gsave
144     x y blskip sub str stringwidth pop height Box
145     red green blue setrgbcolor
146     fill
147   grestore
148   x y M str s
149 } def
150
151 % Highlight bars.
152 /highlight_bars {       % nlines lineheight output_y_margin gray -> -
153   gsave
154     setgray
155     /ymarg exch def
156     /lineheight exch def
157     /nlines exch def
158
159     % This 2 is just a magic number to sync highlight lines to text.
160     0 d_header_y ymarg sub 2 sub translate
161
162     /cw d_output_w cols div def
163     /nrows d_output_h ymarg 2 mul sub lineheight div cvi def
164
165     % for each column
166     0 1 cols 1 sub {
167       cw mul /xp exch def
168
169       % for each rows
170       0 1 nrows 1 sub {
171         /rn exch def
172         rn lineheight mul neg /yp exch def
173         rn nlines idiv 2 mod 0 eq {
174           % Draw highlight bar.  4 is just a magic indentation.
175           xp 4 add yp cw 8 sub lineheight neg Box fill
176         } if
177       } for
178     } for
179
180   grestore
181 } def
182
183 % Line highlight bar.
184 /line_highlight {       % x y width height gray -> -
185   gsave
186     /gray exch def
187     Box gray setgray fill
188   grestore
189 } def
190
191 % Column separator lines.
192 /column_lines {
193   gsave
194     .1 setlinewidth
195     0 d_footer_h translate
196     /cw d_output_w cols div def
197     1 1 cols 1 sub {
198       cw mul 0 moveto
199       0 d_output_h rlineto stroke
200     } for
201   grestore
202 } def
203
204 % Column borders.
205 /column_borders {
206   gsave
207     .1 setlinewidth
208     0 d_footer_h moveto
209     0 d_output_h rlineto
210     d_output_w 0 rlineto
211     0 d_output_h neg rlineto
212     closepath stroke
213   grestore
214 } def
215
216 % Do the actual underlay drawing
217 /draw_underlay {
218   ul_style 0 eq {
219     ul_str true charpath stroke
220   } {
221     ul_str show
222   } ifelse
223 } def
224
225 % Underlay
226 /underlay {     % - -> -
227   gsave
228     0 d_page_h translate
229     d_page_h neg d_page_w atan rotate
230
231     ul_gray setgray
232     ul_font setfont
233     /dw d_page_h dup mul d_page_w dup mul add sqrt def
234     ul_str stringwidth pop dw exch sub 2 div ul_h_ptsize -2 div moveto
235     draw_underlay
236   grestore
237 } def
238
239 /user_underlay {        % - -> -
240   gsave
241     ul_x ul_y translate
242     ul_angle rotate
243     ul_gray setgray
244     ul_font setfont
245     0 0 ul_h_ptsize 2 div sub moveto
246     draw_underlay
247   grestore
248 } def
249
250 % Page prefeed
251 /page_prefeed {         % bool -> -
252   statusdict /prefeed known {
253     statusdict exch /prefeed exch put
254   } {
255     pop
256   } ifelse
257 } def
258
259 % Wrapped line markers
260 /wrapped_line_mark {    % x y charwith charheight type -> -
261   /type exch def
262   /h exch def
263   /w exch def
264   /y exch def
265   /x exch def
266
267   type 2 eq {
268     % Black boxes (like TeX does)
269     gsave
270       0 setlinewidth
271       x w 4 div add y M
272       0 h rlineto w 2 div 0 rlineto 0 h neg rlineto
273       closepath fill
274     grestore
275   } {
276     type 3 eq {
277       % Small arrows
278       gsave
279         .2 setlinewidth
280         x w 2 div add y h 2 div add M
281         w 4 div 0 rlineto
282         x w 4 div add y lineto stroke
283
284         x w 4 div add w 8 div add y h 4 div add M
285         x w 4 div add y lineto
286         w 4 div h 8 div rlineto stroke
287       grestore
288     } {
289       % do nothing
290     } ifelse
291   } ifelse
292 } def
293
294 % EPSF import.
295
296 /BeginEPSF {
297   /b4_Inc_state save def                % Save state for cleanup
298   /dict_count countdictstack def        % Count objects on dict stack
299   /op_count count 1 sub def             % Count objects on operand stack
300   userdict begin
301   /showpage { } def
302   0 setgray 0 setlinecap
303   1 setlinewidth 0 setlinejoin
304   10 setmiterlimit [ ] 0 setdash newpath
305   /languagelevel where {
306     pop languagelevel
307     1 ne {
308       false setstrokeadjust false setoverprint
309     } if
310   } if
311 } bind def
312
313 /EndEPSF {
314   count op_count sub { pos } repeat     % Clean up stacks
315   countdictstack dict_count sub { end } repeat
316   b4_Inc_state restore
317 } bind def
318
319 % Check PostScript language level.
320 /languagelevel where {
321   pop /gs_languagelevel languagelevel def
322 } {
323   /gs_languagelevel 1 def
324 } ifelse
325 %%EndResource
326 %%BeginResource: procset Enscript-Encoding-88591 1.6 4
327 /encoding_vector [
328 /.notdef        /.notdef        /.notdef        /.notdef        
329 /.notdef        /.notdef        /.notdef        /.notdef        
330 /.notdef        /.notdef        /.notdef        /.notdef        
331 /.notdef        /.notdef        /.notdef        /.notdef        
332 /.notdef        /.notdef        /.notdef        /.notdef        
333 /.notdef        /.notdef        /.notdef        /.notdef        
334 /.notdef        /.notdef        /.notdef        /.notdef        
335 /.notdef        /.notdef        /.notdef        /.notdef        
336 /space          /exclam         /quotedbl       /numbersign     
337 /dollar         /percent        /ampersand      /quoteright     
338 /parenleft      /parenright     /asterisk       /plus           
339 /comma          /hyphen         /period         /slash          
340 /zero           /one            /two            /three          
341 /four           /five           /six            /seven          
342 /eight          /nine           /colon          /semicolon      
343 /less           /equal          /greater        /question       
344 /at             /A              /B              /C              
345 /D              /E              /F              /G              
346 /H              /I              /J              /K              
347 /L              /M              /N              /O              
348 /P              /Q              /R              /S              
349 /T              /U              /V              /W              
350 /X              /Y              /Z              /bracketleft    
351 /backslash      /bracketright   /asciicircum    /underscore     
352 /quoteleft      /a              /b              /c              
353 /d              /e              /f              /g              
354 /h              /i              /j              /k              
355 /l              /m              /n              /o              
356 /p              /q              /r              /s              
357 /t              /u              /v              /w              
358 /x              /y              /z              /braceleft      
359 /bar            /braceright     /tilde          /.notdef        
360 /.notdef        /.notdef        /.notdef        /.notdef        
361 /.notdef        /.notdef        /.notdef        /.notdef        
362 /.notdef        /.notdef        /.notdef        /.notdef        
363 /.notdef        /.notdef        /.notdef        /.notdef        
364 /.notdef        /.notdef        /.notdef        /.notdef        
365 /.notdef        /.notdef        /.notdef        /.notdef        
366 /.notdef        /.notdef        /.notdef        /.notdef        
367 /.notdef        /.notdef        /.notdef        /.notdef        
368 /space          /exclamdown     /cent           /sterling       
369 /currency       /yen            /brokenbar      /section        
370 /dieresis       /copyright      /ordfeminine    /guillemotleft  
371 /logicalnot     /hyphen         /registered     /macron         
372 /degree         /plusminus      /twosuperior    /threesuperior  
373 /acute          /mu             /paragraph      /bullet         
374 /cedilla        /onesuperior    /ordmasculine   /guillemotright 
375 /onequarter     /onehalf        /threequarters  /questiondown   
376 /Agrave         /Aacute         /Acircumflex    /Atilde         
377 /Adieresis      /Aring          /AE             /Ccedilla       
378 /Egrave         /Eacute         /Ecircumflex    /Edieresis      
379 /Igrave         /Iacute         /Icircumflex    /Idieresis      
380 /Eth            /Ntilde         /Ograve         /Oacute         
381 /Ocircumflex    /Otilde         /Odieresis      /multiply       
382 /Oslash         /Ugrave         /Uacute         /Ucircumflex    
383 /Udieresis      /Yacute         /Thorn          /germandbls     
384 /agrave         /aacute         /acircumflex    /atilde         
385 /adieresis      /aring          /ae             /ccedilla       
386 /egrave         /eacute         /ecircumflex    /edieresis      
387 /igrave         /iacute         /icircumflex    /idieresis      
388 /eth            /ntilde         /ograve         /oacute         
389 /ocircumflex    /otilde         /odieresis      /divide         
390 /oslash         /ugrave         /uacute         /ucircumflex    
391 /udieresis      /yacute         /thorn          /ydieresis      
392 ] def
393 %%EndResource
394 %%EndProlog
395 %%BeginSetup
396 %%IncludeResource: font Courier-Bold
397 %%IncludeResource: font Courier
398 /HFpt_w 10 def
399 /HFpt_h 10 def
400 /Courier-Bold /HF-gs-font MF
401 /HF /HF-gs-font findfont [HFpt_w 0 0 HFpt_h 0 0] makefont def
402 /Courier /F-gs-font MF
403 /F-gs-font 7 7 SF
404 /#copies 1 def
405 % Pagedevice definitions:
406 gs_languagelevel 1 gt {
407   <<
408     /PageSize [595 842] 
409   >> setpagedevice
410 } if
411 %%BeginResource: procset Enscript-Header-simple 1.6 4
412
413 /do_header {    % print default simple header
414   gsave
415     d_header_x d_header_y HFpt_h 3 div add translate
416
417     HF setfont
418     user_header_p {
419       5 0 moveto user_header_left_str show
420
421       d_header_w user_header_center_str stringwidth pop sub 2 div
422       0 moveto user_header_center_str show
423
424       d_header_w user_header_right_str stringwidth pop sub 5 sub
425       0 moveto user_header_right_str show
426     } {
427       5 0 moveto fname show
428       45 0 rmoveto fmodstr show
429       45 0 rmoveto pagenumstr show
430     } ifelse
431
432   grestore
433 } def
434 %%EndResource
435 /d_page_w 770 def
436 /d_page_h 559 def
437 /d_header_x 0 def
438 /d_header_y 544 def
439 /d_header_w 770 def
440 /d_header_h 15 def
441 /d_footer_x 0 def
442 /d_footer_y 0 def
443 /d_footer_w 770 def
444 /d_footer_h 0 def
445 /d_output_w 770 def
446 /d_output_h 544 def
447 /cols 3 def
448 %%EndSetup
449 %%Page: (1) 1
450 %%BeginPageSetup
451 _S
452 90 rotate
453 36 -577 translate
454 /pagenum 1 def
455 /fname (bmw_small-tinyasm.S) def
456 /fdir () def
457 /ftail (bmw_small-tinyasm.S) def
458 % User defined strings:
459 /fmodstr (Mo Apr 05 09:57:29 2010) def
460 /pagenumstr (1) def
461 /user_header_p false def
462 /user_footer_p false def
463 %%EndPageSetup
464 column_lines
465 column_borders
466 do_header
467 5 534 M
468 (/* bmw_small-tinyasm.S */) s
469 5 526 M
470 (/*) s
471 5 518 M
472 (    This file is part of the AVR-Crypto-Lib.) s
473 5 510 M
474 (    Copyright \(C\) 2009  Daniel Otte \(daniel.otte@rub.de\)) s
475 5 494 M
476 (    This program is free software: you can redistribute it) s
477 5 486 M
478 ( and/or modify) s
479 5 478 M
480 (    it under the terms of the GNU General Public License a) s
481 5 470 M
482 (s published by) s
483 5 462 M
484 (    the Free Software Foundation, either version 3 of the ) s
485 5 454 M
486 (License, or) s
487 5 446 M
488 (    \(at your option\) any later version.) s
489 5 430 M
490 (    This program is distributed in the hope that it will b) s
491 5 422 M
492 (e useful,) s
493 5 414 M
494 (    but WITHOUT ANY WARRANTY; without even the implied war) s
495 5 406 M
496 (ranty of) s
497 5 398 M
498 (    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  ) s
499 5 390 M
500 (See the) s
501 5 382 M
502 (    GNU General Public License for more details.) s
503 5 366 M
504 (    You should have received a copy of the GNU General Pub) s
505 5 358 M
506 (lic License) s
507 5 350 M
508 (    along with this program.  If not, see <http://www.gnu.) s
509 5 342 M
510 (org/licenses/>.) s
511 5 334 M
512 (*/) s
513 5 318 M
514 (/*) s
515 5 310 M
516 ( * File:        bmw_small-tinyasm.S) s
517 5 302 M
518 ( * Author:      Daniel Otte) s
519 5 294 M
520 ( * Date:        2010-03-28) s
521 5 286 M
522 ( * License:     GPLv3 or later) s
523 5 278 M
524 ( * Description: implementation of BlueMidnightWish) s
525 5 270 M
526 ( *) s
527 5 262 M
528 ( */) s
529 5 246 M
530 (#include "avr-asm-macros.S") s
531 5 230 M
532 (/*********************************************************) s
533 5 222 M
534 (*********************/) s
535 5 214 M
536 (/*) s
537 5 206 M
538 (  param a: r22:r23:r24:r25) s
539 5 198 M
540 (  param s: r20) s
541 5 190 M
542 (*/) s
543 5 182 M
544 (shiftleft32:) s
545 5 174 M
546 (        clr r0) s
547 5 166 M
548 (        cpi r20, 8) s
549 5 158 M
550 (        brlo bitrotateleft_1) s
551 5 150 M
552 (        mov r25, r24) s
553 5 142 M
554 (        mov r24, r23) s
555 5 134 M
556 (        mov r23, r22) s
557 5 126 M
558 (        clr r22) s
559 5 118 M
560 (        subi r20, 8) s
561 5 110 M
562 (        rjmp shiftleft32) s
563 5 94 M
564 (/*********************************************************) s
565 5 86 M
566 (*********************/) s
567 5 78 M
568 (/*) s
569 5 70 M
570 (  param a: r22:r23:r24:r25) s
571 5 62 M
572 (  param s: r20) s
573 5 54 M
574 (*/) s
575 5 46 M
576 (shiftright32:) s
577 5 38 M
578 (        cpi r20, 8) s
579 5 30 M
580 (        brlo bitshiftright) s
581 5 22 M
582 (        mov r22, r23) s
583 5 14 M
584 (        mov r23, r24) s
585 5 6 M
586 (        mov r24, r25) s
587 261.667 534 M
588 (        clr r25) s
589 261.667 526 M
590 (        subi r20, 8) s
591 261.667 518 M
592 (        rjmp shiftright32) s
593 261.667 510 M
594 (bitshiftright:) s
595 261.667 502 M
596 (        tst r20) s
597 261.667 494 M
598 (        breq 20f) s
599 261.667 486 M
600 (10:     lsr r25) s
601 261.667 478 M
602 (        ror r24) s
603 261.667 470 M
604 (        ror r23) s
605 261.667 462 M
606 (        ror r22) s
607 261.667 454 M
608 (        dec r20) s
609 261.667 446 M
610 (        brne 10b) s
611 261.667 438 M
612 (20: ret) s
613 261.667 422 M
614 (/*********************************************************) s
615 261.667 414 M
616 (*********************/) s
617 261.667 406 M
618 (/*) s
619 261.667 398 M
620 (  param a: r22:r23:r24:r25) s
621 261.667 390 M
622 (  param s: r20) s
623 261.667 382 M
624 (*/) s
625 261.667 374 M
626 (rotateleft32:) s
627 261.667 366 M
628 (        cpi r20, 8) s
629 261.667 358 M
630 (        brlo bitrotateleft) s
631 261.667 350 M
632 (        mov r0, r25) s
633 261.667 342 M
634 (        mov r25, r24) s
635 261.667 334 M
636 (        mov r24, r23) s
637 261.667 326 M
638 (        mov r23, r22) s
639 261.667 318 M
640 (        mov r22, r0) s
641 261.667 310 M
642 (        subi r20, 8) s
643 261.667 302 M
644 (        rjmp rotateleft32) s
645 261.667 294 M
646 (bitrotateleft:) s
647 261.667 286 M
648 (    mov r0, r25) s
649 261.667 278 M
650 (bitrotateleft_1:) s
651 261.667 270 M
652 (        tst r20) s
653 261.667 262 M
654 (        breq 20f) s
655 261.667 254 M
656 (10:) s
657 261.667 246 M
658 (        lsl r0) s
659 261.667 238 M
660 (        rol r22) s
661 261.667 230 M
662 (        rol r23) s
663 261.667 222 M
664 (        rol r24) s
665 261.667 214 M
666 (        rol r25) s
667 261.667 206 M
668 (        dec r20) s
669 261.667 198 M
670 (        brne 10b) s
671 261.667 190 M
672 (20: ret) s
673 261.667 166 M
674 (/*********************************************************) s
675 261.667 158 M
676 (*********************/) s
677 261.667 142 M
678 (s_table:) s
679 261.667 134 M
680 (s0:  .byte 1, 3, 4,19) s
681 261.667 126 M
682 (s1:  .byte 1, 2, 8,23) s
683 261.667 118 M
684 (s2:  .byte 2, 1,12,25) s
685 261.667 110 M
686 (s3:  .byte 2, 2,15,29) s
687 261.667 102 M
688 (s4:  .byte 1, 0, 0, 0) s
689 261.667 94 M
690 (s5:  .byte 2, 0, 0, 0) s
691 261.667 78 M
692 (eor_r22_in_r16:) s
693 261.667 70 M
694 (        eor r16, r22) s
695 261.667 62 M
696 (        eor r17, r23) s
697 261.667 54 M
698 (        eor r18, r24) s
699 261.667 46 M
700 (        eor r19, r25) s
701 261.667 38 M
702 (        ret) s
703 261.667 22 M
704 (/*) s
705 261.667 14 M
706 (  param x: r22:r23:r24:25) s
707 261.667 6 M
708 (  param s: r20) s
709 518.333 534 M
710 (*/) s
711 518.333 526 M
712 (sn:) s
713 518.333 518 M
714 (        push_range 2, 5) s
715 518.333 510 M
716 (        push r17) s
717 518.333 502 M
718 (        push r19) s
719 518.333 494 M
720 (        ldi r30, lo8\(s_table\)) s
721 518.333 486 M
722 (        ldi r31, hi8\(s_table\)) s
723 518.333 478 M
724 (        lsl r20) s
725 518.333 470 M
726 (        lsl r20) s
727 518.333 462 M
728 (        add r30, r20) s
729 518.333 454 M
730 (        adc r31, r1) s
731 518.333 446 M
732 (        movw r2, r22) s
733 518.333 438 M
734 (        movw r4, r24) s
735 518.333 430 M
736 (        lpm r20, Z+) s
737 518.333 422 M
738 (        rcall shiftright32) s
739 518.333 414 M
740 (        movw r16, r22) s
741 518.333 406 M
742 (        movw r18, r24) s
743 518.333 398 M
744 (;---) s
745 518.333 390 M
746 (        movw r22, r2) s
747 518.333 382 M
748 (        movw r24, r4) s
749 518.333 374 M
750 (        lpm r20, Z+) s
751 518.333 366 M
752 (        rcall shiftleft32) s
753 518.333 358 M
754 (        rcall eor_r22_in_r16) s
755 518.333 350 M
756 (;---) s
757 518.333 342 M
758 (        movw r22, r2) s
759 518.333 334 M
760 (        movw r24, r4) s
761 518.333 326 M
762 (        lpm r20, Z+) s
763 518.333 318 M
764 (        rcall rotateleft32) s
765 518.333 310 M
766 (        rcall eor_r22_in_r16) s
767 518.333 302 M
768 (;---) s
769 518.333 294 M
770 (        movw r22, r2) s
771 518.333 286 M
772 (        movw r24, r4) s
773 518.333 278 M
774 (        lpm r20, Z+) s
775 518.333 270 M
776 (        rcall rotateleft32) s
777 518.333 262 M
778 (        eor r22, r16) s
779 518.333 254 M
780 (        eor r23, r17) s
781 518.333 246 M
782 (        eor r24, r18) s
783 518.333 238 M
784 (        eor r25, r19) s
785 518.333 230 M
786 (        pop r19) s
787 518.333 222 M
788 (        pop r17) s
789 518.333 214 M
790 (        pop_range 2, 5) s
791 518.333 206 M
792 (        ret) s
793 518.333 190 M
794 (/*********************************************************) s
795 518.333 182 M
796 (*********************/) s
797 518.333 174 M
798 (/*) s
799 518.333 166 M
800 (  param dest: r26:r27 \(X\)) s
801 518.333 158 M
802 (  param src:  r30:r31 \(Z\)) s
803 518.333 150 M
804 (  param len:  r20) s
805 518.333 142 M
806 (*/) s
807 518.333 134 M
808 (memxor_short:) s
809 518.333 126 M
810 (;       tst r20) s
811 518.333 118 M
812 (;       breq memxor_exit) s
813 518.333 110 M
814 (10: ld r21, X) s
815 518.333 102 M
816 (        ld r22, Z+) s
817 518.333 94 M
818 (        eor r21, r22) s
819 518.333 86 M
820 (        st X+, r21) s
821 518.333 78 M
822 (        dec r20) s
823 518.333 70 M
824 (        brne 10b) s
825 518.333 62 M
826 (memxor_exit:) s
827 518.333 54 M
828 (        ret) s
829 518.333 38 M
830 (/*********************************************************) s
831 518.333 30 M
832 (*********************/) s
833 518.333 22 M
834 (q0 = 2) s
835 518.333 14 M
836 (q1 = 3) s
837 518.333 6 M
838 (h0 = 4) s
839 _R
840 S
841 %%Page: (2) 2
842 %%BeginPageSetup
843 _S
844 90 rotate
845 36 -577 translate
846 /pagenum 2 def
847 /fname (bmw_small-tinyasm.S) def
848 /fdir () def
849 /ftail (bmw_small-tinyasm.S) def
850 % User defined strings:
851 /fmodstr (Mo Apr 05 09:57:29 2010) def
852 /pagenumstr (2) def
853 /user_header_p false def
854 /user_footer_p false def
855 %%EndPageSetup
856 column_lines
857 column_borders
858 do_header
859 5 534 M
860 (h1 = 5) s
861 5 526 M
862 (m0 = 6) s
863 5 518 M
864 (m1 = 7) s
865 5 502 M
866 (add_hx_to_w:) s
867 5 494 M
868 (        movw r26, h0) s
869 5 486 M
870 (        add r26, r16) s
871 5 478 M
872 (        adc r27, r1) s
873 5 470 M
874 (        ld r22, Y) s
875 5 462 M
876 (        ldd r23, Y+1) s
877 5 454 M
878 (        ldd r24, Y+2) s
879 5 446 M
880 (        ldd r25, Y+3) s
881 5 438 M
882 (        lsl r20) s
883 5 430 M
884 (        rol r21) s
885 5 422 M
886 (        brcs 30f) s
887 5 414 M
888 (        /* addition */) s
889 5 406 M
890 (        ld r0, X+) s
891 5 398 M
892 (        add r22, r0) s
893 5 390 M
894 (        ld r0, X+) s
895 5 382 M
896 (        adc r23, r0) s
897 5 374 M
898 (        ld r0, X+) s
899 5 366 M
900 (        adc r24, r0) s
901 5 358 M
902 (        ld r0, X+) s
903 5 350 M
904 (        adc r25, r0) s
905 5 342 M
906 (        rjmp 50f) s
907 5 334 M
908 (30: /* substract */) s
909 5 326 M
910 (        ld r0, X+) s
911 5 318 M
912 (        sub r22, r0) s
913 5 310 M
914 (        ld r0, X+) s
915 5 302 M
916 (        sbc r23, r0) s
917 5 294 M
918 (        ld r0, X+) s
919 5 286 M
920 (        sbc r24, r0) s
921 5 278 M
922 (        ld r0, X+) s
923 5 270 M
924 (        sbc r25, r0) s
925 5 262 M
926 (50:) s
927 5 254 M
928 (        st Y+, r22) s
929 5 246 M
930 (        st Y+, r23) s
931 5 238 M
932 (        st Y+, r24) s
933 5 230 M
934 (        st Y+, r25) s
935 5 222 M
936 (        ret) s
937 5 206 M
938 (/*********************************************************) s
939 5 198 M
940 (*********************/) s
941 5 190 M
942 (load32_from_X:) s
943 5 182 M
944 (        ld r22, X+) s
945 5 174 M
946 (        ld r23, X+) s
947 5 166 M
948 (        ld r24, X+) s
949 5 158 M
950 (        ld r25, X+) s
951 5 150 M
952 (        ret) s
953 5 134 M
954 (load32_from_Y:) s
955 5 126 M
956 (        ld r22, Y+) s
957 5 118 M
958 (        ld r23, Y+) s
959 5 110 M
960 (        ld r24, Y+) s
961 5 102 M
962 (        ld r25, Y+) s
963 5 94 M
964 (        ret) s
965 5 78 M
966 (add_X_to_32:) s
967 5 70 M
968 (        ld r0, X+) s
969 5 62 M
970 (        add r22, r0) s
971 5 54 M
972 (        ld r0, X+) s
973 5 46 M
974 (        adc r23, r0) s
975 5 38 M
976 (        ld r0, X+) s
977 5 30 M
978 (        adc r24, r0) s
979 5 22 M
980 (        ld r0, X+) s
981 5 14 M
982 (        adc r25, r0) s
983 5 6 M
984 (        ret) s
985 261.667 534 M
986 (/*********************************************************) s
987 261.667 526 M
988 (*********************/) s
989 261.667 518 M
990 (/*) s
991 261.667 510 M
992 (  param q:  r28:r29 \(Y\)) s
993 261.667 502 M
994 (  param h:  r26:r27 \(X\)) s
995 261.667 494 M
996 (  param m:  r30:r31 \(Z\)) s
997 261.667 486 M
998 (*/) s
999 261.667 470 M
1000 (f0_hacktable:) s
1001 261.667 462 M
1002 (        .byte 0x03, 0x11) s
1003 261.667 454 M
1004 (        .byte 0xDD, 0xB3) s
1005 261.667 446 M
1006 (        .byte 0x2A, 0x79) s
1007 261.667 438 M
1008 (        .byte 0x07, 0xAA) s
1009 261.667 430 M
1010 (        .byte 0x51, 0xC2) s
1011 261.667 422 M
1012 (f0_indextable:) s
1013 261.667 414 M
1014 (        .byte 5*4,7*4,10*4,13*4,14*4) s
1015 261.667 406 M
1016 (;       .byte 0 ; just for alignment) s
1017 261.667 398 M
1018 (f0_s_table:) s
1019 261.667 390 M
1020 (        .byte 0,1,2,3,4) s
1021 261.667 382 M
1022 (        .byte 0,1,2,3,4) s
1023 261.667 374 M
1024 (        .byte 0,1,2,3,4) s
1025 261.667 366 M
1026 (;       .byte 0) s
1027 261.667 350 M
1028 (f0:) s
1029 261.667 342 M
1030 (        movw h0, r26) s
1031 261.667 334 M
1032 (        movw q0, r28) s
1033 261.667 326 M
1034 (        movw m0, r30) s
1035 261.667 318 M
1036 (;--- DBG) s
1037 261.667 310 M
1038 (;       push_range 22, 25) s
1039 261.667 302 M
1040 (;       movw r24, r26) s
1041 261.667 294 M
1042 (;       ldi r22, 'H') s
1043 261.667 286 M
1044 (;       rcall printX) s
1045 261.667 278 M
1046 (;       pop_range  22, 25) s
1047 261.667 270 M
1048 (;--- END DBG) s
1049 261.667 262 M
1050 (;--- DBG) s
1051 261.667 254 M
1052 (;       push_range 22, 25) s
1053 261.667 246 M
1054 (;       movw r24, r30) s
1055 261.667 238 M
1056 (;       ldi r22, 'M') s
1057 261.667 230 M
1058 (;       rcall printX) s
1059 261.667 222 M
1060 (;       pop_range  22, 25) s
1061 261.667 214 M
1062 (;--- END DBG) s
1063 261.667 206 M
1064 (        /* xor m into h */) s
1065 261.667 198 M
1066 (        ldi r20, 64) s
1067 261.667 190 M
1068 (        rcall memxor_short) s
1069 261.667 182 M
1070 (        movw r30, m0) s
1071 261.667 174 M
1072 (        movw r26, h0) s
1073 261.667 158 M
1074 (        /* set q to zero */) s
1075 261.667 150 M
1076 (        ldi r22, 64) s
1077 261.667 142 M
1078 (10:     st Y+, r1) s
1079 261.667 134 M
1080 (        dec r22) s
1081 261.667 126 M
1082 (        brne 10b) s
1083 261.667 118 M
1084 (        movw r28, q0) s
1085 261.667 110 M
1086 (        /* calculate W and store it in Q */) s
1087 261.667 102 M
1088 (        ldi r19, 5) s
1089 261.667 94 M
1090 (30:) s
1091 261.667 86 M
1092 (        ldi r18, 16) s
1093 261.667 78 M
1094 (        /* load initial index */) s
1095 261.667 70 M
1096 (        ldi r30, lo8\(f0_indextable-1\)) s
1097 261.667 62 M
1098 (        ldi r31, hi8\(f0_indextable-1\)) s
1099 261.667 54 M
1100 (        add r30, r19) s
1101 261.667 46 M
1102 (        adc r31, r1) s
1103 261.667 38 M
1104 (        lpm r16, Z) s
1105 261.667 30 M
1106 (        /* load values from hacktable */) s
1107 261.667 22 M
1108 (        ldi r30, lo8\(f0_hacktable-2\)) s
1109 261.667 14 M
1110 (        ldi r31, hi8\(f0_hacktable-2\)) s
1111 261.667 6 M
1112 (        lsl r19) s
1113 518.333 534 M
1114 (        add r30, r19) s
1115 518.333 526 M
1116 (        adc r31, r1) s
1117 518.333 518 M
1118 (        lsr r19) s
1119 518.333 510 M
1120 (        lpm r21, Z+) s
1121 518.333 502 M
1122 (        lpm r20, Z) s
1123 518.333 494 M
1124 (40:) s
1125 518.333 486 M
1126 (        call add_hx_to_w) s
1127 518.333 478 M
1128 (        subi r16, -4) s
1129 518.333 470 M
1130 (        andi r16, 0x0f<<2) s
1131 518.333 462 M
1132 (        dec r18) s
1133 518.333 454 M
1134 (        brne 40b) s
1135 518.333 446 M
1136 (        movw r28, q0) s
1137 518.333 438 M
1138 (        dec r19) s
1139 518.333 430 M
1140 (        brne 30b) s
1141 518.333 422 M
1142 (        movw r26, h0) s
1143 518.333 414 M
1144 (;--- DBG) s
1145 518.333 406 M
1146 (;       push_range 22, 25) s
1147 518.333 398 M
1148 (;       movw r24, r28) s
1149 518.333 390 M
1150 (;       ldi r22, 'W') s
1151 518.333 382 M
1152 (;       rcall printX) s
1153 518.333 374 M
1154 (;       pop_range  22, 25) s
1155 518.333 366 M
1156 (;--- END DBG) s
1157 518.333 358 M
1158 (        /* xor m into h */) s
1159 518.333 350 M
1160 (        ldi r20, 64) s
1161 518.333 342 M
1162 (        movw r26, h0) s
1163 518.333 334 M
1164 (        movw r30, m0) s
1165 518.333 326 M
1166 (        rcall memxor_short) s
1167 518.333 318 M
1168 (        sbiw r26, 60) s
1169 518.333 310 M
1170 (;---) s
1171 518.333 302 M
1172 (        ldi r30, lo8\(f0_s_table\)) s
1173 518.333 294 M
1174 (        ldi r31, hi8\(f0_s_table\)) s
1175 518.333 286 M
1176 (        ldi r21, 15) s
1177 518.333 278 M
1178 (        mov r8, r21) s
1179 518.333 270 M
1180 (50:) s
1181 518.333 262 M
1182 (        ldd r22, Y+0) s
1183 518.333 254 M
1184 (        ldd r23, Y+1) s
1185 518.333 246 M
1186 (        ldd r24, Y+2) s
1187 518.333 238 M
1188 (        ldd r25, Y+3) s
1189 518.333 230 M
1190 (        lpm r20, Z+) s
1191 518.333 222 M
1192 (        movw r2, r30) s
1193 518.333 214 M
1194 (        rcall sn) s
1195 518.333 206 M
1196 (        movw r30, r2) s
1197 518.333 190 M
1198 (        rcall add_X_to_32) s
1199 518.333 174 M
1200 (        st Y+, r22) s
1201 518.333 166 M
1202 (        st Y+, r23) s
1203 518.333 158 M
1204 (        st Y+, r24) s
1205 518.333 150 M
1206 (        st Y+, r25) s
1207 518.333 142 M
1208 (        dec r8) s
1209 518.333 134 M
1210 (        brne 50b) s
1211 518.333 126 M
1212 (;---) s
1213 518.333 118 M
1214 (        ldd r22, Y+0) s
1215 518.333 110 M
1216 (        ldd r23, Y+1) s
1217 518.333 102 M
1218 (        ldd r24, Y+2) s
1219 518.333 94 M
1220 (        ldd r25, Y+3) s
1221 518.333 86 M
1222 (        clr r20) s
1223 518.333 78 M
1224 (        rcall sn) s
1225 518.333 70 M
1226 (        movw r30, r2) s
1227 518.333 62 M
1228 (        movw r26, h0) s
1229 518.333 54 M
1230 (        rcall add_X_to_32) s
1231 518.333 46 M
1232 (        sbiw r26, 4) s
1233 518.333 38 M
1234 (        std Y+0, r22) s
1235 518.333 30 M
1236 (        std Y+1, r23) s
1237 518.333 22 M
1238 (        std Y+2, r24) s
1239 518.333 14 M
1240 (        std Y+3, r25) s
1241 518.333 6 M
1242 (        sbiw r28, 15*4) s
1243 _R
1244 S
1245 %%Page: (3) 3
1246 %%BeginPageSetup
1247 _S
1248 90 rotate
1249 36 -577 translate
1250 /pagenum 3 def
1251 /fname (bmw_small-tinyasm.S) def
1252 /fdir () def
1253 /ftail (bmw_small-tinyasm.S) def
1254 % User defined strings:
1255 /fmodstr (Mo Apr 05 09:57:29 2010) def
1256 /pagenumstr (3) def
1257 /user_header_p false def
1258 /user_footer_p false def
1259 %%EndPageSetup
1260 column_lines
1261 column_borders
1262 do_header
1263 5 534 M
1264 (        movw r20, h0) s
1265 5 526 M
1266 (        movw r22, m0) s
1267 5 518 M
1268 (        ret) s
1269 5 502 M
1270 (/*********************************************************) s
1271 5 494 M
1272 (*********************/) s
1273 5 478 M
1274 (const_lut:) s
1275 5 470 M
1276 (        .long 0x55555550, 0x5aaaaaa5, 0x5ffffffa, 0x655555) s
1277 5 462 M
1278 (4f) s
1279 5 454 M
1280 (        .long 0x6aaaaaa4, 0x6ffffff9, 0x7555554e, 0x7aaaaa) s
1281 5 446 M
1282 (a3) s
1283 5 438 M
1284 (        .long 0x7ffffff8, 0x8555554d, 0x8aaaaaa2, 0x8fffff) s
1285 5 430 M
1286 (f7) s
1287 5 422 M
1288 (        .long 0x9555554c, 0x9aaaaaa1, 0x9ffffff6, 0xa55555) s
1289 5 414 M
1290 (4b) s
1291 5 398 M
1292 (/*********************************************************) s
1293 5 390 M
1294 (**********************) s
1295 5 382 M
1296 (* uint32_t addelment\(uint8_t j, const uint32_t* m, const u) s
1297 5 374 M
1298 (int32_t* h\){) s
1299 5 366 M
1300 (*       uint32_t r;) s
1301 5 358 M
1302 (*       r  = pgm_read_dword\(k_lut+j\);) s
1303 5 350 M
1304 (*       r += rotl_addel\(\(\(uint32_t*\)m\)[j&0xf], j+0\);) s
1305 5 342 M
1306 (*       r += rotl_addel\(\(\(uint32_t*\)m\)[\(j+3\)&0xf], j+3\);) s
1307 5 334 M
1308 (*       r -= rotl_addel\(\(\(uint32_t*\)m\)[\(j+10\)&0xf], j+10\);) s
1309 5 326 M
1310 (*       r ^= \(\(uint32_t*\)h\)[\(j+7\)&0xf];) s
1311 5 318 M
1312 (*       return r;) s
1313 5 310 M
1314 (* }) s
1315 5 302 M
1316 (* param j: r24) s
1317 5 294 M
1318 (* param m: r22:r23) s
1319 5 286 M
1320 (* param h: r20:r21) s
1321 5 278 M
1322 (*/) s
1323 5 270 M
1324 (j    = 16) s
1325 5 262 M
1326 (acc2 =  8) s
1327 5 254 M
1328 (acc3 =  9) s
1329 5 246 M
1330 (h0   = 10) s
1331 5 238 M
1332 (h1   = 11) s
1333 5 230 M
1334 (m0   = 12) s
1335 5 222 M
1336 (m1   = 13) s
1337 5 214 M
1338 (acc0 = 14) s
1339 5 206 M
1340 (acc1 = 15) s
1341 5 190 M
1342 (add32_to_acc:) s
1343 5 182 M
1344 (        add acc0, r22) s
1345 5 174 M
1346 (        adc acc1, r23) s
1347 5 166 M
1348 (        adc acc2, r24) s
1349 5 158 M
1350 (        adc acc3, r25) s
1351 5 150 M
1352 (        ret) s
1353 5 134 M
1354 (eor32_to_acc:) s
1355 5 126 M
1356 (        eor acc0, r22) s
1357 5 118 M
1358 (        eor acc1, r23) s
1359 5 110 M
1360 (        eor acc2, r24) s
1361 5 102 M
1362 (        eor acc3, r25) s
1363 5 94 M
1364 (        ret) s
1365 5 78 M
1366 (load_acc_from_X:) s
1367 5 70 M
1368 (        ld acc0, X+) s
1369 5 62 M
1370 (        ld acc1, X+) s
1371 5 54 M
1372 (        ld acc2, X+) s
1373 5 46 M
1374 (        ld acc3, X+) s
1375 5 38 M
1376 (        ret) s
1377 5 22 M
1378 (add_acc_to_Z:) s
1379 5 14 M
1380 (        ld r0, Z) s
1381 5 6 M
1382 (        add r0, acc0) s
1383 261.667 534 M
1384 (        st Z+, r0) s
1385 261.667 526 M
1386 (        ld r0, Z) s
1387 261.667 518 M
1388 (        adc r0, acc1) s
1389 261.667 510 M
1390 (        st Z+, r0) s
1391 261.667 502 M
1392 (        ld r0, Z) s
1393 261.667 494 M
1394 (        adc r0, acc2) s
1395 261.667 486 M
1396 (        st Z+, r0) s
1397 261.667 478 M
1398 (        ld r0, Z) s
1399 261.667 470 M
1400 (        adc r0, acc3) s
1401 261.667 462 M
1402 (        st Z+, r0) s
1403 261.667 454 M
1404 (        ret) s
1405 261.667 438 M
1406 (load_rotate_add_M:) s
1407 261.667 430 M
1408 (        andi r20, 0x0f) s
1409 261.667 422 M
1410 (        mov r0, r20) s
1411 261.667 414 M
1412 (        lsl r0) s
1413 261.667 406 M
1414 (        lsl r0) s
1415 261.667 398 M
1416 (        movw r26, m0) s
1417 261.667 390 M
1418 (        add r26, r0) s
1419 261.667 382 M
1420 (        adc r27, r1) s
1421 261.667 374 M
1422 (        ld r22, X+) s
1423 261.667 366 M
1424 (        ld r23, X+) s
1425 261.667 358 M
1426 (        ld r24, X+) s
1427 261.667 350 M
1428 (        ld r25, X+) s
1429 261.667 342 M
1430 (        inc r20) s
1431 261.667 334 M
1432 (        rcall rotateleft32) s
1433 261.667 326 M
1434 (        brts 10f) s
1435 261.667 318 M
1436 (        rcall add32_to_acc) s
1437 261.667 310 M
1438 (        ret) s
1439 261.667 302 M
1440 (10:     sub acc0, r22) s
1441 261.667 294 M
1442 (        sbc acc1, r23) s
1443 261.667 286 M
1444 (        sbc acc2, r24) s
1445 261.667 278 M
1446 (        sbc acc3, r25) s
1447 261.667 270 M
1448 (        ret) s
1449 261.667 254 M
1450 (addelement:) s
1451 261.667 246 M
1452 (        mov j, r24) s
1453 261.667 238 M
1454 (        movw h0, r20) s
1455 261.667 230 M
1456 (        movw m0, r22) s
1457 261.667 222 M
1458 (        lsl r24) s
1459 261.667 214 M
1460 (        lsl r24) s
1461 261.667 206 M
1462 (        mov r28, r24) s
1463 261.667 198 M
1464 (        ldi r30, lo8\(const_lut\)) s
1465 261.667 190 M
1466 (        ldi r31, hi8\(const_lut\)) s
1467 261.667 182 M
1468 (        add r30, r24) s
1469 261.667 174 M
1470 (        adc r31, r1) s
1471 261.667 166 M
1472 (        lpm acc0, Z+) s
1473 261.667 158 M
1474 (        lpm acc1, Z+) s
1475 261.667 150 M
1476 (        lpm acc2, Z+) s
1477 261.667 142 M
1478 (        lpm acc3, Z+) s
1479 261.667 134 M
1480 (        clt) s
1481 261.667 126 M
1482 (        mov r20, j) s
1483 261.667 118 M
1484 (        rcall load_rotate_add_M) s
1485 261.667 110 M
1486 (        mov r20, j) s
1487 261.667 102 M
1488 (        subi r20, -3) s
1489 261.667 94 M
1490 (        rcall load_rotate_add_M) s
1491 261.667 86 M
1492 (        mov r20, j) s
1493 261.667 78 M
1494 (        set) s
1495 261.667 70 M
1496 (        subi r20, -10) s
1497 261.667 62 M
1498 (        rcall load_rotate_add_M) s
1499 261.667 54 M
1500 (        lsl j) s
1501 261.667 46 M
1502 (        lsl j) s
1503 261.667 38 M
1504 (        subi j, -7*4) s
1505 261.667 30 M
1506 (        andi j, 0x3f) s
1507 261.667 22 M
1508 (        movw r26, h0) s
1509 261.667 14 M
1510 (        add r26, j) s
1511 261.667 6 M
1512 (        adc r27, r1) s
1513 518.333 534 M
1514 (        ld r0, X+) s
1515 518.333 526 M
1516 (        eor acc0, r0) s
1517 518.333 518 M
1518 (        ld r0, X+) s
1519 518.333 510 M
1520 (        eor acc1, r0) s
1521 518.333 502 M
1522 (        ld r0, X+) s
1523 518.333 494 M
1524 (        eor acc2, r0) s
1525 518.333 486 M
1526 (        ld r0, X+) s
1527 518.333 478 M
1528 (        eor acc3, r0) s
1529 518.333 470 M
1530 (;---) s
1531 518.333 462 M
1532 (        ret) s
1533 518.333 446 M
1534 (/*********************************************************) s
1535 518.333 438 M
1536 (*********************/) s
1537 518.333 430 M
1538 (/*) s
1539 518.333 422 M
1540 (  param q: r26:r27) s
1541 518.333 414 M
1542 (  param m: r22:r23) s
1543 518.333 406 M
1544 (  param h: r20:r21) s
1545 518.333 398 M
1546 (  param j: r24) s
1547 518.333 390 M
1548 (*/) s
1549 518.333 374 M
1550 (expand_intro:) s
1551 518.333 366 M
1552 (        push_range 20, 27) s
1553 518.333 358 M
1554 (;       push r24) s
1555 518.333 350 M
1556 (        rcall addelement) s
1557 518.333 342 M
1558 (;       pop r24) s
1559 518.333 334 M
1560 (        pop_range 20, 27) s
1561 518.333 326 M
1562 (        lsl r24) s
1563 518.333 318 M
1564 (        lsl r24) s
1565 518.333 310 M
1566 (        add r26, r24) s
1567 518.333 302 M
1568 (        adc r27, r1) s
1569 518.333 294 M
1570 (        ret) s
1571 518.333 286 M
1572 (expand1:) s
1573 518.333 278 M
1574 (        rcall expand_intro) s
1575 518.333 270 M
1576 (        ldi r19, 1) s
1577 518.333 262 M
1578 (10:) s
1579 518.333 254 M
1580 (        rcall load32_from_X) s
1581 518.333 246 M
1582 (        mov r20, r19) s
1583 518.333 238 M
1584 (        andi r20, 3) s
1585 518.333 230 M
1586 (        rcall sn) s
1587 518.333 222 M
1588 (        rcall add32_to_acc) s
1589 518.333 214 M
1590 (        inc r19) s
1591 518.333 206 M
1592 (        cpi r19, 17) s
1593 518.333 198 M
1594 (        brne 10b) s
1595 518.333 190 M
1596 (expand1_exit:) s
1597 518.333 182 M
1598 (;       adiw r26, 63) s
1599 518.333 174 M
1600 (        st X+, acc0) s
1601 518.333 166 M
1602 (        st X+, acc1) s
1603 518.333 158 M
1604 (        st X+, acc2) s
1605 518.333 150 M
1606 (        st X+, acc3) s
1607 518.333 142 M
1608 (        ret) s
1609 518.333 126 M
1610 (/*********************************************************) s
1611 518.333 118 M
1612 (*********************/) s
1613 518.333 110 M
1614 (/*) s
1615 518.333 102 M
1616 (  param q: r26:r27) s
1617 518.333 94 M
1618 (  param m: r22:r23) s
1619 518.333 86 M
1620 (  param h: r20:r21) s
1621 518.333 78 M
1622 (  param j: r24) s
1623 518.333 70 M
1624 (*/) s
1625 518.333 54 M
1626 (expand2_rot_table:) s
1627 518.333 46 M
1628 (        .byte 0,3,0,7,0,13,0,16,0,19,0,23,0,27) s
1629 518.333 30 M
1630 (expand2:) s
1631 518.333 22 M
1632 (        rcall expand_intro) s
1633 518.333 14 M
1634 (        ldi r19, 14) s
1635 518.333 6 M
1636 (        ldi r30, lo8\(expand2_rot_table\)) s
1637 _R
1638 S
1639 %%Page: (4) 4
1640 %%BeginPageSetup
1641 _S
1642 90 rotate
1643 36 -577 translate
1644 /pagenum 4 def
1645 /fname (bmw_small-tinyasm.S) def
1646 /fdir () def
1647 /ftail (bmw_small-tinyasm.S) def
1648 % User defined strings:
1649 /fmodstr (Mo Apr 05 09:57:29 2010) def
1650 /pagenumstr (4) def
1651 /user_header_p false def
1652 /user_footer_p false def
1653 %%EndPageSetup
1654 column_lines
1655 column_borders
1656 do_header
1657 5 534 M
1658 (        ldi r31, hi8\(expand2_rot_table\)) s
1659 5 526 M
1660 (10:) s
1661 5 518 M
1662 (        rcall load32_from_X) s
1663 5 510 M
1664 (        mov r20, r19) s
1665 5 502 M
1666 (        lpm r20, Z+) s
1667 5 494 M
1668 (        rcall rotateleft32) s
1669 5 486 M
1670 (        rcall add32_to_acc) s
1671 5 478 M
1672 (        dec r19) s
1673 5 470 M
1674 (        brne 10b) s
1675 5 462 M
1676 (        rcall load32_from_X) s
1677 5 454 M
1678 (        ldi r20, 4) s
1679 5 446 M
1680 (        rcall sn) s
1681 5 438 M
1682 (        rcall add32_to_acc) s
1683 5 430 M
1684 (        rcall load32_from_X) s
1685 5 422 M
1686 (        ldi r20, 5) s
1687 5 414 M
1688 (        rcall sn) s
1689 5 406 M
1690 (        rcall add32_to_acc) s
1691 5 390 M
1692 (        rjmp expand1_exit) s
1693 5 374 M
1694 (/*********************************************************) s
1695 5 366 M
1696 (*********************/) s
1697 5 358 M
1698 (/*) s
1699 5 350 M
1700 (  param q: r24:r25) s
1701 5 342 M
1702 (  param m: r22:r23) s
1703 5 334 M
1704 (  param h: r20:r21) s
1705 5 326 M
1706 (*/) s
1707 5 318 M
1708 (/* for calling expand1/2) s
1709 5 310 M
1710 (  param q: r26:r27) s
1711 5 302 M
1712 (  param m: r22:r23) s
1713 5 294 M
1714 (  param h: r20:r21) s
1715 5 286 M
1716 (  param j: r24) s
1717 5 278 M
1718 (*/) s
1719 5 270 M
1720 (f1:) s
1721 5 262 M
1722 (        movw r2, r24) s
1723 5 254 M
1724 (        movw r4, r22) s
1725 5 246 M
1726 (        movw r6, r20) s
1727 5 238 M
1728 (        movw r26, r2) s
1729 5 230 M
1730 (;       movw r22, r4) s
1731 5 222 M
1732 (;   movw r20, r6) s
1733 5 214 M
1734 (        clr r24) s
1735 5 206 M
1736 (        rcall expand1) s
1737 5 198 M
1738 (        movw r26, r2) s
1739 5 190 M
1740 (        movw r22, r4) s
1741 5 182 M
1742 (    movw r20, r6) s
1743 5 174 M
1744 (        ldi r24, 1) s
1745 5 166 M
1746 (        rcall expand1) s
1747 5 158 M
1748 (        ldi r17, 2) s
1749 5 150 M
1750 (10:     movw r26, r2) s
1751 5 142 M
1752 (        movw r22, r4) s
1753 5 134 M
1754 (        movw r20, r6) s
1755 5 126 M
1756 (        mov r24, r17) s
1757 5 118 M
1758 (        rcall expand2) s
1759 5 110 M
1760 (        inc r17) s
1761 5 102 M
1762 (        sbrs r17, 4) s
1763 5 94 M
1764 (        rjmp 10b) s
1765 5 86 M
1766 (        movw r24, r2) s
1767 5 78 M
1768 (        movw r22, r4) s
1769 5 70 M
1770 (        movw r20, r6) s
1771 5 62 M
1772 (        ret) s
1773 5 46 M
1774 (/*********************************************************) s
1775 5 38 M
1776 (*********************/) s
1777 5 30 M
1778 (/*) s
1779 5 22 M
1780 (  param q: r24:r25) s
1781 5 14 M
1782 (  param m: r22:r23) s
1783 5 6 M
1784 (  param h: r20:r21) s
1785 261.667 534 M
1786 (*/) s
1787 261.667 526 M
1788 (f2_1_shift_table:) s
1789 261.667 518 M
1790 (        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x) s
1791 261.667 510 M
1792 (00) s
1793 261.667 502 M
1794 (        .byte 0x2B, 0x64, 0x66, 0x03, 0x51, 0x55, 0x87, 0x) s
1795 261.667 494 M
1796 (55) s
1797 261.667 486 M
1798 (f2_2_shift_table:) s
1799 261.667 478 M
1800 (        .byte \(2<<1\), \(7<<1\), \(4<<1\), \(3<<1\), \(4<<1\)+1, \(6) s
1801 261.667 470 M
1802 (<<1\)+1, \(6<<1\)) s
1803 261.667 462 M
1804 (        .byte 0 ; just for alignment) s
1805 261.667 454 M
1806 (acc2  =  8) s
1807 261.667 446 M
1808 (acc3  =  9) s
1809 261.667 438 M
1810 (acc0  = 14) s
1811 261.667 430 M
1812 (acc1  = 15) s
1813 261.667 422 M
1814 (xl0   =  2) s
1815 261.667 414 M
1816 (xl1   =  3) s
1817 261.667 406 M
1818 (xl2   =  4) s
1819 261.667 398 M
1820 (xl3   =  5) s
1821 261.667 390 M
1822 (xh0   =  6) s
1823 261.667 382 M
1824 (xh1   =  7) s
1825 261.667 374 M
1826 (xh2   = 10) s
1827 261.667 366 M
1828 (xh3   = 11) s
1829 261.667 358 M
1830 (q16_0 = 12) s
1831 261.667 350 M
1832 (q16_1 = 13) s
1833 261.667 342 M
1834 (h0   =  18) s
1835 261.667 334 M
1836 (h1   =  19) s
1837 261.667 326 M
1838 (f2:) s
1839 261.667 318 M
1840 (        movw r26, r24) s
1841 261.667 310 M
1842 (        /* calc XL */) s
1843 261.667 302 M
1844 (        adiw r26, 63) s
1845 261.667 294 M
1846 (        adiw r26,  1) s
1847 261.667 286 M
1848 (        movw q16_0, r26) s
1849 261.667 278 M
1850 (        clr xl0) s
1851 261.667 270 M
1852 (        clr xl1) s
1853 261.667 262 M
1854 (        clr xl2) s
1855 261.667 254 M
1856 (        clr xl3) s
1857 261.667 246 M
1858 (        ldi r17, 8) s
1859 261.667 238 M
1860 (10:     ld r0, X+) s
1861 261.667 230 M
1862 (        eor xl0, r0) s
1863 261.667 222 M
1864 (        ld r0, X+) s
1865 261.667 214 M
1866 (        eor xl1, r0) s
1867 261.667 206 M
1868 (        ld r0, X+) s
1869 261.667 198 M
1870 (        eor xl2, r0) s
1871 261.667 190 M
1872 (        ld r0, X+) s
1873 261.667 182 M
1874 (        eor xl3, r0) s
1875 261.667 174 M
1876 (        dec r17) s
1877 261.667 166 M
1878 (        brne 10b) s
1879 261.667 158 M
1880 (;--- /* calc XH */) s
1881 261.667 150 M
1882 (        movw xh0, xl0) s
1883 261.667 142 M
1884 (        movw xh2, xl2) s
1885 261.667 134 M
1886 (        ldi r17, 8) s
1887 261.667 126 M
1888 (10:     ld r0, X+) s
1889 261.667 118 M
1890 (        eor xh0, r0) s
1891 261.667 110 M
1892 (        ld r0, X+) s
1893 261.667 102 M
1894 (        eor xh1, r0) s
1895 261.667 94 M
1896 (        ld r0, X+) s
1897 261.667 86 M
1898 (        eor xh2, r0) s
1899 261.667 78 M
1900 (        ld r0, X+) s
1901 261.667 70 M
1902 (        eor xh3, r0) s
1903 261.667 62 M
1904 (        dec r17) s
1905 261.667 54 M
1906 (        brne 10b) s
1907 261.667 46 M
1908 (;--- DBG) s
1909 261.667 38 M
1910 (;       push_range 22, 25) s
1911 261.667 30 M
1912 (;       movw r22, xl0) s
1913 261.667 22 M
1914 (;       movw r24, xl2) s
1915 261.667 14 M
1916 (;       rcall print32) s
1917 261.667 6 M
1918 (;       movw r22, xh0) s
1919 518.333 534 M
1920 (;       movw r24, xh2) s
1921 518.333 526 M
1922 (;       rcall print32) s
1923 518.333 518 M
1924 (;       pop_range 22, 25) s
1925 518.333 510 M
1926 (;--- END DBG) s
1927 518.333 494 M
1928 (;--- /* calc first half of h0..h15 */) s
1929 518.333 486 M
1930 (        movw h0, r20) s
1931 518.333 478 M
1932 (        movw r28, r22) s
1933 518.333 470 M
1934 (        movw r26, q16_0) s
1935 518.333 462 M
1936 (        ldi r17, 16) s
1937 518.333 454 M
1938 (10:) s
1939 518.333 446 M
1940 (        ld acc0, Y+) s
1941 518.333 438 M
1942 (        ld acc1, Y+) s
1943 518.333 430 M
1944 (        ld acc2, Y+) s
1945 518.333 422 M
1946 (        ld acc3, Y+) s
1947 518.333 414 M
1948 (;---) s
1949 518.333 406 M
1950 (        ldi r30, lo8\(f2_1_shift_table-1\)) s
1951 518.333 398 M
1952 (        ldi r31, hi8\(f2_1_shift_table-1\)) s
1953 518.333 390 M
1954 (        movw r22, xh0) s
1955 518.333 382 M
1956 (        movw r24, xh2) s
1957 518.333 374 M
1958 (        add r30, r17) s
1959 518.333 366 M
1960 (        adc r31, r1) s
1961 518.333 358 M
1962 (        lpm r20, Z) s
1963 518.333 350 M
1964 (        mov r1, r20) s
1965 518.333 342 M
1966 (        andi r20, 0x0f) s
1967 518.333 334 M
1968 (        clt) s
1969 518.333 326 M
1970 (        cpi r17, 16) s
1971 518.333 318 M
1972 (        breq 20f) s
1973 518.333 310 M
1974 (        cpi r17, 11) s
1975 518.333 302 M
1976 (        brne 21f) s
1977 518.333 294 M
1978 (20:     set) s
1979 518.333 286 M
1980 (21:     brts 25f) s
1981 518.333 278 M
1982 (        rcall shiftright32) s
1983 518.333 270 M
1984 (        rjmp 26f) s
1985 518.333 262 M
1986 (25:     rcall shiftleft32) s
1987 518.333 254 M
1988 (26: rcall eor32_to_acc) s
1989 518.333 246 M
1990 (;---) s
1991 518.333 238 M
1992 (        rcall load32_from_X) s
1993 518.333 230 M
1994 (        mov r20, r1) s
1995 518.333 222 M
1996 (        clr r1) s
1997 518.333 214 M
1998 (        swap r20) s
1999 518.333 206 M
2000 (        andi r20, 0x0f) s
2001 518.333 198 M
2002 (        brts 27f) s
2003 518.333 190 M
2004 (        rcall shiftleft32) s
2005 518.333 182 M
2006 (        rjmp 28f) s
2007 518.333 174 M
2008 (27:     rcall shiftright32) s
2009 518.333 166 M
2010 (28:     rcall eor32_to_acc) s
2011 518.333 158 M
2012 (;---) s
2013 518.333 150 M
2014 (        movw r30, h0) s
2015 518.333 142 M
2016 (        st Z+, acc0) s
2017 518.333 134 M
2018 (        st Z+, acc1) s
2019 518.333 126 M
2020 (        st Z+, acc2) s
2021 518.333 118 M
2022 (        st Z+, acc3) s
2023 518.333 110 M
2024 (        movw h0, r30) s
2025 518.333 102 M
2026 (;---) s
2027 518.333 94 M
2028 (        dec r17) s
2029 518.333 86 M
2030 (        brne 10b) s
2031 518.333 78 M
2032 (;-----) s
2033 518.333 70 M
2034 (        sbiw r26, 4*8 /* X points to q[24] */) s
2035 518.333 62 M
2036 (        movw r28, r26) s
2037 518.333 54 M
2038 (        sbiw r28, 63) s
2039 518.333 46 M
2040 (        sbiw r28, 33 /* Y points to q[0] */) s
2041 518.333 38 M
2042 (        sbiw r30, 63) s
2043 518.333 30 M
2044 (        sbiw r30,  1 /* Z points to h0 */) s
2045 518.333 22 M
2046 (        ldi r17, 8) s
2047 518.333 14 M
2048 (10:     movw acc0, xl0) s
2049 518.333 6 M
2050 (        movw acc2, xl2) s
2051 _R
2052 S
2053 %%Page: (5) 5
2054 %%BeginPageSetup
2055 _S
2056 90 rotate
2057 36 -577 translate
2058 /pagenum 5 def
2059 /fname (bmw_small-tinyasm.S) def
2060 /fdir () def
2061 /ftail (bmw_small-tinyasm.S) def
2062 % User defined strings:
2063 /fmodstr (Mo Apr 05 09:57:29 2010) def
2064 /pagenumstr (5) def
2065 /user_header_p false def
2066 /user_footer_p false def
2067 %%EndPageSetup
2068 column_lines
2069 column_borders
2070 do_header
2071 5 534 M
2072 (        rcall load32_from_X) s
2073 5 526 M
2074 (        rcall eor32_to_acc) s
2075 5 518 M
2076 (        rcall load32_from_Y) s
2077 5 510 M
2078 (        rcall eor32_to_acc) s
2079 5 502 M
2080 (        rcall add_acc_to_Z) s
2081 5 494 M
2082 (        dec r17) s
2083 5 486 M
2084 (        brne 10b) s
2085 5 478 M
2086 (        sbiw r26, 9*4 /* X points to q[23] */) s
2087 5 470 M
2088 (        rcall load_acc_from_X) s
2089 5 462 M
2090 (        eor acc1, xl0) s
2091 5 454 M
2092 (        eor acc2, xl1) s
2093 5 446 M
2094 (        eor acc3, xl2) s
2095 5 438 M
2096 (        rcall load32_from_Y) s
2097 5 430 M
2098 (        rcall eor32_to_acc) s
2099 5 422 M
2100 (        rcall add_acc_to_Z) s
2101 5 414 M
2102 (;---) s
2103 5 406 M
2104 (        sbiw r26, 8*4 /* X points to q[16] */) s
2105 5 398 M
2106 (        mov h0, r30) s
2107 5 390 M
2108 (        ldi r17, 7) s
2109 5 382 M
2110 (10:) s
2111 5 374 M
2112 (        ldi r30, lo8\(f2_2_shift_table-1\)) s
2113 5 366 M
2114 (        ldi r31, hi8\(f2_2_shift_table-1\)) s
2115 5 358 M
2116 (        add r30, r17) s
2117 5 350 M
2118 (        adc r31, r1) s
2119 5 342 M
2120 (        lpm r20, Z) s
2121 5 334 M
2122 (        rcall load_acc_from_X) s
2123 5 326 M
2124 (        movw r22, xl0) s
2125 5 318 M
2126 (        movw r24, xl2) s
2127 5 310 M
2128 (        lsr r20) s
2129 5 302 M
2130 (        brcc 20f) s
2131 5 294 M
2132 (        rcall shiftleft32) s
2133 5 286 M
2134 (        rjmp 21f) s
2135 5 278 M
2136 (20:     rcall shiftright32) s
2137 5 270 M
2138 (21:) s
2139 5 262 M
2140 (        rcall eor32_to_acc) s
2141 5 254 M
2142 (        rcall load32_from_Y) s
2143 5 246 M
2144 (        rcall eor32_to_acc) s
2145 5 238 M
2146 (        movw r30, h0) s
2147 5 230 M
2148 (        rcall add_acc_to_Z) s
2149 5 222 M
2150 (        movw h0, r30) s
2151 5 214 M
2152 (        dec r17) s
2153 5 206 M
2154 (        brne 10b) s
2155 5 198 M
2156 (;-----) s
2157 5 190 M
2158 (        sbiw r30, 8*4 /* Z points to h8 */) s
2159 5 182 M
2160 (        movw r26, r30) s
2161 5 174 M
2162 (        sbiw r26, 4*4 /* X points to h4 */) s
2163 5 166 M
2164 (        ldi r17, 8) s
2165 5 158 M
2166 (        ldi r18, 9) s
2167 5 150 M
2168 (10:) s
2169 5 142 M
2170 (        rcall load32_from_X) s
2171 5 134 M
2172 (        mov r20, r18) s
2173 5 126 M
2174 (        rcall rotateleft32) s
2175 5 118 M
2176 (        movw acc0, r22) s
2177 5 110 M
2178 (        movw acc2, r24) s
2179 5 102 M
2180 (        rcall add_acc_to_Z) s
2181 5 94 M
2182 (        inc r18) s
2183 5 86 M
2184 (        cpi r17, 5) s
2185 5 78 M
2186 (        breq 20f) s
2187 5 70 M
2188 (        dec r17) s
2189 5 62 M
2190 (        brne 10b) s
2191 5 54 M
2192 (        ret) s
2193 5 46 M
2194 (20: sbiw r26, 8*4) s
2195 5 38 M
2196 (        dec r17) s
2197 5 30 M
2198 (        rjmp 10b) s
2199 5 14 M
2200 (/*********************************************************) s
2201 5 6 M
2202 (*********************/) s
2203 261.667 534 M
2204 (/*) s
2205 261.667 526 M
2206 (  param ctx:  r24:r25) s
2207 261.667 518 M
2208 (  param msg:  r22:r23) s
2209 261.667 510 M
2210 (*/) s
2211 261.667 502 M
2212 (/* f0) s
2213 261.667 494 M
2214 (  param q:  r28:r29 \(Y\)) s
2215 261.667 486 M
2216 (  param h:  r26:r27 \(X\)) s
2217 261.667 478 M
2218 (  param m:  r30:r31 \(Z\)) s
2219 261.667 470 M
2220 (*/) s
2221 261.667 462 M
2222 (/* f1) s
2223 261.667 454 M
2224 (  param q: r24:r25) s
2225 261.667 446 M
2226 (  param m: r22:r23) s
2227 261.667 438 M
2228 (  param h: r20:r21) s
2229 261.667 430 M
2230 (*/) s
2231 261.667 422 M
2232 (/* f2) s
2233 261.667 414 M
2234 (  param q: r24:r25) s
2235 261.667 406 M
2236 (  param m: r22:r23) s
2237 261.667 398 M
2238 (  param h: r20:r21) s
2239 261.667 390 M
2240 (*/) s
2241 261.667 382 M
2242 (.global bmw_small_nextBlock) s
2243 261.667 374 M
2244 (.global bmw224_nextBlock) s
2245 261.667 366 M
2246 (.global bmw256_nextBlock) s
2247 261.667 358 M
2248 (bmw_small_nextBlock:) s
2249 261.667 350 M
2250 (bmw224_nextBlock:) s
2251 261.667 342 M
2252 (bmw256_nextBlock:) s
2253 261.667 334 M
2254 (        push_range 28, 29) s
2255 261.667 326 M
2256 (        push_range  2, 17) s
2257 261.667 318 M
2258 (        stack_alloc_large 32*4, r28, r29) s
2259 261.667 310 M
2260 (        adiw r28, 1) s
2261 261.667 302 M
2262 (;       push_range 28, 29 /* push Q */) s
2263 261.667 294 M
2264 (;       push_range 22, 25 /* push M & H */) s
2265 261.667 286 M
2266 (        /* increment counter */) s
2267 261.667 278 M
2268 (        movw r26, r24) s
2269 261.667 270 M
2270 (        movw r2, r26) s
2271 261.667 262 M
2272 (        adiw r26, 63) s
2273 261.667 254 M
2274 (        adiw r26,  1) s
2275 261.667 246 M
2276 (        rcall load_acc_from_X) s
2277 261.667 238 M
2278 (        ldi r19, 1) s
2279 261.667 230 M
2280 (        add acc0, r19) s
2281 261.667 222 M
2282 (        adc acc1, r1) s
2283 261.667 214 M
2284 (        adc acc2, r1) s
2285 261.667 206 M
2286 (        adc acc3, r1) s
2287 261.667 198 M
2288 (        st -X, acc3) s
2289 261.667 190 M
2290 (        st -X, acc2) s
2291 261.667 182 M
2292 (        st -X, acc1) s
2293 261.667 174 M
2294 (        st -X, acc0) s
2295 261.667 166 M
2296 (        /* call f0 */) s
2297 261.667 158 M
2298 (        movw r30, r22) s
2299 261.667 150 M
2300 (        movw r26, r24) s
2301 261.667 142 M
2302 (        rcall f0) s
2303 261.667 134 M
2304 (        /* call f1*/) s
2305 261.667 126 M
2306 (        movw r24, r28) s
2307 261.667 110 M
2308 (;       rcall printQ) s
2309 261.667 102 M
2310 (        rcall f1) s
2311 261.667 94 M
2312 (        /* call f2 */) s
2313 261.667 86 M
2314 (;       pop_range 20, 25) s
2315 261.667 78 M
2316 (;       push_range 20, 25) s
2317 261.667 70 M
2318 (;       rcall printQ) s
2319 261.667 62 M
2320 (;       push r20) s
2321 261.667 54 M
2322 (;       push r21) s
2323 261.667 46 M
2324 (        call f2) s
2325 261.667 38 M
2326 (;--- DBG) s
2327 261.667 30 M
2328 (;       pop r25) s
2329 261.667 22 M
2330 (;       pop r24) s
2331 261.667 14 M
2332 (;       ldi r22, 'H') s
2333 261.667 6 M
2334 (;       rcall printX) s
2335 518.333 534 M
2336 (;--- END DBG) s
2337 518.333 526 M
2338 (        stack_free_large3 32*4) s
2339 518.333 518 M
2340 (        pop_range  2, 17) s
2341 518.333 510 M
2342 (        pop_range 28, 29) s
2343 518.333 502 M
2344 (        ret) s
2345 518.333 486 M
2346 (/*********************************************************) s
2347 518.333 478 M
2348 (*********************/) s
2349 518.333 470 M
2350 (/*) s
2351 518.333 462 M
2352 (  param ctx:  r24:r25) s
2353 518.333 454 M
2354 (  param msg:  r22:r23) s
2355 518.333 446 M
2356 (  param len:  r20:r21) s
2357 518.333 438 M
2358 (*/) s
2359 518.333 430 M
2360 (ctx0 =  2) s
2361 518.333 422 M
2362 (ctx1 =  3) s
2363 518.333 414 M
2364 (blc0 =  4) s
2365 518.333 406 M
2366 (blc1 =  5) s
2367 518.333 398 M
2368 (len0 = 28) s
2369 518.333 390 M
2370 (len1 = 29) s
2371 518.333 382 M
2372 (buf0 =  6) s
2373 518.333 374 M
2374 (buf1 =  7) s
2375 518.333 358 M
2376 (.global bmw_small_lastBlock) s
2377 518.333 350 M
2378 (.global bmw224_lastBlock) s
2379 518.333 342 M
2380 (.global bmw256_lastBlock) s
2381 518.333 334 M
2382 (bmw_small_lastBlock:) s
2383 518.333 326 M
2384 (bmw224_lastBlock:) s
2385 518.333 318 M
2386 (bmw256_lastBlock:) s
2387 518.333 310 M
2388 (/*      while\(length_b >= BMW_SMALL_BLOCKSIZE\){) s
2389 518.333 302 M
2390 (                bmw_small_nextBlock\(ctx, block\);) s
2391 518.333 294 M
2392 (                length_b -= BMW_SMALL_BLOCKSIZE;) s
2393 518.333 286 M
2394 (                block = \(uint8_t*\)block + BMW_SMALL_BLOCKS) s
2395 518.333 278 M
2396 (IZE_B;) s
2397 518.333 270 M
2398 (        }) s
2399 518.333 262 M
2400 (*/) s
2401 518.333 254 M
2402 (        push_range 2, 7) s
2403 518.333 246 M
2404 (        push_range 28, 29) s
2405 518.333 238 M
2406 (        movw ctx0, r24) s
2407 518.333 230 M
2408 (        movw blc0, r22) s
2409 518.333 222 M
2410 (        movw len0, r20) s
2411 518.333 214 M
2412 (1:) s
2413 518.333 206 M
2414 (        cpi len1, hi8\(512\)) s
2415 518.333 198 M
2416 (        brlo 2f) s
2417 518.333 190 M
2418 (        movw r24, ctx0) s
2419 518.333 182 M
2420 (        movw r22, blc0) s
2421 518.333 174 M
2422 (        rcall bmw_small_nextBlock) s
2423 518.333 166 M
2424 (        ldi r24, 64) s
2425 518.333 158 M
2426 (        add blc0, r24) s
2427 518.333 150 M
2428 (        adc blc1, r1) s
2429 518.333 142 M
2430 (        subi len1, hi8\(512\)) s
2431 518.333 134 M
2432 (        rjmp 1b) s
2433 518.333 126 M
2434 (2:) s
2435 518.333 118 M
2436 (/*      struct {) s
2437 518.333 110 M
2438 (                uint8_t  buffer[64];) s
2439 518.333 102 M
2440 (                uint32_t ctr;) s
2441 518.333 94 M
2442 (        } pctx;) s
2443 518.333 86 M
2444 (*/) s
2445 518.333 78 M
2446 (        stack_alloc_large 68) s
2447 518.333 70 M
2448 (        adiw r30, 1) s
2449 518.333 62 M
2450 (        movw buf0, r30) s
2451 518.333 54 M
2452 (/*      memset\(pctx.buffer, 0, 64\);) s
2453 518.333 46 M
2454 (        memcpy\(pctx.buffer, block, \(length_b+7\)/8\);) s
2455 518.333 38 M
2456 (        pctx.buffer[length_b>>3] |= 0x80 >> \(length_b&0x07) s
2457 518.333 30 M
2458 (\);) s
2459 518.333 22 M
2460 (*/      movw r24, len0) s
2461 518.333 14 M
2462 (        lsr r25) s
2463 518.333 6 M
2464 (        ror r24) s
2465 _R
2466 S
2467 %%Page: (6) 6
2468 %%BeginPageSetup
2469 _S
2470 90 rotate
2471 36 -577 translate
2472 /pagenum 6 def
2473 /fname (bmw_small-tinyasm.S) def
2474 /fdir () def
2475 /ftail (bmw_small-tinyasm.S) def
2476 % User defined strings:
2477 /fmodstr (Mo Apr 05 09:57:29 2010) def
2478 /pagenumstr (6) def
2479 /user_header_p false def
2480 /user_footer_p false def
2481 %%EndPageSetup
2482 column_lines
2483 column_borders
2484 do_header
2485 5 534 M
2486 (        lsr r24) s
2487 5 526 M
2488 (        lsr r24) s
2489 5 518 M
2490 (        ldi r23, 63) s
2491 5 510 M
2492 (        sub r23, r24) s
2493 5 502 M
2494 (        movw r26, blc0) s
2495 5 494 M
2496 (        tst r24) s
2497 5 486 M
2498 (        breq 301f) s
2499 5 478 M
2500 (        /* copy \(#r24\) bytes to stack buffer */) s
2501 5 470 M
2502 (30: ld r20, X+) s
2503 5 462 M
2504 (        st Z+, r20) s
2505 5 454 M
2506 (        dec r24) s
2507 5 446 M
2508 (        brne 30b) s
2509 5 438 M
2510 (301: /* calculate the appended byte */) s
2511 5 430 M
2512 (        clr r20) s
2513 5 422 M
2514 (        mov r21, len0) s
2515 5 414 M
2516 (        ldi r24, 0x80) s
2517 5 406 M
2518 (        andi r21, 0x07) s
2519 5 398 M
2520 (        breq 305f) s
2521 5 390 M
2522 (        ld r20, X+) s
2523 5 382 M
2524 (303:) s
2525 5 374 M
2526 (        lsr r24) s
2527 5 366 M
2528 (        dec r21) s
2529 5 358 M
2530 (        brne 303b) s
2531 5 350 M
2532 (305:) s
2533 5 342 M
2534 (        or r20, r24) s
2535 5 334 M
2536 (        st Z+, r20) s
2537 5 326 M
2538 (        tst r23) s
2539 5 318 M
2540 (        breq 32f) s
2541 5 310 M
2542 (31: st Z+, r1) s
2543 5 302 M
2544 (        dec r23) s
2545 5 294 M
2546 (        brne 31b) s
2547 5 286 M
2548 (32:) s
2549 5 278 M
2550 (/*      if\(length_b+1>64*8-64\){ ; = 64*7-1 = 447 max\(lengt) s
2551 5 270 M
2552 (h_b\)=511) s
2553 5 262 M
2554 (                bmw_small_nextBlock\(ctx, pctx.buffer\);) s
2555 5 254 M
2556 (                memset\(pctx.buffer, 0, 64-8\);) s
2557 5 246 M
2558 (                ctx->counter -= 1;) s
2559 5 238 M
2560 (        }) s
2561 5 230 M
2562 (*/) s
2563 5 222 M
2564 (        tst len1) s
2565 5 214 M
2566 (        breq 400f) s
2567 5 206 M
2568 (        cpi len0, 192) s
2569 5 198 M
2570 (        brlo 400f) s
2571 5 190 M
2572 (        movw r24, ctx0) s
2573 5 182 M
2574 (        movw r22, buf0) s
2575 5 174 M
2576 (        rcall bmw_small_nextBlock) s
2577 5 166 M
2578 (        movw r26, buf0) s
2579 5 158 M
2580 (        ldi r20, 64-8) s
2581 5 150 M
2582 (350:) s
2583 5 142 M
2584 (        st X+, r1) s
2585 5 134 M
2586 (        dec r20) s
2587 5 126 M
2588 (        brne 350b) s
2589 5 118 M
2590 (        movw r30, ctx0) s
2591 5 110 M
2592 (        adiw r30, 60) s
2593 5 102 M
2594 (        ldd r21, Z+4) s
2595 5 94 M
2596 (        ldd r22, Z+5) s
2597 5 86 M
2598 (        ldd r23, Z+6) s
2599 5 78 M
2600 (        ldd r24, Z+7) s
2601 5 70 M
2602 (        subi r21, 1) s
2603 5 62 M
2604 (        sbc r22, r1) s
2605 5 54 M
2606 (        sbc r23, r1) s
2607 5 46 M
2608 (        sbc r24, r1) s
2609 5 38 M
2610 (        rjmp 410f) s
2611 5 30 M
2612 (/*      *\(\(uint64_t*\)&\(pctx.buffer[64-8]\)\) = \(uint64_t\)\(ct) s
2613 5 22 M
2614 (x->counter*512LL\)+\(uint64_t\)length_b;) s
2615 5 14 M
2616 (        bmw_small_nextBlock\(ctx, pctx.buffer\);) s
2617 5 6 M
2618 (*/) s
2619 261.667 534 M
2620 (400:) s
2621 261.667 526 M
2622 (        movw r30, ctx0) s
2623 261.667 518 M
2624 (        adiw r30, 60) s
2625 261.667 510 M
2626 (        ldd r21, Z+4) s
2627 261.667 502 M
2628 (        ldd r22, Z+5) s
2629 261.667 494 M
2630 (        ldd r23, Z+6) s
2631 261.667 486 M
2632 (        ldd r24, Z+7) s
2633 261.667 478 M
2634 (410:) s
2635 261.667 470 M
2636 (        clr r25) s
2637 261.667 462 M
2638 (        lsl r21) s
2639 261.667 454 M
2640 (        rol r22) s
2641 261.667 446 M
2642 (        rol r23) s
2643 261.667 438 M
2644 (        rol r24) s
2645 261.667 430 M
2646 (        rol r25) s
2647 261.667 422 M
2648 (        mov r20, len0) s
2649 261.667 414 M
2650 (        add r21, len1) s
2651 261.667 406 M
2652 (        adc r22, r1) s
2653 261.667 398 M
2654 (        adc r23, r1) s
2655 261.667 390 M
2656 (        adc r24, r1) s
2657 261.667 382 M
2658 (        adc r25, r1) s
2659 261.667 374 M
2660 (        movw r30, buf0) s
2661 261.667 366 M
2662 (        adiw r30, 64-8) s
2663 261.667 358 M
2664 (        st Z+, r20) s
2665 261.667 350 M
2666 (        st Z+, r21) s
2667 261.667 342 M
2668 (        st Z+, r22) s
2669 261.667 334 M
2670 (        st Z+, r23) s
2671 261.667 326 M
2672 (        st Z+, r24) s
2673 261.667 318 M
2674 (        st Z+, r25) s
2675 261.667 310 M
2676 (        st Z+, r1) s
2677 261.667 302 M
2678 (        st Z+, r1) s
2679 261.667 294 M
2680 (        movw r24, ctx0) s
2681 261.667 286 M
2682 (        movw r22, buf0) s
2683 261.667 278 M
2684 (        rcall bmw_small_nextBlock) s
2685 261.667 270 M
2686 (/*      memset\(pctx.buffer, 0xaa, 64\);) s
2687 261.667 262 M
2688 (        for\(i=0; i<16;++i\){) s
2689 261.667 254 M
2690 (                pctx.buffer[i*4] = i+0xa0;) s
2691 261.667 246 M
2692 (        }) s
2693 261.667 238 M
2694 (*/) s
2695 261.667 230 M
2696 (        ldi r18, 0xa0) s
2697 261.667 222 M
2698 (        ldi r19, 0xaa) s
2699 261.667 214 M
2700 (        movw r26, buf0) s
2701 261.667 206 M
2702 (500:) s
2703 261.667 198 M
2704 (        st X+, r18) s
2705 261.667 190 M
2706 (        st X+, r19) s
2707 261.667 182 M
2708 (        st X+, r19) s
2709 261.667 174 M
2710 (        st X+, r19) s
2711 261.667 166 M
2712 (        inc r18) s
2713 261.667 158 M
2714 (        sbrs r18, 4) s
2715 261.667 150 M
2716 (        rjmp 500b) s
2717 261.667 142 M
2718 (/*      bmw_small_nextBlock\(\(bmw_small_ctx_t*\)&pctx, ctx->) s
2719 261.667 134 M
2720 (h\);) s
2721 261.667 126 M
2722 (        memcpy\(ctx->h, pctx.buffer, 64\);) s
2723 261.667 118 M
2724 (*/) s
2725 261.667 110 M
2726 (        movw r24, buf0) s
2727 261.667 102 M
2728 (        movw r22, ctx0) s
2729 261.667 94 M
2730 (        rcall bmw_small_nextBlock) s
2731 261.667 86 M
2732 (        ldi r18, 64) s
2733 261.667 78 M
2734 (        movw r26, ctx0) s
2735 261.667 70 M
2736 (        movw r30, buf0) s
2737 261.667 62 M
2738 (600:) s
2739 261.667 54 M
2740 (        ld r20, Z+) s
2741 261.667 46 M
2742 (        st X+, r20) s
2743 261.667 38 M
2744 (        dec r18) s
2745 261.667 30 M
2746 (        brne 600b) s
2747 261.667 14 M
2748 (        stack_free_large 68) s
2749 261.667 6 M
2750 (        pop_range 28, 29) s
2751 518.333 534 M
2752 (        pop_range 2, 7) s
2753 518.333 526 M
2754 (        ret) s
2755 518.333 502 M
2756 (/*********************************************************) s
2757 518.333 494 M
2758 (**********************) s
2759 518.333 486 M
2760 (* void bmw224_ctx2hash\(void* dest, const bmw224_ctx_t* ctx) s
2761 518.333 478 M
2762 (\){) s
2763 518.333 470 M
2764 (*       memcpy\(dest, &\(ctx->h[9]\), 224/8\);) s
2765 518.333 462 M
2766 (* }) s
2767 518.333 454 M
2768 (*) s
2769 518.333 446 M
2770 (* param dest:  r24:r25) s
2771 518.333 438 M
2772 (* param ctx:   r22:r23) s
2773 518.333 430 M
2774 (*/) s
2775 518.333 422 M
2776 (.global bmw224_ctx2hash) s
2777 518.333 414 M
2778 (bmw224_ctx2hash:) s
2779 518.333 406 M
2780 (        movw r26, r24) s
2781 518.333 398 M
2782 (        movw r30, r22) s
2783 518.333 390 M
2784 (        adiw r30, 9*4) s
2785 518.333 382 M
2786 (        ldi r22, 28) s
2787 518.333 374 M
2788 (        rjmp 1f) s
2789 518.333 358 M
2790 (/*********************************************************) s
2791 518.333 350 M
2792 (**********************) s
2793 518.333 342 M
2794 (* void bmw256_ctx2hash\(void* dest, const bmw256_ctx_t* ctx) s
2795 518.333 334 M
2796 (\){) s
2797 518.333 326 M
2798 (*       memcpy\(dest, &\(ctx->h[8]\), 256/8\);) s
2799 518.333 318 M
2800 (* }) s
2801 518.333 310 M
2802 (*) s
2803 518.333 302 M
2804 (* param dest:  r24:r25) s
2805 518.333 294 M
2806 (* param ctx:   r22:r23) s
2807 518.333 286 M
2808 (*/) s
2809 518.333 278 M
2810 (.global bmw256_ctx2hash) s
2811 518.333 270 M
2812 (bmw256_ctx2hash:) s
2813 518.333 262 M
2814 (        movw r26, r24) s
2815 518.333 254 M
2816 (        movw r30, r22) s
2817 518.333 246 M
2818 (        adiw r30, 8*4) s
2819 518.333 238 M
2820 (        ldi r22, 32) s
2821 518.333 230 M
2822 (1:) s
2823 518.333 222 M
2824 (        ld r23, Z+) s
2825 518.333 214 M
2826 (        st X+, r23) s
2827 518.333 206 M
2828 (        dec r22) s
2829 518.333 198 M
2830 (        brne 1b) s
2831 518.333 190 M
2832 (        ret) s
2833 518.333 174 M
2834 (/*********************************************************) s
2835 518.333 166 M
2836 (**********************) s
2837 518.333 158 M
2838 (* void bmw256\(void* dest, const void* msg, uint32_t length) s
2839 518.333 150 M
2840 (_b\){) s
2841 518.333 142 M
2842 (*       bmw_small_ctx_t ctx;) s
2843 518.333 134 M
2844 (*       bmw256_init\(&ctx\);) s
2845 518.333 126 M
2846 (*       while\(length_b>=BMW_SMALL_BLOCKSIZE\){) s
2847 518.333 118 M
2848 (*               bmw_small_nextBlock\(&ctx, msg\);) s
2849 518.333 110 M
2850 (*               length_b -= BMW_SMALL_BLOCKSIZE;) s
2851 518.333 102 M
2852 (*               msg = \(uint8_t*\)msg + BMW_SMALL_BLOCKSIZE_) s
2853 518.333 94 M
2854 (B;) s
2855 518.333 86 M
2856 (*       }) s
2857 518.333 78 M
2858 (*       bmw_small_lastBlock\(&ctx, msg, length_b\);) s
2859 518.333 70 M
2860 (*       bmw256_ctx2hash\(dest, &ctx\);) s
2861 518.333 62 M
2862 (* }) s
2863 518.333 54 M
2864 (*) s
2865 518.333 46 M
2866 (* param dest:     r24:r25) s
2867 518.333 38 M
2868 (* param msg:      r22:r23) s
2869 518.333 30 M
2870 (* param length_b: r18:r21) s
2871 518.333 22 M
2872 (*/) s
2873 518.333 14 M
2874 (ctx0 =   2) s
2875 518.333 6 M
2876 (ctx1 =   3) s
2877 _R
2878 S
2879 %%Page: (7) 7
2880 %%BeginPageSetup
2881 _S
2882 90 rotate
2883 36 -577 translate
2884 /pagenum 7 def
2885 /fname (bmw_small-tinyasm.S) def
2886 /fdir () def
2887 /ftail (bmw_small-tinyasm.S) def
2888 % User defined strings:
2889 /fmodstr (Mo Apr 05 09:57:29 2010) def
2890 /pagenumstr (7) def
2891 /user_header_p false def
2892 /user_footer_p false def
2893 %%EndPageSetup
2894 column_lines
2895 column_borders
2896 do_header
2897 5 534 M
2898 (msg0 =   4) s
2899 5 526 M
2900 (msg1 =   5) s
2901 5 518 M
2902 (len0 =   6) s
2903 5 510 M
2904 (len1 =   7) s
2905 5 502 M
2906 (len2 =   8) s
2907 5 494 M
2908 (len3 =   9) s
2909 5 486 M
2910 (dst0 =  10) s
2911 5 478 M
2912 (dst1 =  11) s
2913 5 470 M
2914 (.global bmw256) s
2915 5 462 M
2916 (bmw256:) s
2917 5 454 M
2918 (        push r16) s
2919 5 446 M
2920 (        ldi r16, 1) s
2921 5 438 M
2922 (        rjmp bmw_small_all) s
2923 5 422 M
2924 (/*********************************************************) s
2925 5 414 M
2926 (**********************) s
2927 5 406 M
2928 (* void bmw224\(void* dest, const void* msg, uint32_t length) s
2929 5 398 M
2930 (_b\){) s
2931 5 390 M
2932 (*       bmw_small_ctx_t ctx;) s
2933 5 382 M
2934 (*       bmw224_init\(&ctx\);) s
2935 5 374 M
2936 (*       while\(length_b>=BMW_SMALL_BLOCKSIZE\){) s
2937 5 366 M
2938 (*               bmw_small_nextBlock\(&ctx, msg\);) s
2939 5 358 M
2940 (*               length_b -= BMW_SMALL_BLOCKSIZE;) s
2941 5 350 M
2942 (*               msg = \(uint8_t*\)msg + BMW_SMALL_BLOCKSIZE_) s
2943 5 342 M
2944 (B;) s
2945 5 334 M
2946 (*       }) s
2947 5 326 M
2948 (*       bmw_small_lastBlock\(&ctx, msg, length_b\);) s
2949 5 318 M
2950 (*       bmw224_ctx2hash\(dest, &ctx\);) s
2951 5 310 M
2952 (* }) s
2953 5 302 M
2954 (*) s
2955 5 294 M
2956 (* param dest:     r24:r25) s
2957 5 286 M
2958 (* param msg:      r22:r23) s
2959 5 278 M
2960 (* param length_b: r18:r21) s
2961 5 270 M
2962 (*/) s
2963 5 262 M
2964 (ctx0 =   2) s
2965 5 254 M
2966 (ctx1 =   3) s
2967 5 246 M
2968 (msg0 =   4) s
2969 5 238 M
2970 (msg1 =   5) s
2971 5 230 M
2972 (len0 =   6) s
2973 5 222 M
2974 (len1 =   7) s
2975 5 214 M
2976 (len2 =   8) s
2977 5 206 M
2978 (len3 =   9) s
2979 5 198 M
2980 (dst0 =  10) s
2981 5 190 M
2982 (dst1 =  11) s
2983 5 182 M
2984 (.global bmw224) s
2985 5 174 M
2986 (bmw224:) s
2987 5 166 M
2988 (        push r16) s
2989 5 158 M
2990 (        clr r16) s
2991 5 142 M
2992 (bmw_small_all:) s
2993 5 134 M
2994 (        push_range 2, 11) s
2995 5 126 M
2996 (        stack_alloc_large 64+4) s
2997 5 118 M
2998 (        adiw r30, 1) s
2999 5 110 M
3000 (        movw ctx0, r30) s
3001 5 102 M
3002 (        movw dst0, r24) s
3003 5 94 M
3004 (        movw msg0, r22) s
3005 5 86 M
3006 (        movw len0, r18) s
3007 5 78 M
3008 (        movw len2, r20) s
3009 5 70 M
3010 (        movw r24, ctx0) s
3011 5 62 M
3012 (        ldi r30, pm_lo8\(init_lut\)) s
3013 5 54 M
3014 (        ldi r31, pm_hi8\(init_lut\)) s
3015 5 46 M
3016 (        add r30, r16) s
3017 5 38 M
3018 (        adc r31, r1) s
3019 5 30 M
3020 (        icall) s
3021 5 22 M
3022 (20:) s
3023 5 14 M
3024 (        mov r18, len2) s
3025 5 6 M
3026 (        or  r18, len3) s
3027 261.667 534 M
3028 (        breq 50f) s
3029 261.667 526 M
3030 (        movw r24, ctx0) s
3031 261.667 518 M
3032 (        movw r22, msg0) s
3033 261.667 510 M
3034 (        rcall bmw_small_nextBlock) s
3035 261.667 502 M
3036 (        ldi r20, 2) s
3037 261.667 494 M
3038 (        sub len1, r20) s
3039 261.667 486 M
3040 (        sbc len2, r1) s
3041 261.667 478 M
3042 (        sbc len3, r1) s
3043 261.667 470 M
3044 (        ldi r20, 64) s
3045 261.667 462 M
3046 (        add msg0, r20) s
3047 261.667 454 M
3048 (        adc msg1, r1) s
3049 261.667 446 M
3050 (        rjmp 20b) s
3051 261.667 438 M
3052 (50:) s
3053 261.667 430 M
3054 (        movw r24, ctx0) s
3055 261.667 422 M
3056 (        movw r22, msg0) s
3057 261.667 414 M
3058 (        movw r20, len0) s
3059 261.667 406 M
3060 (        rcall bmw_small_lastBlock) s
3061 261.667 398 M
3062 (        movw r24, dst0) s
3063 261.667 390 M
3064 (        movw r22, ctx0) s
3065 261.667 382 M
3066 (        ldi r30, pm_lo8\(c2h_lut\)) s
3067 261.667 374 M
3068 (        ldi r31, pm_hi8\(c2h_lut\)) s
3069 261.667 366 M
3070 (        add r30, r16) s
3071 261.667 358 M
3072 (        adc r31, r1) s
3073 261.667 350 M
3074 (        icall) s
3075 261.667 342 M
3076 (        stack_free_large 64+4) s
3077 261.667 334 M
3078 (        pop_range 2, 11) s
3079 261.667 326 M
3080 (        pop r16) s
3081 261.667 318 M
3082 (        ret) s
3083 261.667 302 M
3084 (init_lut:) s
3085 261.667 294 M
3086 (        rjmp bmw224_init) s
3087 261.667 286 M
3088 (        rjmp bmw256_init) s
3089 261.667 278 M
3090 (c2h_lut:) s
3091 261.667 270 M
3092 (        rjmp bmw224_ctx2hash) s
3093 261.667 262 M
3094 (        rjmp bmw256_ctx2hash) s
3095 261.667 246 M
3096 (/*********************************************************) s
3097 261.667 238 M
3098 (**********************) s
3099 261.667 230 M
3100 (* void bmw224_init\(bmw224_ctx_t* ctx\){) s
3101 261.667 222 M
3102 (*       uint8_t i;) s
3103 261.667 214 M
3104 (*       ctx->h[0] = 0x00010203;) s
3105 261.667 206 M
3106 (*       for\(i=1; i<16; ++i\){) s
3107 261.667 198 M
3108 (*               ctx->h[i] = ctx->h[i-1]+ 0x04040404;) s
3109 261.667 190 M
3110 (*       }) s
3111 261.667 182 M
3112 (*       ctx->counter=0;) s
3113 261.667 174 M
3114 (* }) s
3115 261.667 166 M
3116 (*) s
3117 261.667 158 M
3118 (* param ctx:  r24:r25) s
3119 261.667 150 M
3120 (*/) s
3121 261.667 142 M
3122 (.global bmw224_init) s
3123 261.667 134 M
3124 (bmw224_init:) s
3125 261.667 126 M
3126 (        movw r26, r24) s
3127 261.667 118 M
3128 (        ldi r22, 0x03) s
3129 261.667 110 M
3130 (        ldi r23, 0x02) s
3131 261.667 102 M
3132 (        ldi r24, 0x01) s
3133 261.667 94 M
3134 (        ldi r25, 0x00) s
3135 261.667 86 M
3136 (bmw_small_init:) s
3137 261.667 78 M
3138 (        st X+, r22) s
3139 261.667 70 M
3140 (        st X+, r23) s
3141 261.667 62 M
3142 (        st X+, r24) s
3143 261.667 54 M
3144 (        st X+, r25) s
3145 261.667 46 M
3146 (        ldi r18, 16-1) s
3147 261.667 38 M
3148 (        ldi r20, 0x04) s
3149 261.667 30 M
3150 (1:) s
3151 261.667 22 M
3152 (        add r22, r20) s
3153 261.667 14 M
3154 (        adc r23, r20) s
3155 261.667 6 M
3156 (        adc r24, r20) s
3157 518.333 534 M
3158 (        adc r25, r20) s
3159 518.333 526 M
3160 (        st X+, r22) s
3161 518.333 518 M
3162 (        st X+, r23) s
3163 518.333 510 M
3164 (        st X+, r24) s
3165 518.333 502 M
3166 (        st X+, r25) s
3167 518.333 494 M
3168 (        dec r18) s
3169 518.333 486 M
3170 (        brne 1b) s
3171 518.333 478 M
3172 (        st X+, r1) s
3173 518.333 470 M
3174 (        st X+, r1) s
3175 518.333 462 M
3176 (        st X+, r1) s
3177 518.333 454 M
3178 (        st X+, r1) s
3179 518.333 446 M
3180 (        ret) s
3181 518.333 430 M
3182 (.global bmw256_init) s
3183 518.333 422 M
3184 (bmw256_init:) s
3185 518.333 414 M
3186 (        movw r26, r24) s
3187 518.333 406 M
3188 (        ldi r22, 0x43) s
3189 518.333 398 M
3190 (        ldi r23, 0x42) s
3191 518.333 390 M
3192 (        ldi r24, 0x41) s
3193 518.333 382 M
3194 (        ldi r25, 0x40) s
3195 518.333 374 M
3196 (        rjmp bmw_small_init) s
3197 518.333 350 M
3198 (/*********************************************************) s
3199 518.333 342 M
3200 (*********************/) s
3201 518.333 326 M
3202 (#if DEBUG) s
3203 518.333 310 M
3204 (printQ:) s
3205 518.333 302 M
3206 (        push_range 20, 25) s
3207 518.333 294 M
3208 (        ldi r16, 4) s
3209 518.333 286 M
3210 (        mov r9, r16) s
3211 518.333 278 M
3212 (        movw r16, r24) s
3213 518.333 270 M
3214 (        ldi r24, lo8\(qdbg_str\)) s
3215 518.333 262 M
3216 (        ldi r25, hi8\(qdbg_str\)) s
3217 518.333 254 M
3218 (        call cli_putstr_P) s
3219 518.333 246 M
3220 (        clr r8) s
3221 518.333 238 M
3222 (10:     ldi r24, lo8\(qdbg_str1\)) s
3223 518.333 230 M
3224 (        ldi r25, hi8\(qdbg_str1\)) s
3225 518.333 222 M
3226 (        call cli_putstr_P) s
3227 518.333 214 M
3228 (        mov r24, r8) s
3229 518.333 206 M
3230 (        call cli_hexdump_byte) s
3231 518.333 198 M
3232 (        ldi r24, lo8\(qdbg_str2\)) s
3233 518.333 190 M
3234 (        ldi r25, hi8\(qdbg_str2\)) s
3235 518.333 182 M
3236 (        call cli_putstr_P) s
3237 518.333 174 M
3238 (        movw r24, r16) s
3239 518.333 166 M
3240 (        clr r23) s
3241 518.333 158 M
3242 (        ldi r22, 4) s
3243 518.333 150 M
3244 (        call cli_hexdump_rev) s
3245 518.333 142 M
3246 (        add r16, r9) s
3247 518.333 134 M
3248 (        adc r17, r1) s
3249 518.333 126 M
3250 (        inc r8) s
3251 518.333 118 M
3252 (        sbrs r8, 5) s
3253 518.333 110 M
3254 (        rjmp 10b) s
3255 518.333 102 M
3256 (        pop_range 20, 25) s
3257 518.333 94 M
3258 (        ret) s
3259 518.333 86 M
3260 (qdbg_str:  .asciz "\\r\\nDBG Q: ") s
3261 518.333 78 M
3262 (qdbg_str1: .asciz "\\r\\n Q[") s
3263 518.333 70 M
3264 (qdbg_str2: .asciz "] =  ") s
3265 518.333 46 M
3266 (printX:) s
3267 518.333 38 M
3268 (        push_range 6, 9) s
3269 518.333 30 M
3270 (        push_range 16, 27) s
3271 518.333 22 M
3272 (        push_range 30, 31) s
3273 518.333 14 M
3274 (        ldi r16, 4) s
3275 518.333 6 M
3276 (        mov r6, r22) s
3277 _R
3278 S
3279 %%Page: (8) 8
3280 %%BeginPageSetup
3281 _S
3282 90 rotate
3283 36 -577 translate
3284 /pagenum 8 def
3285 /fname (bmw_small-tinyasm.S) def
3286 /fdir () def
3287 /ftail (bmw_small-tinyasm.S) def
3288 % User defined strings:
3289 /fmodstr (Mo Apr 05 09:57:29 2010) def
3290 /pagenumstr (8) def
3291 /user_header_p false def
3292 /user_footer_p false def
3293 %%EndPageSetup
3294 column_lines
3295 column_borders
3296 do_header
3297 5 534 M
3298 (        mov r9, r16) s
3299 5 526 M
3300 (        movw r16, r24) s
3301 5 518 M
3302 (        ldi r24, lo8\(Xdbg_str\)) s
3303 5 510 M
3304 (        ldi r25, hi8\(Xdbg_str\)) s
3305 5 502 M
3306 (        call cli_putstr_P) s
3307 5 494 M
3308 (        mov r24, r6) s
3309 5 486 M
3310 (        call cli_putc) s
3311 5 478 M
3312 (        ldi r24, ':') s
3313 5 470 M
3314 (        call cli_putc) s
3315 5 462 M
3316 (        clr r8) s
3317 5 454 M
3318 (10:     ldi r24, lo8\(Xdbg_str1\)) s
3319 5 446 M
3320 (        ldi r25, hi8\(Xdbg_str1\)) s
3321 5 438 M
3322 (        call cli_putstr_P) s
3323 5 430 M
3324 (        mov r24, r6) s
3325 5 422 M
3326 (        call cli_putc) s
3327 5 414 M
3328 (        ldi r24, '[') s
3329 5 406 M
3330 (        call cli_putc) s
3331 5 398 M
3332 (        mov r24, r8) s
3333 5 390 M
3334 (        call cli_hexdump_byte) s
3335 5 382 M
3336 (        ldi r24, lo8\(Xdbg_str2\)) s
3337 5 374 M
3338 (        ldi r25, hi8\(Xdbg_str2\)) s
3339 5 366 M
3340 (        call cli_putstr_P) s
3341 5 358 M
3342 (        movw r24, r16) s
3343 5 350 M
3344 (        clr r23) s
3345 5 342 M
3346 (        ldi r22, 4) s
3347 5 334 M
3348 (        call cli_hexdump_rev) s
3349 5 326 M
3350 (        add r16, r9) s
3351 5 318 M
3352 (        adc r17, r1) s
3353 5 310 M
3354 (        inc r8) s
3355 5 302 M
3356 (        sbrs r8, 4) s
3357 5 294 M
3358 (        rjmp 10b) s
3359 5 286 M
3360 (        pop_range 30, 31) s
3361 5 278 M
3362 (        pop_range 16, 27) s
3363 5 270 M
3364 (        pop_range 6, 9) s
3365 5 262 M
3366 (        ret) s
3367 5 254 M
3368 (Xdbg_str:  .asciz "\\r\\nDBG ") s
3369 5 246 M
3370 (Xdbg_str1: .asciz "\\r\\n ") s
3371 5 238 M
3372 (Xdbg_str2: .asciz "] = ") s
3373 5 222 M
3374 (print32:) s
3375 5 214 M
3376 (        push_range 6, 9) s
3377 5 206 M
3378 (        push_range 16, 27) s
3379 5 198 M
3380 (        push_range 30, 31) s
3381 5 190 M
3382 (        movw r6, r22) s
3383 5 182 M
3384 (        movw r8, r24) s
3385 5 174 M
3386 (        ldi r24, lo8\(Xdbg_str\)) s
3387 5 166 M
3388 (        ldi r25, hi8\(Xdbg_str\)) s
3389 5 158 M
3390 (        call cli_putstr_P) s
3391 5 150 M
3392 (        mov r24, r9) s
3393 5 142 M
3394 (        call cli_hexdump_byte) s
3395 5 134 M
3396 (        mov r24, r8) s
3397 5 126 M
3398 (        call cli_hexdump_byte) s
3399 5 118 M
3400 (        mov r24, r7) s
3401 5 110 M
3402 (        call cli_hexdump_byte) s
3403 5 102 M
3404 (        mov r24, r6) s
3405 5 94 M
3406 (        call cli_hexdump_byte) s
3407 5 86 M
3408 (        pop_range 30, 31) s
3409 5 78 M
3410 (        pop_range 16, 27) s
3411 5 70 M
3412 (        pop_range 6, 9) s
3413 5 62 M
3414 (        ret) s
3415 5 38 M
3416 (print_acc:) s
3417 5 30 M
3418 (        push_range 16, 27) s
3419 5 22 M
3420 (        push_range 30, 31) s
3421 5 14 M
3422 (        ldi r24, lo8\(Xdbg_str\)) s
3423 5 6 M
3424 (        ldi r25, hi8\(Xdbg_str\)) s
3425 261.667 534 M
3426 (        call cli_putstr_P) s
3427 261.667 526 M
3428 (        mov r24, r9) s
3429 261.667 518 M
3430 (        call cli_hexdump_byte) s
3431 261.667 510 M
3432 (        mov r24, r8) s
3433 261.667 502 M
3434 (        call cli_hexdump_byte) s
3435 261.667 494 M
3436 (        mov r24, r15) s
3437 261.667 486 M
3438 (        call cli_hexdump_byte) s
3439 261.667 478 M
3440 (        mov r24, r14) s
3441 261.667 470 M
3442 (        call cli_hexdump_byte) s
3443 261.667 462 M
3444 (        pop_range 30, 31) s
3445 261.667 454 M
3446 (        pop_range 16, 27) s
3447 261.667 446 M
3448 (        ret) s
3449 261.667 430 M
3450 (#endif) s
3451 _R
3452 S
3453 %%Trailer
3454 %%Pages: 8
3455 %%DocumentNeededResources: font Courier-Bold Courier 
3456 %%EOF