1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-04-21 21:16:51 +00:00

updated presets, changed array syntax, ice40 fpga examples

This commit is contained in:
Steven Hugg
2018-10-05 14:02:46 -04:00
parent c687006684
commit 706a24c96a
38 changed files with 4817 additions and 104 deletions
+21
View File
@@ -0,0 +1,21 @@
var fs = require('fs');
var asm = require('../../gen/worker/assembler.js');
var stdinBuffer = fs.readFileSync(0);
var code = stdinBuffer.toString();
var asm = new asm.Assembler();
asm.loadJSON = function(filename) {
return JSON.parse(fs.readFileSync(filename, 'utf8'));
};
asm.loadInclude = function(filename) {
filename = filename.substr(1, filename.length-2); // remove quotes
//return fs.readFileSync(filename, 'utf8');
};
asm.loadModule = function(top_module) {
//TODO
};
var out = asm.assembleFile(code);
//console.log(out);
out.output.forEach(function(x) {
console.log(x.toString(16));
});