let isalist = document.getElementById("isa_list"); let ISAPrepList = new Array(); function hasInstruction(ins) { for (let a = 0; a < ISAPrepList.length; a++) { if (ISAPrepList[a].Mnemonic.toLowerCase() === ins.Mnemonic.toLowerCase()) { return a; } } return false; } for (let a = 0; a < Instructions.length; a++) { if (hasInstruction(Instructions[a]) === false) { ISAPrepList.push({Mnemonic: Instructions[a].Mnemonic,LongName: Instructions[a].LongName,Varients: new Array(Instructions[a])}); } else { console.log(`${Instructions[a].Mnemonic} IS ALREADY THERE LETS ADD TO IT`); ISAPrepList[hasInstruction(Instructions[a])].Varients.push(Instructions[a]); } } let outHTML = ""; for (let a = 0; a < ISAPrepList.length; a++) { outHTML += `
Address Mode | Example | Bytecode | Words | Cycles | `; outHTML += `
${ISAPrepList[a].Varients[b].Type} | ${ISAPrepList[a].Mnemonic}${operandtext} | 0x${formatHex(ISAPrepList[a].Varients[b].Bytecode,4)} | ${ISAPrepList[a].Varients[b].Words} | ${ISAPrepList[a].Varients[b].Cycles} | `; outHTML += `