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

@ -81,9 +81,19 @@ module Register
raise "Abstract called on #{self}"
end
def assemble_all io , labels = []
self.assemble(io)
self.next.assemble_all(io, labels) if self.next
end
def assemble io
raise "Abstract called on #{self}"
end
def total_byte_length labels = []
ret = self.byte_length
ret += self.next.total_byte_length(labels) if self.next
#puts "#{self.class.name} return #{ret}"
ret
end