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