most of the length and assembly stuff fixed

This commit is contained in:
Torsten Ruger
2015-10-25 10:54:19 +02:00
parent 405a6935d4
commit 471329917b
6 changed files with 45 additions and 25 deletions

View File

@ -32,14 +32,21 @@ module Register
ret
end
def byte_length
0
def assemble io
end
def assemble_all io , labels = []
return if labels.include?(self)
labels << self
self.next.assemble_all(io,labels)
end
def total_byte_length labels = []
return 0 if labels.include?(self)
labels << self
self.next.length(labels)
ret = self.next.total_byte_length(labels)
#puts "#{self.class.name} return #{ret}"
ret
end
# labels have the same position as their next