add assembler

getting the layers better
This commit is contained in:
Torsten Ruger 2018-07-01 11:53:18 +03:00
parent 05669065ca
commit 2d83473d74
2 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,7 @@ require "parfait"
require_relative "risc/parfait_adapter"
require_relative "risc/machine"
require_relative "risc/method_compiler"
require_relative "risc/assembler"
class Fixnum
def fits_u8?

11
lib/risc/assembler.rb Normal file
View 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