1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-27 07:29:34 +00:00
SixtyPical/src/sixtypical/model.py
2015-10-16 23:12:52 +01:00

37 lines
779 B
Python

"""Data/storage model for SixtyPical."""
class LocationRef(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return 'LocationRef(%r)' % self.name
def __eq__(self, other):
return isinstance(other, LocationRef) and other.name == self.name
class ConstantRef(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return 'ConstantRef(%r)' % self.value
def __eq__(self, other):
return isinstance(other, ConstantRef) and other.value == self.value
# TODO type=byte
REG_A = LocationRef('a')
REG_X = LocationRef('x')
REG_Y = LocationRef('y')
# TODO type=bit
FLAG_Z = LocationRef('z')
FLAG_C = LocationRef('c')
FLAG_N = LocationRef('n')
FLAG_V = LocationRef('v')