8SA1Sim/js/microcode_compiler.js
2021-04-10 11:46:57 -07:00

2388 lines
79 KiB
JavaScript

/*
const CONTROL_PCC = 0b00000000000000000000000000000001; // PC CLK UP
const CONTROL_PCI = 0b00000000000000000000000000000010; // PC Input Enable
const CONTROL_SPD = 0b00000000000000000000000000000100; // SP Count Down
const CONTROL_SPC = 0b00000000000000000000000000001000; // SP CLK (UP / DOWN)
const CONTROL_SPI = 0b00000000000000000000000000010000; // SP Input Enable
const CONTROL_RAIL = 0b00000000000000000000000000100000; // GPA LOW Input Enable
const CONTROL_RAIH = 0b00000000000000000000000001000000; // GPA HIGH Input Enable
const CONTROL_RBIL = 0b00000000000000000000000010000000; // GPB LOW Input Enable
const CONTROL_RBIH = 0b00000000000000000000000100000000; // GPB HIGH Input Enable
const CONTROL_RCIL = 0b00000000000000000000001000000000; // GPC LOW Input Enable
const CONTROL_RCIH = 0b00000000000000000000010000000000; // GPC HIGH Input Enable
const CONTROL_RDIL = 0b00000000000000000000100000000000; // GPD LOW Input Enable
const CONTROL_RDIH = 0b00000000000000000001000000000000; // GPD HIGH Input Enable
const CONTROL_RRI = 0b00000000000000000010000000000000; // LOW Ram Register Input Enable
const CONTROL_RHI = 0b00000000000000000100000000000000; // HIGH Ram Register Input Enable
const CONTROL_ALUM0 = 0b00000000000000001000000000000000; // ALU MUX 0
const CONTROL_ALUM1 = 0b00000000000000010000000000000000; // ALU MUX 1
const CONTROL_ALUI = 0b00000000000000100000000000000000; // ALU Invert (high side)
const CONTROL_ALUC = 0b00000000000001000000000000000000; // ALU Carry Input
const CONTROL_ALUSL = 0b00000000000010000000000000000000; // ALU Shift Left
const CONTROL_ALUSR = 0b00000000000100000000000000000000; // ALU Shift Right
const CONTROL_OEM0 = 0b00000000001000000000000000000000; // Output Enable MUX 0
const CONTROL_OEM1 = 0b00000000010000000000000000000000; // Output Enable MUX 1
const CONTROL_OEM2 = 0b00000000100000000000000000000000; // Output Enable MUX 2
const CONTROL_OEM3 = 0b00000001000000000000000000000000; // Output Enable MUX 3
const CONTROL_OEM4 = 0b00000010000000000000000000000000; // Output Enable MUX 4
const CONTROL_OEME = 0b00000100000000000000000000000000; // Output Enable MUX Enable
const CONTROL_RI = 0b00010000000000000000000000000000; // RAM Input Enable
const CONTROL_IRI = 0b00100000000000000000000000000000; // Instruction Register Input Enable
const CONTROL_MCL0 = 0b01000000000000000000000000000000; // Microcode Counter to 0
const CONTROL_MCL8 = 0b10000000000000000000000000000000; // Microcode Counter to 8
*/
/*
Free Instructions:
0x000
0x001
0x003
0x005
0x007
0x009
*/
let Instructions = new Array();
const InstructionTypes = {
SingleWord: {
Name: `Singe Word`,
toString() {
return this.Name;
}
},
RTS16: {
Name: `JSR 16 Return`,
toString() {
return this.Name;
}
},
RTS24: {
Name: `JSR 24 Return`,
toString() {
return this.Name;
}
},
Immediate8: {
Name: `8 bit Immediate`,
toString() {
return this.Name;
}
},
Immediate16: {
Name: `16 bit Immediate`,
toString() {
return this.Name;
}
},
Immediate24: {
Name: `24 bit Immediate`,
toString() {
return this.Name;
}
},
Indirect16: {
Name: `16 bit Indirect`,
toString() {
return this.Name;
}
},
Indirect24: {
Name: `24 bit Indirect`,
toString() {
return this.Name;
}
},
Absolute16: {
Name: `16 bit Absolute`,
toString() {
return this.Name;
}
},
Absolute24: {
Name: `24 bit Absolute`,
toString() {
return this.Name;
}
},
Register: {
Name: `Register`,
toString() {
return this.Name;
}
},
RegisterImmediate: {
Name: `Register Immediate`,
toString() {
return this.Name;
}
},
RegisterAbsolute: {
Name: `Register Absolute`,
toString() {
return this.Name;
}
},
RegisterIndirect: {
Name: `Register Indirect`,
toString() {
return this.Name;
}
}
};
function IsRegister(reg) {
reg = reg.toLowerCase().replace("%","").replace("[","").replace("]","");
switch (reg) {
case "a":
case "b":
case "c":
case "d":
case "pc":
case "sp":
case "ab":
case "ac":
case "ad":
case "ba":
case "bc":
case "bd":
case "ca":
case "cb":
case "cd":
case "da":
case "db":
case "dc":
return true;
break;
}
return false;
}
function ValidateInstruction(line) {
let linearr = line.split(" ");
let label = false;
let type = false;
if (linearr[0] !== "") label = linearr[0];
if (linearr.length > 2) {
let operands = linearr[2].split(",");
if (operands.length > 0) {
if (operands.length === 1) {
if (operands[0].substring(0,1) === '$') type = InstructionTypes.Immediate;
if (operands[0].substring(0,1) === '[') type = InstructionTypes.Indirect;
if (IsRegister(operands[0])) type = InstructionTypes.Register;
if (type === false) type = InstructionTypes.Absolute;
} else {
// more then one operand
}
}
}
console.log(linearr[1]);
let foundinstruction = FindInstructon({Instruction: linearr[1]}, type);
return foundinstruction;
}
function FindInstructon(ins,type = false) {
for (let a = 0; a < Instructions.length; a++) {
if (Instructions[a].Mnemonic.toLowerCase() === ins.Instruction.toLowerCase()) {
if (type) {
if (Instructions[a].Type === type) return Instructions[a];
} else {
return Instructions[a];
}
}
}
return false;
}
function GenerateMicrocode(mcarray,cpu) {
for (let a = 0; a < mcarray.length; a++) {
for (let c = 0; c < 3; c++) {
let offset = 0;
if (c === 1) offset = 0b1000000000000000;
if (c === 2) offset = 0b0100000000000000;
for (let b = 0; b < 16; b++) {
let bytecode = mcarray[a].Bytecode;
let mca = mcarray[a].Bytecode << 4;
mca |= b;
let mcv = mcarray[a].Microcode[b];
if (mcarray[a].UsesZero && c === 1) mcv = mcarray[a].MicrocodeZero[b];
if (mcarray[a].UsesCarry && c === 2) mcv = mcarray[a].MicrocodeCarry[b];
cpu.MCRAM[offset + mca] = mcv;
//console.log(`[${bytecode.toString(16)}] ${mca.toString(16)}: ${mcv.toString(2)}`);
}
}
}
}
class Microcode_Instruction {
constructor() {
this.Bytecode = 0x000; // MAX IS 0x3ff
this.Mnemonic = "NOP";
this.LongName = "";
this.Aliases = new Array();
this.Microcode = new Array(16);
this.Operands = new Array();
this.UsesCarry = false;
this.UsesZero = false;
this.Words = 1;
this.Cycles = 2;
this.Type = InstructionTypes.SingleWord;
this.Microcode[0] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[1] = CONTROL_OUT_RO | CONTROL_IRI | CONTROL_PCC;
for (let a = 2; a < 16; a++) {
this.Microcode[a] = CONTROL_MCL0;
}
}
}
//--------------------------- General Purpose Registers LDx Immediates ---------------------------
class IS_LDA_imm8 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x002;
this.Mnemonic = "LDA";
this.LongName = "LOAD Register A";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate8;
this.Operands = new Array({Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
}
}
is_LDA_i = new IS_LDA_imm8;
Instructions.push(is_LDA_i);
class IS_LDB_imm8 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x004;
this.Mnemonic = "LDB";
this.LongName = "LOAD Register B";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate8;
this.Operands = new Array({Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
}
}
is_LDB_i = new IS_LDB_imm8;
Instructions.push(is_LDB_i);
class IS_LDC_imm8 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x006;
this.Mnemonic = "LDC";
this.LongName = "LOAD Register C";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate8;
this.Operands = new Array({Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC;
}
}
is_LDC_i = new IS_LDC_imm8;
Instructions.push(is_LDC_i);
class IS_LDD_imm8 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x008;
this.Mnemonic = "LDD";
this.LongName = "LOAD Register D";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate8;
this.Operands = new Array({Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC;
}
}
is_LDD_i = new IS_LDD_imm8;
Instructions.push(is_LDD_i);
class IS_LDAB_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00A;
this.Mnemonic = "LDAB";
this.LongName = "LOAD Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH | CONTROL_PCC;
}
}
is_LDAB_i = new IS_LDAB_imm16;
Instructions.push(is_LDAB_i);
class IS_LDAC_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00B;
this.Mnemonic = "LDAC";
this.LongName = "LOAD Register A and C";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RCIH | CONTROL_PCC;
}
}
is_LDAC_i = new IS_LDAC_imm16;
Instructions.push(is_LDAC_i);
class IS_LDAD_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00C;
this.Mnemonic = "LDAD";
this.LongName = "LOAD Register A and D";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RDIH | CONTROL_PCC;
}
}
is_LDAD_i = new IS_LDAD_imm16;
Instructions.push(is_LDAD_i);
class IS_LDBA_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00D;
this.Mnemonic = "LDBA";
this.LongName = "LOAD Register B and A";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_RAIH | CONTROL_PCC;
}
}
is_LDBA_i = new IS_LDBA_imm16;
Instructions.push(is_LDBA_i);
class IS_LDBC_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00E;
this.Mnemonic = "LDBC";
this.LongName = "LOAD Register B and C";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_RCIH | CONTROL_PCC;
}
}
is_LDBC_i = new IS_LDBC_imm16;
Instructions.push(is_LDBC_i);
class IS_LDBD_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x00F;
this.Mnemonic = "LDBD";
this.LongName = "LOAD Register B and D";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_RDIH | CONTROL_PCC;
}
}
is_LDBD_i = new IS_LDBD_imm16;
Instructions.push(is_LDBD_i);
class IS_LDCA_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x010;
this.Mnemonic = "LDCA";
this.LongName = "LOAD Register C and A";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_RAIH | CONTROL_PCC;
}
}
is_LDCA_i = new IS_LDCA_imm16;
Instructions.push(is_LDCA_i);
class IS_LDCB_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x011;
this.Mnemonic = "LDCB";
this.LongName = "LOAD Register C and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_RBIH | CONTROL_PCC;
}
}
is_LDCB_i = new IS_LDCB_imm16;
Instructions.push(is_LDCB_i);
class IS_LDCD_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x012;
this.Mnemonic = "LDCD";
this.LongName = "LOAD Register C and D";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_RDIH | CONTROL_PCC;
}
}
is_LDCD_i = new IS_LDCD_imm16;
Instructions.push(is_LDCD_i);
class IS_LDDA_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x013;
this.Mnemonic = "LDDA";
this.LongName = "LOAD Register D and A";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_RAIH | CONTROL_PCC;
}
}
is_LDDA_i = new IS_LDDA_imm16;
Instructions.push(is_LDDA_i);
class IS_LDDB_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x014;
this.Mnemonic = "LDDB";
this.LongName = "LOAD Register D and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_RBIH | CONTROL_PCC;
}
}
is_LDDB_i = new IS_LDDB_imm16;
Instructions.push(is_LDDB_i);
class IS_LDDC_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x015;
this.Mnemonic = "LDDC";
this.LongName = "LOAD Register D and C";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_RCIH | CONTROL_PCC;
}
}
is_LDDC_i = new IS_LDDC_imm16;
Instructions.push(is_LDDC_i);
//--------------------------- General Purpose Registers LDx Absolutes ---------------------------
class IS_LDA_abs16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x042;
this.Mnemonic = "LDA";
this.LongName = "LOAD Register A";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute16;
this.Operands = new Array({Operand: "", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
}
}
is_LDA_a = new IS_LDA_abs16;
Instructions.push(is_LDA_a);
class IS_LDB_abs16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x044;
this.Mnemonic = "LDB";
this.LongName = "LOAD Register B";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute16;
this.Operands = new Array({Operand: "", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
}
}
is_LDB_a = new IS_LDB_abs16;
Instructions.push(is_LDB_a);
class IS_LDC_abs16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x046;
this.Mnemonic = "LDC";
this.LongName = "LOAD Register C";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute16;
this.Operands = new Array({Operand: "", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC;
}
}
is_LDC_a = new IS_LDC_abs16;
Instructions.push(is_LDC_a);
class IS_LDD_abs16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x048;
this.Mnemonic = "LDD";
this.LongName = "LOAD Register D";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute16;
this.Operands = new Array({Operand: "", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC;
}
}
is_LDD_a = new IS_LDD_abs16;
Instructions.push(is_LDD_a);
class IS_LDA_abs24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x062;
this.Mnemonic = "LDA";
this.LongName = "LOAD Register A";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute24;
this.Operands = new Array({Operand: "", Bitwidth: 24});
this.Words = 3;
this.Cycles = 12;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
this.Microcode[10] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[11] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDA_a24 = new IS_LDA_abs24;
Instructions.push(is_LDA_a24);
class IS_LDB_abs24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x064;
this.Mnemonic = "LDB";
this.LongName = "LOAD Register B";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute24;
this.Operands = new Array({Operand: "", Bitwidth: 24});
this.Words = 3;
this.Cycles = 12;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
this.Microcode[10] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[11] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDB_a24 = new IS_LDB_abs24;
Instructions.push(is_LDB_a24);
class IS_LDC_abs24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x066;
this.Mnemonic = "LDC";
this.LongName = "LOAD Register C";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute24;
this.Operands = new Array({Operand: "", Bitwidth: 24});
this.Words = 3;
this.Cycles = 12;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC;
this.Microcode[10] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[11] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDC_a24 = new IS_LDC_abs24;
Instructions.push(is_LDC_a24);
class IS_LDD_abs24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x068;
this.Mnemonic = "LDD";
this.LongName = "LOAD Register D";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute24;
this.Operands = new Array({Operand: "", Bitwidth: 24});
this.Words = 3;
this.Cycles = 12;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC;
this.Microcode[10] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[11] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDD_a24 = new IS_LDD_abs24;
Instructions.push(is_LDD_a24);
//--------------------------- General Purpose Registers LDx Indirect ---------------------------
class IS_LDA_ind16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x082;
this.Mnemonic = "LDA";
this.LongName = "LOAD Register A";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect16;
this.Operands = new Array({Operand: "#", Bitwidth: 16});
this.Words = 2;
this.Cycles = 6;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
}
}
is_LDA_in = new IS_LDA_ind16;
Instructions.push(is_LDA_in);
class IS_LDB_ind16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x084;
this.Mnemonic = "LDB";
this.LongName = "LOAD Register B";
this.Aliases = new Array();
this.Words = 2;
this.Cycles = 6;
this.Type = InstructionTypes.Indirect16;
this.Operands = new Array({Operand: "#", Bitwidth: 16});
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
}
}
is_LDB_in = new IS_LDB_ind16;
Instructions.push(is_LDB_in);
class IS_LDC_ind16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x086;
this.Mnemonic = "LDC";
this.LongName = "LOAD Register C";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect16;
this.Operands = new Array({Operand: "#", Bitwidth: 16});
this.Words = 2;
this.Cycles = 6;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC;
}
}
is_LDC_in = new IS_LDC_ind16;
Instructions.push(is_LDC_in);
class IS_LDD_ind16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x088;
this.Mnemonic = "LDD";
this.LongName = "LOAD Register D";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect16;
this.Operands = new Array({Operand: "#", Bitwidth: 16});
this.Words = 2;
this.Cycles = 6;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC;
}
}
is_LDD_in = new IS_LDD_ind16;
Instructions.push(is_LDD_in);
class IS_LDA_ind24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x0C2;
this.Mnemonic = "LDA";
this.LongName = "LOAD Register A";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect24;
this.Operands = new Array({Operand: "#", Bitwidth: 24});
this.Words = 3;
this.Cycles = 13;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[10] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
this.Microcode[11] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[12] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDA_in24 = new IS_LDA_ind24;
Instructions.push(is_LDA_in24);
class IS_LDB_ind24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x0C4;
this.Mnemonic = "LDB";
this.LongName = "LOAD Register B";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect24;
this.Operands = new Array({Operand: "#", Bitwidth: 24});
this.Words = 3;
this.Cycles = 13;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[10] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
this.Microcode[11] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[12] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDB_in24 = new IS_LDB_ind24;
Instructions.push(is_LDB_in24);
class IS_LDC_ind24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x0C6;
this.Mnemonic = "LDC";
this.LongName = "LOAD Register C";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect24;
this.Operands = new Array({Operand: "#", Bitwidth: 24});
this.Words = 3;
this.Cycles = 13;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[10] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC;
this.Microcode[11] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[12] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDC_in24 = new IS_LDC_ind24;
Instructions.push(is_LDC_in24);
class IS_LDD_ind24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x0C8;
this.Mnemonic = "LDD";
this.LongName = "LOAD Register D";
this.Aliases = new Array();
this.Type = InstructionTypes.Indirect24;
this.Operands = new Array({Operand: "#", Bitwidth: 24});
this.Words = 3;
this.Cycles = 13;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_2O | CONTROL_RHI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[10] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC;
this.Microcode[11] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[12] = CONTROL_OUT_RO | CONTROL_RHI;
}
}
is_LDD_in24 = new IS_LDD_ind24;
Instructions.push(is_LDD_in24);
class IS_LDAB_GPCD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x020;
this.Mnemonic = "LDAB";
this.LongName = "LOAD Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "CD", Bitwidth: 16});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_CD | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH;
}
}
is_LDAB_GPCD = new IS_LDAB_GPCD;
Instructions.push(is_LDAB_GPCD);
class IS_LDAB_abs16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x04A;
this.Mnemonic = "LDAB";
this.LongName = "LOAD Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Absolute16;
this.Operands = new Array({Operand: "", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH | CONTROL_PCC;
}
}
is_LDAB_a = new IS_LDAB_abs16;
Instructions.push(is_LDAB_a);
class IS_LDSPP_imm8 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x01F;
this.Mnemonic = "LDSPP";
this.LongName = "LOAD Stack Pointer Page";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HS | CONTROL_PCC;
}
}
is_LDSPP_i = new IS_LDSPP_imm8;
Instructions.push(is_LDSPP_i);
class IS_STAL_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x102;
this.Mnemonic = "STAL";
this.LongName = "STORE Register A to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_AL | CONTROL_RI;
}
}
is_STAL_i = new IS_STAL_imm16;
Instructions.push(is_STAL_i);
class IS_STAH_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x103;
this.Mnemonic = "STAH";
this.LongName = "STORE Register A to HIGH Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_AH | CONTROL_RI;
}
}
is_STAH_i = new IS_STAH_imm16;
Instructions.push(is_STAH_i);
class IS_STBL_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x104;
this.Mnemonic = "STBL";
this.LongName = "STORE Register B to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_BL | CONTROL_RI;
}
}
is_STBL_i = new IS_STBL_imm16;
Instructions.push(is_STBL_i);
class IS_STBH_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x105;
this.Mnemonic = "STBH";
this.LongName = "STORE Register B to HIGH Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_BH | CONTROL_RI;
}
}
is_STBH_i = new IS_STBH_imm16;
Instructions.push(is_STBH_i);
class IS_STCL_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x106;
this.Mnemonic = "STCL";
this.LongName = "STORE Register C to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_CL | CONTROL_RI;
}
}
is_STCL_i = new IS_STCL_imm16;
Instructions.push(is_STCL_i);
class IS_STCH_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x107;
this.Mnemonic = "STCH";
this.LongName = "STORE Register C to HIGH Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_CH | CONTROL_RI;
}
}
is_STCH_i = new IS_STCH_imm16;
Instructions.push(is_STCH_i);
class IS_STDL_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x108;
this.Mnemonic = "STDL";
this.LongName = "STORE Register D to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_DL | CONTROL_RI;
}
}
is_STDL_i = new IS_STDL_imm16;
Instructions.push(is_STDL_i);
class IS_STDH_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x109;
this.Mnemonic = "STDH";
this.LongName = "STORE Register D to HIGH Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_DH | CONTROL_RI;
}
}
is_STDH_i = new IS_STDH_imm16;
Instructions.push(is_STDH_i);
class IS_STAB_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x10A;
this.Mnemonic = "STAB";
this.LongName = "STORE Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_AB | CONTROL_RI;
}
}
is_STAB_i = new IS_STAB_imm16;
Instructions.push(is_STAB_i);
class IS_STAB_sp extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x156;
this.Mnemonic = "STAB";
this.LongName = "STORE Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.RegisterAbsolute;
this.Operands = new Array({Operand: "SP", Bitwidth: 16});
this.Words = 1;
this.Cycles = 6;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[5] = CONTROL_OUT_AB | CONTROL_RI;
}
}
is_STAB_sp = new IS_STAB_sp;
Instructions.push(is_STAB_sp);
class IS_PSTAL_sp_ind extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x198;
this.Mnemonic = "PSTAL";
this.LongName = "Page STORE Register A to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.RegisterIndirect;
this.Operands = new Array({Operand: "[SP]", Bitwidth: 16});
this.Words = 1;
this.Cycles = 6;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[5] = CONTROL_OUT_AL | CONTROL_RI;
}
}
is_PSTAL_spin = new IS_PSTAL_sp_ind;
Instructions.push(is_PSTAL_spin);
class IS_PSTAL_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x102;
this.Mnemonic = "PSTAL";
this.LongName = "Page STORE Register A to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 5;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_AL | CONTROL_RI;
}
}
is_PSTAL_i = new IS_PSTAL_imm16;
Instructions.push(is_PSTAL_i);
class IS_STAL_sp_ind24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x1D8;
this.Mnemonic = "STAL";
this.LongName = "STORE Register A to LOW Byte";
this.Aliases = new Array();
this.Type = InstructionTypes.RegisterIndirect;
this.Operands = new Array({Operand: "[SP]", Bitwidth: 24});
this.Words = 1;
this.Cycles = 12;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_HO | CONTROL_RI | CONTROL_SPC;
this.Microcode[4] = CONTROL_SPC;
this.Microcode[5] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[6] = CONTROL_OUT_RO | CONTROL_RHI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[7] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_RO | CONTROL_RRI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[9] = CONTROL_OUT_AL | CONTROL_RI;
this.Microcode[10] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[11] = CONTROL_OUT_RO | CONTROL_RHI;
//this.Microcode[12] = 0;
}
}
is_STAL_spin = new IS_STAL_sp_ind24;
Instructions.push(is_STAL_spin);
class IS_TAB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x200;
this.Mnemonic = "TAB";
this.LongName = "TRANSFER Register A to B";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RBIL;
}
}
is_TAB = new IS_TAB;
Instructions.push(is_TAB);
class IS_TAC extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x201;
this.Mnemonic = "TAC";
this.LongName = "TRANSFER Register A to C";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RCIL;
}
}
is_TAC = new IS_TAC;
Instructions.push(is_TAC);
class IS_TAD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x202;
this.Mnemonic = "TAD";
this.LongName = "TRANSFER Register A to D";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RDIL;
}
}
is_TAD = new IS_TAD;
Instructions.push(is_TAD);
class IS_TBA extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x203;
this.Mnemonic = "TBA";
this.LongName = "TRANSFER Register B to A";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RAIL;
}
}
is_TBA = new IS_TBA;
Instructions.push(is_TBA);
class IS_TBC extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x204;
this.Mnemonic = "TBC";
this.LongName = "TRANSFER Register B to C";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RCIL;
}
}
is_TBC = new IS_TBC;
Instructions.push(is_TBC);
class IS_TBD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x205;
this.Mnemonic = "TBD";
this.LongName = "TRANSFER Register B to D";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RDIL;
}
}
is_TBD = new IS_TBD;
Instructions.push(is_TBD);
class IS_TCA extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x206;
this.Mnemonic = "TCA";
this.LongName = "TRANSFER Register C to A";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RAIL;
}
}
is_TCA = new IS_TCA;
Instructions.push(is_TCA);
class IS_TCB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x207;
this.Mnemonic = "TCB";
this.LongName = "TRANSFER Register C to B";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RBIL;
}
}
is_TCB = new IS_TCB;
Instructions.push(is_TCB);
class IS_TCD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x208;
this.Mnemonic = "TCD";
this.LongName = "TRANSFER Register C to D";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RDIL;
}
}
is_TCD = new IS_TCD;
Instructions.push(is_TCD);
class IS_TDA extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x209;
this.Mnemonic = "TDA";
this.LongName = "TRANSFER Register D to A";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RAIL;
}
}
is_TDA = new IS_TDA;
Instructions.push(is_TDA);
class IS_TDB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x20A;
this.Mnemonic = "TDB";
this.LongName = "TRANSFER Register D to B";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RBIL;
}
}
is_TDB = new IS_TDB;
Instructions.push(is_TDB);
class IS_TDC extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x20B;
this.Mnemonic = "TDC";
this.LongName = "TRANSFER Register D to C";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RCIL;
}
}
is_TDC = new IS_TDC;
Instructions.push(is_TDC);
// This is a simple ADD command which will ADD GPA and GPB putting the sum in GPA
class IS_ADD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x300;
this.Mnemonic = "ADD";
this.LongName = "Addition";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_ADD | CONTROL_OUT_AB;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO;
}
}
is_ADD = new IS_ADD;
Instructions.push(is_ADD);
class IS_SUB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x301;
this.Mnemonic = "SUB";
this.LongName = "Subtraction";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_SUB;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO;
}
}
is_SUB = new IS_SUB;
Instructions.push(is_SUB);
class IS_NOT extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x302;
this.Mnemonic = "NOT";
this.LongName = "Logical NOT";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 9;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_RAIL;
this.Microcode[5] = CONTROL_ALU_NOT;
this.Microcode[6] = CONTROL_OUT_AO | CONTROL_RBIL | CONTROL_SPC;
this.Microcode[7] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[8] = CONTROL_OUT_RO | CONTROL_RAIL;
}
}
is_NOT = new IS_NOT;
Instructions.push(is_NOT);
class IS_FNOT extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x303;
this.Mnemonic = "FNOT";
this.LongName = "Logical FAST NOT";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_NOT;
this.Microcode[3] = CONTROL_RBIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_FNOT = new IS_FNOT;
Instructions.push(is_FNOT);
class IS_AND extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x304;
this.Mnemonic = "AND";
this.LongName = "Logical AND";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_AND;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_AND = new IS_AND;
Instructions.push(is_AND);
class IS_NAND extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x305;
this.Mnemonic = "NAND";
this.LongName = "Logical NAND";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_NAND;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_NAND = new IS_NAND;
Instructions.push(is_NAND);
class IS_OR extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x306;
this.Mnemonic = "OR";
this.LongName = "Logical OR";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_OR;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_OR = new IS_OR;
Instructions.push(is_OR);
class IS_NOR extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x307;
this.Mnemonic = "NOR";
this.LongName = "Logical NOR";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_NOR;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_NOR = new IS_NOR;
Instructions.push(is_NOR);
class IS_XOR extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x308;
this.Mnemonic = "XOR";
this.LongName = "Logical XOR";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_XOR;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_XOR = new IS_XOR;
Instructions.push(is_XOR);
class IS_XNOR extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x309;
this.Mnemonic = "XNOR";
this.LongName = "Logical XNOR";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_ALU_XNOR;
this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC;
}
}
is_XNOR = new IS_XNOR;
Instructions.push(is_XNOR);
class IS_CMP extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30A;
this.Mnemonic = "CMP";
this.LongName = "Logical COMPARE";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "B", Bitwidth: 8});
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_AB | CONTROL_ALU_ADD;
}
}
is_CMP = new IS_CMP;
Instructions.push(is_CMP);
class IS_CMP_gpcd_abs extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30B;
this.Mnemonic = "CMP";
this.LongName = "Logical COMPARE";
this.Aliases = new Array();
this.Type = InstructionTypes.RegisterAbsolute;
this.Operands = new Array({Operand: "CD", Bitwidth: 16});
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_CD | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_ALU_ADD;
}
}
is_CMP_cda = new IS_CMP_gpcd_abs();
Instructions.push(is_CMP_cda);
class IS_CMP_gpc_gpd extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30C;
this.Mnemonic = "CMP";
this.LongName = "Logical COMPARE";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "C", Bitwidth: 8},{Operand: "D", Bitwidth: 8});
this.Words = 1;
this.Cycles = 3;
this.Microcode[2] = CONTROL_OUT_CD | CONTROL_ALU_ADD;
}
}
is_CMP_c_d = new IS_CMP_gpc_gpd();
Instructions.push(is_CMP_c_d);
class IS_ADD_gpa_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30D;
this.Mnemonic = "ADD";
this.LongName = "Addition";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "A", Bitwidth: 8},{Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 10;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_BL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_AB | CONTROL_ALU_ADD;
this.Microcode[7] = CONTROL_OUT_AO | CONTROL_RAIL | CONTROL_SPC;
this.Microcode[8] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RBIL;
}
}
is_ADD_gpai = new IS_ADD_gpa_imm;
Instructions.push(is_ADD_gpai);
class IS_ADD_gpb_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30E;
this.Mnemonic = "ADD";
this.LongName = "Addition";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "B", Bitwidth: 8},{Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 10;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_AB | CONTROL_ALU_ADD;
this.Microcode[7] = CONTROL_OUT_AO | CONTROL_RBIL | CONTROL_SPC;
this.Microcode[8] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RAIL;
}
}
is_ADD_gpbi = new IS_ADD_gpb_imm;
Instructions.push(is_ADD_gpbi);
class IS_ADD_gpc_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x30F;
this.Mnemonic = "ADD";
this.LongName = "Addition";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "C", Bitwidth: 8},{Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 10;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_CA | CONTROL_ALU_ADD;
this.Microcode[7] = CONTROL_OUT_AO | CONTROL_RCIL | CONTROL_SPC;
this.Microcode[8] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RAIL;
}
}
is_ADD_gpci = new IS_ADD_gpc_imm;
Instructions.push(is_ADD_gpci);
class IS_ADD_gpd_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x310;
this.Mnemonic = "ADD";
this.LongName = "Addition";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array({Operand: "D", Bitwidth: 8},{Operand: "$", Bitwidth: 8});
this.Words = 2;
this.Cycles = 10;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC;
this.Microcode[6] = CONTROL_OUT_DA | CONTROL_ALU_ADD;
this.Microcode[7] = CONTROL_OUT_AO | CONTROL_RDIL | CONTROL_SPC;
this.Microcode[8] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_RAIL;
}
}
is_ADD_gpdi = new IS_ADD_gpd_imm;
Instructions.push(is_ADD_gpdi);
class IS_PHA extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x280;
this.Mnemonic = "PHA";
this.LongName = "PUSH Register A to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHA = new IS_PHA;
Instructions.push(is_PHA);
class IS_PHB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x281;
this.Mnemonic = "PHB";
this.LongName = "PUSH Register B to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_BL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHB = new IS_PHB;
Instructions.push(is_PHB);
class IS_PHC extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x282;
this.Mnemonic = "PHC";
this.LongName = "PUSH Register C to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_CL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHC = new IS_PHC;
Instructions.push(is_PHC);
class IS_PHD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x283;
this.Mnemonic = "PHD";
this.LongName = "PUSH Register D to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_DL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHD = new IS_PHD;
Instructions.push(is_PHD);
class IS_PHAB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x284;
this.Mnemonic = "PHAB";
this.LongName = "PUSH Register A and B to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_AB | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHAB = new IS_PHAB;
Instructions.push(is_PHAB);
class IS_PHCD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x28C;
this.Mnemonic = "PHCD";
this.LongName = "PUSH Register C and D to the STACK";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_CD | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
}
}
is_PHCD = new IS_PHCD;
Instructions.push(is_PHCD);
class IS_PLA extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2A0;
this.Mnemonic = "PLA";
this.LongName = "PULL Stack and place in Register A (Low BYTE)";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 5;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL;
}
}
is_PLA = new IS_PLA;
Instructions.push(is_PLA);
class IS_PLB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2A1;
this.Mnemonic = "PLB";
this.LongName = "PULL Stack and place in Register B (Low BYTE)";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Words = 1;
this.Cycles = 5;
this.Operands = new Array();
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RBIL;
}
}
is_PLB = new IS_PLB;
Instructions.push(is_PLB);
class IS_PLC extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2A2;
this.Mnemonic = "PLC";
this.LongName = "PULL Stack and place in Register C (Low BYTE)";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 5;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RCIL;
}
}
is_PLC = new IS_PLC;
Instructions.push(is_PLC);
class IS_PLD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2A3;
this.Mnemonic = "PLD";
this.LongName = "PULL Stack and place in Register D (Low BYTE)";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 5;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RDIL;
}
}
is_PLD = new IS_PLD;
Instructions.push(is_PLD);
class IS_PLAB extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2A4;
this.Mnemonic = "PLAB";
this.LongName = "PULL Stack and place in Register A and B";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 5;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH;
}
}
is_PLAB = new IS_PLAB;
Instructions.push(is_PLAB);
class IS_PLCD extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2AC;
this.Mnemonic = "PLCD";
this.LongName = "PULL Stack and place in Register C and D";
this.Aliases = new Array();
this.Type = InstructionTypes.Register;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 5;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_RDIH;
}
}
is_PLCD = new IS_PLCD;
Instructions.push(is_PLCD);
class IS_JMP_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2C0;
this.Mnemonic = "JMP";
this.LongName = "JUMP to address";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_PCI;
}
}
is_JMP_i = new IS_JMP_imm16;
Instructions.push(is_JMP_i);
class IS_JMP_imm24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2C1;
this.Mnemonic = "JMP";
this.LongName = "JUMP to address";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate24;
this.Operands = new Array({Operand: "$", Bitwidth: 24});
this.Words = 3;
this.Cycles = 7;
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_PCI;
this.Microcode[6] = CONTROL_OUT_2O | CONTROL_RHI;
}
}
is_JMP_i24 = new IS_JMP_imm24;
Instructions.push(is_JMP_i24);
class IS_BCC_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.UsesCarry = true;
this.Bytecode = 0x2C2;
this.Mnemonic = "BCC";
this.LongName = "Branch if Carry Clear";
this.Aliases = new Array("JNC");
this.Type = InstructionTypes.Immediate;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.CarryWords = 2;
this.CarryCycles = 3;
this.MicrocodeCarry = new Array(16);
for (let a = 0; a < 16; a++) {
this.MicrocodeCarry[a] = this.Microcode[a];
}
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_PCI;
this.MicrocodeCarry[2] = CONTROL_PCC; // Step over the immediate value
}
}
is_BCC_i = new IS_BCC_imm;
Instructions.push(is_BCC_i);
class IS_BCS_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.UsesCarry = true;
this.Bytecode = 0x2C3;
this.Mnemonic = "BCS";
this.LongName = "Branch if Carry Set";
this.Aliases = new Array("JC");
this.Type = InstructionTypes.Immediate;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 3;
this.CarryWords = 2;
this.CarryCycles = 4;
this.MicrocodeCarry = new Array(16);
for (let a = 0; a < 16; a++) {
this.MicrocodeCarry[a] = this.Microcode[a];
}
this.Microcode[2] = CONTROL_PCC; // Step over the immediate value
this.MicrocodeCarry[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.MicrocodeCarry[3] = CONTROL_OUT_RO | CONTROL_PCI;
}
}
is_BCS_i = new IS_BCS_imm;
Instructions.push(is_BCS_i);
class IS_BEQ_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.UsesZero = true;
this.Bytecode = 0x2C4;
this.Mnemonic = "BEQ";
this.LongName = "Branch if Equal";
this.Aliases = new Array("JE","JZ");
this.Type = InstructionTypes.Immediate;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 3;
this.ZeroWords = 2;
this.ZeroCycles = 4;
this.MicrocodeZero = new Array(16);
for (let a = 0; a < 16; a++) {
this.MicrocodeZero[a] = this.Microcode[a];
}
this.Microcode[2] = CONTROL_PCC; // Step over the immediate value
this.MicrocodeZero[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.MicrocodeZero[3] = CONTROL_OUT_RO | CONTROL_PCI;
}
}
is_BEQ_i = new IS_BEQ_imm;
Instructions.push(is_BEQ_i);
class IS_BNE_imm extends Microcode_Instruction {
constructor(props) {
super(props);
this.UsesZero = true;
this.Bytecode = 0x2C5;
this.Mnemonic = "BNE";
this.LongName = "Branch if NOT Equal";
this.Aliases = new Array("JNE","JNZ");
this.Type = InstructionTypes.Immediate;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 4;
this.ZeroWords = 2;
this.ZeroCycles = 3;
this.MicrocodeZero = new Array(16);
for (let a = 0; a < 16; a++) {
this.MicrocodeZero[a] = this.Microcode[a];
}
this.MicrocodeZero[2] = CONTROL_PCC; // Step over the immediate value
this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_RO | CONTROL_PCI;
}
}
is_BNE_i = new IS_BNE_imm;
Instructions.push(is_BNE_i);
class IS_JSR_imm16 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2FC;
this.Mnemonic = "JSR";
this.LongName = "JUMP to Subroutine";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate16;
this.Operands = new Array({Operand: "$", Bitwidth: 16});
this.Words = 2;
this.Cycles = 6;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_PC | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_RO | CONTROL_PCI;
}
}
is_JSR_i = new IS_JSR_imm16;
Instructions.push(is_JSR_i);
class IS_RTS_paged extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2FD;
this.Mnemonic = "RTS";
this.LongName = "RETURN from Subroutine (called with 16 bit immediate)";
this.Aliases = new Array();
this.Type = InstructionTypes.RTS16;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 6;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_RO | CONTROL_PCI;
this.Microcode[5] = CONTROL_PCC;
}
}
is_RTS_paged = new IS_RTS_paged();
Instructions.push(is_RTS_paged);
class IS_JSR_imm24 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2FE;
this.Mnemonic = "JSR";
this.LongName = "JUMP to Subroutine";
this.Aliases = new Array();
this.Type = InstructionTypes.Immediate24;
this.Operands = new Array({Operand: "$", Bitwidth: 24});
this.Words = 3;
this.Cycles = 11;
this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[3] = CONTROL_OUT_PC | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[4] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[5] = CONTROL_OUT_HO | CONTROL_RI | CONTROL_SPD | CONTROL_SPC;
this.Microcode[6] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[7] = CONTROL_OUT_I2 | CONTROL_PCC;
this.Microcode[8] = CONTROL_OUT_PC | CONTROL_RRI;
this.Microcode[9] = CONTROL_OUT_RO | CONTROL_PCI;
this.Microcode[10] = CONTROL_OUT_2O | CONTROL_RHI;
}
}
is_JSR_i24 = new IS_JSR_imm24;
Instructions.push(is_JSR_i24);
class IS_RTS extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x2FF;
this.Mnemonic = "RTS";
this.LongName = "RETURN from Subroutine (called with 24 bit immediate)";
this.Aliases = new Array();
this.Type = InstructionTypes.RTS24;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 9;
this.Microcode[2] = CONTROL_SPC;
this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[4] = CONTROL_OUT_I2 | CONTROL_SPC;
this.Microcode[5] = CONTROL_OUT_SP | CONTROL_RRI;
this.Microcode[6] = CONTROL_OUT_RO | CONTROL_PCI;
this.Microcode[7] = CONTROL_OUT_2O | CONTROL_RHI | CONTROL_PCC;
this.Microcode[8] = CONTROL_PCC;
}
}
is_RTS = new IS_RTS;
Instructions.push(is_RTS);
class IS_NOP extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x3ff;
this.Mnemonic = "NOP";
this.LongName = "NO OPERATION";
this.Aliases = new Array();
this.Type = InstructionTypes.SingleWord;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 2;
}
}
is_NOP = new IS_NOP;
Instructions.push(is_NOP);
class IS_NOP0 extends Microcode_Instruction {
constructor(props) {
super(props);
this.Bytecode = 0x0;
this.Mnemonic = "NOP";
this.LongName = "NO OPERATION";
this.Aliases = new Array();
this.Type = InstructionTypes.SingleWord;
this.Operands = new Array();
this.Words = 1;
this.Cycles = 2;
}
}
is_NOP0 = new IS_NOP0;
Instructions.push(is_NOP0);