generalize assemblers to use callables

not just methods,  they are almost the same anyway
This commit is contained in:
Torsten Ruger
2018-07-30 10:23:42 +03:00
parent 4055709529
commit 285a88b59f
7 changed files with 16 additions and 16 deletions

View File

@ -1,12 +1,12 @@
module Risc
class Assembler
attr_reader :method , :instructions
attr_reader :callable , :instructions
def initialize( method , instructions)
@method = method
def initialize( callable , instructions)
@callable = callable
@instructions = instructions
total = instructions.total_byte_length / 4 + 1
method.binary.extend_to( total )
callable.binary.extend_to( total )
end
end
end