add assembler
getting the layers better
This commit is contained in:
parent
05669065ca
commit
2d83473d74
@ -26,6 +26,7 @@ require "parfait"
|
|||||||
require_relative "risc/parfait_adapter"
|
require_relative "risc/parfait_adapter"
|
||||||
require_relative "risc/machine"
|
require_relative "risc/machine"
|
||||||
require_relative "risc/method_compiler"
|
require_relative "risc/method_compiler"
|
||||||
|
require_relative "risc/assembler"
|
||||||
|
|
||||||
class Fixnum
|
class Fixnum
|
||||||
def fits_u8?
|
def fits_u8?
|
||||||
|
11
lib/risc/assembler.rb
Normal file
11
lib/risc/assembler.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module Risc
|
||||||
|
class Assembler
|
||||||
|
attr_reader :method , :instructions
|
||||||
|
def initialize( method , instructions)
|
||||||
|
@method = method
|
||||||
|
@instructions = instructions
|
||||||
|
total = instructions.total_byte_length / 4 + 1
|
||||||
|
method.binary.extend_to( total )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user