generalize assemblers to use callables
not just methods, they are almost the same anyway
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user