2018-07-01 11:53:18 +03:00
|
|
|
module Risc
|
|
|
|
class Assembler
|
2018-07-30 10:23:42 +03:00
|
|
|
attr_reader :callable , :instructions
|
2018-07-03 10:12:22 +03:00
|
|
|
|
2018-07-30 10:23:42 +03:00
|
|
|
def initialize( callable , instructions)
|
|
|
|
@callable = callable
|
2018-07-01 11:53:18 +03:00
|
|
|
@instructions = instructions
|
|
|
|
total = instructions.total_byte_length / 4 + 1
|
2018-07-30 10:23:42 +03:00
|
|
|
callable.binary.extend_to( total )
|
2018-07-01 11:53:18 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|