8
&function_begin($name,"");
19
&xor($c,$c); # clear carry
20
&mov($r,&wparam(0)); #
21
&mov($a,&wparam(1)); #
22
&mov($num,&wparam(2)); #
23
&mov($w,&wparam(3)); #
25
&and($num,0xfffffff8); # num / 8
26
&jz(&label("mw_finish"));
28
&set_label("mw_loop",0);
29
for ($i=0; $i<32; $i+=4)
33
&mov("eax",&DWP($i,$a,"",0)); # *a
35
&add("eax",$c); # L(t)+=c
38
&adc("edx",0); # H(t)+=carry
39
&mov(&DWP($i,$r,"",0),"eax"); # *r= L(t);
41
&mov($c,"edx"); # c= H(t);
48
&jz(&label("mw_finish"));
49
&jmp(&label("mw_loop"));
51
&set_label("mw_finish",0);
52
&mov($num,&wparam(2)); # get num
54
&jnz(&label("mw_finish2"));
55
&jmp(&label("mw_end"));
57
&set_label("mw_finish2",1);
58
for ($i=0; $i<7; $i++)
60
&comment("Tail Round $i");
61
&mov("eax",&DWP($i*4,$a,"",0));# *a
63
&add("eax",$c); # L(t)+=c
65
&adc("edx",0); # H(t)+=carry
66
&mov(&DWP($i*4,$r,"",0),"eax");# *r= L(t);
67
&mov($c,"edx"); # c= H(t);
68
&dec($num) if ($i != 7-1);
69
&jz(&label("mw_end")) if ($i != 7-1);
71
&set_label("mw_end",0);