twlite / qbasic

QBasic compiler that runs on node.js

Home Page:https://npmjs.com/package/qbasic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QBasic.js

QBasic.js allows you to use qb.js inside node projects.

Example

CLI

$ npx qbasic --source=filePath.bas

index.js

const { compileFile } = require("qbasic");
const fs = require("fs");

const { bytecode } = compileFile("./demo.bas");
fs.writeFileSync("./bytecode.txt", bytecode);

demo.bas

CLS
PRINT "Hello from QBasic"
END

bytecode.txt

   ' L1 CLS
syscall CLS
   ' L2 PRINT "Hello from QBasic"
pushconst Hello from QBasic
syscall print
pushconst 

syscall print
   ' L3 END
end
ret
end

About

QBasic compiler that runs on node.js

https://npmjs.com/package/qbasic

License:GNU General Public License v3.0


Languages

Language:TypeScript 99.3%Language:JavaScript 0.7%