From a7cd9d4f8d83024402bacb39786e5e1a018a0a04 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Wed, 14 Nov 2018 23:45:56 +0200 Subject: Spasm can assemble programs on with the new instruction set (#47) * Use checkout as-is, commit as-is * Spasm can assemble programs based on the new instruction set --- spasm/src/asm/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'spasm/src/asm/main.cpp') diff --git a/spasm/src/asm/main.cpp b/spasm/src/asm/main.cpp index da8fcf6..2b33a12 100644 --- a/spasm/src/asm/main.cpp +++ b/spasm/src/asm/main.cpp @@ -4,12 +4,13 @@ int main(int argc, const char* argv[]) { - if (argc != 2) + if (argc != 3) return 1; SpasmImpl::ASM::Bytecode_Memory bytecode; - SpasmImpl::ASM::compile(std::cin, bytecode); + std::ifstream input(argv[1]); + SpasmImpl::ASM::compile(input, bytecode); - std::ofstream output(argv[1], std::ios_base::out | std::ios_base::binary); + std::ofstream output(argv[2], std::ios_base::out | std::ios_base::binary); // output.write ("SPASM", 5); auto& bc = bytecode.bytecode(); -- cgit v1.3.1-23-gd82d