2018-07-01 10:53:18 +02:00
|
|
|
module Risc
|
|
|
|
class Assembler
|
2018-07-01 13:11:29 +02:00
|
|
|
attr_reader :method , :instructions , :constants
|
|
|
|
def initialize( method , instructions, constants)
|
2018-07-01 10:53:18 +02:00
|
|
|
@method = method
|
|
|
|
@instructions = instructions
|
2018-07-01 13:11:29 +02:00
|
|
|
@constants = constants
|
2018-07-01 10:53:18 +02:00
|
|
|
total = instructions.total_byte_length / 4 + 1
|
|
|
|
method.binary.extend_to( total )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|