Last change
on this file since bc1afe0 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added Alcyon C reference output.
|
-
Property mode
set to
100644
|
File size:
737 bytes
|
Line | |
---|
1 | .data
|
---|
2 | L1:.dc.w $1
|
---|
3 | .dc.w $2
|
---|
4 | .dc.w $4
|
---|
5 | .dc.w $8
|
---|
6 | .dc.w $10
|
---|
7 | .dc.w $20
|
---|
8 | .dc.w $40
|
---|
9 | .dc.w $80
|
---|
10 | .dc.w $100
|
---|
11 | .dc.w $200
|
---|
12 | .dc.w $400
|
---|
13 | .dc.w $800
|
---|
14 | .dc.w $1000
|
---|
15 | .dc.w $2000
|
---|
16 | .dc.w $4000
|
---|
17 | .dc.w $8000
|
---|
18 | .text
|
---|
19 | .globl _bitrev
|
---|
20 | .text
|
---|
21 | _bitrev:
|
---|
22 | ~~bitrev:
|
---|
23 | ~bitsin=8
|
---|
24 | ~nbits=10
|
---|
25 | link R14,#-8
|
---|
26 | ~m=-2
|
---|
27 | ~n=-4
|
---|
28 | *line 30
|
---|
29 | clr -4(R14)
|
---|
30 | *line 32
|
---|
31 | clr -2(R14)
|
---|
32 | bra L5
|
---|
33 | L6:
|
---|
34 | *line 33
|
---|
35 | *line 34
|
---|
36 | move -2(R14),R8
|
---|
37 | add.l R8,R8
|
---|
38 | move.l #L1,R9
|
---|
39 | move 0(R8,R9.l),R0
|
---|
40 | and 8(R14),R0
|
---|
41 | beq L7
|
---|
42 | *line 34
|
---|
43 | move 10(R14),R8
|
---|
44 | sub #1,R8
|
---|
45 | sub -2(R14),R8
|
---|
46 | add.l R8,R8
|
---|
47 | add.l #L1,R8
|
---|
48 | move (R8),R0
|
---|
49 | or R0,-4(R14)
|
---|
50 | *line 35
|
---|
51 | L7:L4:
|
---|
52 | *line 32
|
---|
53 | add #1,-2(R14)
|
---|
54 | L5:
|
---|
55 | *line 32
|
---|
56 | move -2(R14),R0
|
---|
57 | cmp 10(R14),R0
|
---|
58 | blt L6
|
---|
59 | L3:
|
---|
60 | *line 36
|
---|
61 | move -4(R14),R0
|
---|
62 | bra L2
|
---|
63 | L2:unlk R14
|
---|
64 | rts
|
---|
65 | .data
|
---|
Note:
See
TracBrowser
for help on using the repository browser.