OpenCores
URL https://opencores.org/ocsvn/diogenes/diogenes/trunk

Subversion Repositories diogenes

[/] [diogenes/] [tags/] [initial/] [diogenes/] [examples/] [dec_eratost.asm] - Blame information for rev 236

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 225 fellnhofer
 
2
 
3
ldi     l7, 0x03
4
lsi     l7, 0xe7
5
mov     l5, l7
6
stio    l5, [l5]
7
ldi     l4, 0
8
ldi     l0, 0
9
ldi     l1, 1
10
1:
11
  st    l0, [l4]
12
  adi   l4, 1
13
  brnz  l5, :1
14
  adi   l5, -1
15
  ldi   l4, 2
16
  mov   l5, l7
17
2:
18
  mov   l2, l4
19
3:
20
  add   l2, l2, l4
21
  cmpl  l6, l2, l5
22
  brz   l6, :4
23
  nop
24
  brnz  l6, :3
25
  st    l1, [l2]
26
4:
27
  adi   l4, 1
28
  nop
29
  cmpl  l3, l5, l4
30
  brnz  l3, :10
31
  ld    l3, [l4]
32
  nop
33
  brnz  l3, :4
34
  nop
35
  brz   l3, :2
36
  nop
37
10:
38
  ldi   l3, 1
39
@  stio  l3, [l3]
40
11:
41
  adi   l3, 1
42
  cmpl  l4, l3, l7
43
  brz   l4, :99
44
  ld    l5, [l3]
45
  nop
46
  brnz  l5, :11
47
  nop
48
  nop
49
  ldi   h4, 0x80
50
@  lsi   h4, 0
51
  lsi   h4, 0
52
@  lsi   h4, 0
53
  ldi   h1, 0
54
  LDL   h5, :40
55
  call  h6, 
56
  nop
57
  stio  l3, [l0]
58
  lsi   h4, 0
59
32:
60
  cmpl  h0, h1, h4
61
  brnz  h0, :32
62
  adi   h1, 1
63
  brz   h0, :11
64
  nop
65
99:
66
  brnz  l1, :99
67
  nop
68
  nop
69
  nop
70
  nop
71
  nop
72
  nop
73
40:
74
  ldi h7, 0x3f
75
  lsi h7, 0xfe
76
 
77
  st  l4, [h7]
78
  adi h7, -1
79
  st  l5, [h7]
80
  adi h7, -1
81
  st  h1, [h7]
82
  adi h7, -1
83
  st  h0, [h7]
84
  adi h7, -1
85
  st  l0, [h7]
86
  adi h7, -1
87
 
88
 
89
ldi l4, 0xd1
90
lsi l4, 0x26
91
mov l5, l3
92
 
93
 
94
ldi h1, 100
95
pre_loop:
96
ldi h0, 0x63
97
add l5,l5,h1
98
count_loop:
99
sub l5,l5,h1
100
cmpl l0, l5, h1
101
brz l0, :count_loop
102
adi h0, 1
103
stio h0, [l4]
104
adi l4, 1
105
ldi l0, 10
106
xor l0,l0,h1
107
brnz l0, :pre_loop
108
ldi h1, 10
109
ldi h0, 0x64
110
add h0, h0, l5
111
stio h0, [l4]
112
 
113
pop:
114
  adi h7, 1
115
  ld  l0, [h7]
116
  adi h7, 1
117
  ld  h0, [h7]
118
  adi h7, 1
119
  ld  h1, [h7]
120
  adi h7, 1
121
  ld  l5, [h7]
122
  adi h7, 1
123
  ld  l4, [h7]
124
 
125
  jump 
126
  nop
127
  stop
128
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.