xxxxxxxxxx
57
let memSize = 16;
let fillwith = ""
let ptr = 0x00;
//comands
let OPcode = [];
let Address = [];
let Register = [];
let regA = [];
let regB = [];
let data = [];
for (var i = 0; i < memSize; i++)
{
OPcode[i] = fillwith;
Address[i] = fillwith;
Register[i] = fillwith;
regA[i] = fillwith;
data[i] = fillwith;
}
function setup() {
createCanvas(400, 400);
console.log(th(0x00));
}
function logRegisters(){
console.log("regA: "+regA)
console.log("regB: "+regB)
}
//set code
//execute
function execute(){
}
//commands
function write(c, i=ptr){
let cs = c.split;
OPcode[i] = cs[0]
if (cs[1].toStrng()[1] == "x"){
}
}
//misc
function th(num, len=memSize/16+1){
let out = num.toString(16);
let leno = out.length;
let tmp = ""
for (let i = 0; leno < len;){
out = "0" + out;
}
return "0x" + out
}