This commit is contained in:
Sven Riwoldt
2024-04-01 20:30:24 +02:00
parent fd333f3514
commit c7bc862c6f
6804 changed files with 1065135 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
require_relative "Writer.rb"
class Assembler
def initialize(asm_file_path)
@asm_file_path = asm_file_path
@hack_file_path = asm_file_path.gsub(".asm", ".hack")
@binary_code_writer = Writer.new(@asm_file_path, @hack_file_path)
end
def compile_asm
@binary_code_writer.write
end
end
if __FILE__ == $0
asm = Assembler.new(ARGV[0])
asm.compile_asm
end