1
# Copyright (C) 2011 David Manzanares <manxi.david@gmail.com>
2
#This file is part of PyEffect.
4
# PyEffect is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
9
# PyEffect is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with PyEffect. If not, see <http://www.gnu.org/licenses/>.
28
"""This is the One For One algorithm,
29
it allocates one block of memory for one var,
30
it is designed to be used for debugging PyEffect"""
32
sizeOf = {1: ".byte", 4:".long", 8:".quad"}
38
data.string = data.string + c.name + ":\n\t" + sizeOf[c.size] + "\t0\n"
41
if isNN(a) and a.up.mem == "static" and a.loc.asm == None:
43
a.loc.asm = "$" + a.up.name
47
if dated.count(a.up.name) == 0:
48
dated.append(a.up.name)
49
used = used + a.up.size
50
data.string = data.string + a.up.name + ":\n\t" + sizeOf[a.up.size] + "\t0\n"