From 108b967a87932948217af7f9955c3db1b1c2f83b Mon Sep 17 00:00:00 2001 From: MatCat Date: Wed, 7 Apr 2021 00:54:31 -0700 Subject: [PATCH] Added a bunch of new indirect and absolute instructions --- examples/printstring.asm | 44 +++ js/cpu.js | 134 ++++---- js/main.js | 45 ++- js/microcode_compiler.js | 686 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 819 insertions(+), 90 deletions(-) create mode 100644 examples/printstring.asm diff --git a/examples/printstring.asm b/examples/printstring.asm new file mode 100644 index 0000000..57abfcb --- /dev/null +++ b/examples/printstring.asm @@ -0,0 +1,44 @@ +; printstring.asm +; +; This is a simple demonstration routine for the emulator to take a null terminated string from RAM +; and display it out to the emulators text printer. +; The routine takes a simple argument on the stack with the address of the string. +; The routine will use the DISPLAY variable set in .data +; +; Version: 0.2.0 + + GLOBAL START + GLOBAL PRINTSTRING + + SECTION .text +START: LDAB MYSTRING ; Put string address into AB + PHAB ; and push to the stack + JSR PRINTSTRING ; Call PRINTSTRING routine + + SECTION .printstring +PRINTSTRING: PLAB + PLCD + PHAB ; Get the address of the string ^^^ + LDAB $DISPLAY ; Set the output address + PHAB +PRINTLOOP: LDAB CD + CMP %A,%B + BEQ RETURN ; If we pull a 0, or null then we are done + STAL [SP] + ADD %C,$1 ; Increment our string location by 1 + BCS ROLLOVER ; If it rolls over we need to go handle high byte + PLAB + ADD %A,$1 ; Icrement our output by 1 + PHAB + JMP PRINTLOOP ; Loop back and keep reading in the string +ROLLOVER: ADD %D, $1 + PLAB + ADD %B, $1 + PHAB + JMP PRINTLOOP ; Loop back and keep reading in the string +RETURN: PLAB ; To return we need to clean up our stack use first + RTS + + SECTION .data +DISPLAY equ 8000h +MYSTRING DB "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc maximus erat mollis, fermentum quam at, blandit turpis. Pellentesque arcu tortor, smoke weed guam sagittis ac, posuere ut ipsum. Nulla facilisi. Mauris eget urna id sem porttitor consequat ultrices porttitor magna. Quisque condimentum porta viverra. Suspendisse ac condimentum ante. Duis accumsan augue urna, at ultricies nunc accumsan eget. Nullam eleifend.", 0 \ No newline at end of file diff --git a/js/cpu.js b/js/cpu.js index b1881ee..5ff2986 100644 --- a/js/cpu.js +++ b/js/cpu.js @@ -33,6 +33,7 @@ const CONTROL_OEM2 = 0b00000000100000000000000000000000; // Outpu 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_AE = 0b00001000000000000000000000000000; // ALU Enable const CONTROL_RI = 0b00010000000000000000000000000000; // RAM Input Enable const CONTROL_IRI = 0b00100000000000000000000000000000; // Instruction Register Input Enable const CONTROL_MCL0 = 0b01000000000000000000000000000000; // Microcode Counter to 0 @@ -61,7 +62,6 @@ const OECONTROL_CD = 0b10010 // GPD to HIGH, GPC to LOW const OECONTROL_DA = 0b10011 // GPA to HIGH, GPD to LOW const OECONTROL_DB = 0b10100 // GPB to HIGH, GPD to LOW const OECONTROL_DC = 0b10101 // GPC to HIGH, GPD to LOW -const OECONTROL_AE = 0b11100 // ALU Enable const OECONTROL_AO = 0b11101 // ALU Output to LOW const OECONTROL_SR = 0b11110 // Status Register to LOW const OECONTROL_RO = 0b11111 // RAM to DATABUS Enable @@ -351,6 +351,7 @@ class CPU_8SA1 { if (this.MC_Controls & CONTROL_RCIH) this.GPC_In_HIGH_CLK(); if (this.MC_Controls & CONTROL_RDIL) this.GPD_In_LOW_CLK(); if (this.MC_Controls & CONTROL_RDIH) this.GPD_In_HIGH_CLK(); + if (this.MC_Controls & CONTROL_AE ) this.ALU_CLK(); } @@ -359,6 +360,71 @@ class CPU_8SA1 { this._FetchDecode_CLK_neg(); } + ALU_CLK() { + //console.log("ALU Enable"); + let ALU_A = this.DATABUS & BITMASK_8; + let ALU_B = (this.DATABUS & (BITMASK_8 << 8)) >> 8; + let ALU_Result = 0; + + let ALUMUX = (this.MC_Controls & CONTROL_ALUM1) ? 0b10 : 0; + ALUMUX |= (this.MC_Controls & CONTROL_ALUM0) ? 0b01 : 0; + + //console.log(`ALU: A=${ALU_A}, B=${ALU_B}, MUX: ${ALUMUX}`); + if (this.MC_Controls & CONTROL_ALUI) console.log("ALU Inverting B"); + let SHIFTING = false; + if (this.MC_Controls & CONTROL_ALUSL) SHIFTING = true; + if (this.MC_Controls & CONTROL_ALUSR) SHIFTING = true; + + switch (ALUMUX) { + case 0: { // ADD + if (this.MC_Controls & CONTROL_ALUI) ALU_B = ~ALU_B; + ALU_Result = ALU_A + ALU_B; + + if (this.MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; + break; + } + case 1: { // AND + ALU_Result = ALU_A & ALU_B; + if (this.MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; + if (this.MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; + break; + } + case 2: { // OR + ALU_Result = ALU_A | ALU_B; + if (this.MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; + if (this.MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; + break; + } + case 3: { // XOR + ALU_Result = ALU_A ^ ALU_B; + if (this.MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; + if (this.MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; + break; + } + } + + if (this.MC_Controls & CONTROL_ALUSL) ALU_Result = ALU_Result << 1; + if ((this.MC_Controls & CONTROL_ALUSL) && (this.MC_Controls & CONTROL_ALUC)) ALU_Result = ALU_Result | 0b00000001; + if (this.MC_Controls & CONTROL_ALUSR) ALU_Result = ALU_Result >> 1; + if ((this.MC_Controls & CONTROL_ALUSR) && (this.MC_Controls & CONTROL_ALUC)) ALU_Result = ALU_Result | 0b10000000; + + if (ALU_Result & 0b100000000) { + // We have a carry + this.SR = this.SR | 0b00000001; + } else { + this.SR = this.SR & 0b11111110; + } + + if (ALU_Result === 0) { + // We have a ZERO + this.SR = this.SR | 0b00000010; + } else { + this.SR = this.SR & 0b11111101; + } + + this.ALUSUM = ALU_Result & BITMASK_8; + } + _FetchDecode_CLK_neg() { // We actually setup all of our fetch and decode logic during the clocks low phase this.DATABUS = 0; @@ -482,72 +548,6 @@ class CPU_8SA1 { this.DATABUS = ((this.GPC & BITMASK_8) << 8) | (this.GPD & BITMASK_8); break; } - case OECONTROL_AE: { - //console.log("ALU Enable"); - this.DATABUS = (this.GPB << 8) | this.GPA; - let ALU_A = this.DATABUS & BITMASK_8; - let ALU_B = (this.DATABUS & (BITMASK_8 << 8)) >> 8; - let ALU_Result = 0; - - let ALUMUX = (MC_Controls & CONTROL_ALUM1) ? 0b10 : 0; - ALUMUX |= (MC_Controls & CONTROL_ALUM0) ? 0b01 : 0; - - //console.log(`ALU: A=${ALU_A}, B=${ALU_B}, MUX: ${ALUMUX}`); - if (MC_Controls & CONTROL_ALUI) console.log("ALU Inverting B"); - let SHIFTING = false; - if (MC_Controls & CONTROL_ALUSL) SHIFTING = true; - if (MC_Controls & CONTROL_ALUSR) SHIFTING = true; - - switch (ALUMUX) { - case 0: { // ADD - if (MC_Controls & CONTROL_ALUI) ALU_B = ~ALU_B; - ALU_Result = ALU_A + ALU_B; - - if (MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; - break; - } - case 1: { // AND - ALU_Result = ALU_A & ALU_B; - if (MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; - if (MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; - break; - } - case 2: { // OR - ALU_Result = ALU_A | ALU_B; - if (MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; - if (MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; - break; - } - case 3: { // XOR - ALU_Result = ALU_A ^ ALU_B; - if (MC_Controls & CONTROL_ALUI) ALU_Result = ~ALU_Result; - if (MC_Controls & CONTROL_ALUC && !SHIFTING) ALU_Result += 1; - break; - } - } - - if (MC_Controls & CONTROL_ALUSL) ALU_Result = ALU_Result << 1; - if ((MC_Controls & CONTROL_ALUSL) && (MC_Controls & CONTROL_ALUC)) ALU_Result = ALU_Result | 0b00000001; - if (MC_Controls & CONTROL_ALUSR) ALU_Result = ALU_Result >> 1; - if ((MC_Controls & CONTROL_ALUSR) && (MC_Controls & CONTROL_ALUC)) ALU_Result = ALU_Result | 0b10000000; - - if (ALU_Result & 0b100000000) { - // We have a carry - this.SR = this.SR | 0b00000001; - } else { - this.SR = this.SR & 0b11111110; - } - - if (ALU_Result === 0) { - // We have a ZERO - this.SR = this.SR | 0b00000010; - } else { - this.SR = this.SR & 0b11111101; - } - - this.ALUSUM = ALU_Result & BITMASK_8; - break; - } case OECONTROL_AO: { this.DATABUS = (this.DATABUS & (BITMASK_8 << 8)) | this.ALUSUM; //console.log("DATABUS = SUM"); diff --git a/js/main.js b/js/main.js index 674ee72..065b47d 100644 --- a/js/main.js +++ b/js/main.js @@ -35,12 +35,8 @@ cpu.RAM[3] = 0; cpu.RAM[4] = is_CMP.Bytecode; */ -cpu.RAM[0] = is_LDAB_i.Bytecode; -cpu.RAM[1] = 0x0100; -cpu.RAM[2] = is_PHAB.Bytecode; -cpu.RAM[3] = is_JSR.Bytecode; -cpu.RAM[4] = 0x00D0; +/* cpu.RAM[0xD0] = is_PLAB.Bytecode; cpu.RAM[0xD1] = is_PLCD.Bytecode; cpu.RAM[0xD2] = is_PHAB.Bytecode; @@ -86,7 +82,46 @@ cpu.RAM[0xF9] = is_JMP_i.Bytecode; cpu.RAM[0xFA] = 0x00D5; cpu.RAM[0xFB] = is_PLAB.Bytecode; cpu.RAM[0xFC] = is_RTS.Bytecode; +*/ +cpu.RAM[0] = is_LDAB_i.Bytecode; +cpu.RAM[1] = 0x0100; +cpu.RAM[2] = is_PHAB.Bytecode; +cpu.RAM[3] = is_JSR.Bytecode; +cpu.RAM[4] = 0x00D0; + + +cpu.RAM[0xD0] = is_PLAB.Bytecode; +cpu.RAM[0xD1] = is_PLCD.Bytecode; +cpu.RAM[0xD2] = is_PHAB.Bytecode; +cpu.RAM[0xD3] = is_LDAB_i.Bytecode; +cpu.RAM[0xD4] = 0x8000; +cpu.RAM[0xD5] = is_PHAB.Bytecode; +cpu.RAM[0xD6] = is_LDAB_GPCD.Bytecode; // printloop +cpu.RAM[0xD7] = is_CMP_gpab.Bytecode; +cpu.RAM[0xD8] = is_BEQ_i.Bytecode; +cpu.RAM[0xD9] = 0x00ED; +cpu.RAM[0xDA] = is_STAL_spin.Bytecode; +cpu.RAM[0xDB] = is_ADD_gpci.Bytecode +cpu.RAM[0xDC] = 1; +cpu.RAM[0xDD] = is_BCS_i.Bytecode; +cpu.RAM[0xDE] = 0x00E5; +cpu.RAM[0xDF] = is_PLAB.Bytecode; +cpu.RAM[0xE0] = is_ADD_gpai.Bytecode; +cpu.RAM[0xE1] = 1; +cpu.RAM[0xE2] = is_PHAB.Bytecode; +cpu.RAM[0xE3] = is_JMP_i.Bytecode; +cpu.RAM[0xE4] = 0x00D6; +cpu.RAM[0xE5] = is_ADD_gpdi.Bytecode; // rollover +cpu.RAM[0xE6] = 1; +cpu.RAM[0xE7] = is_PLAB.Bytecode; +cpu.RAM[0xE8] = is_ADD_gpbi.Bytecode; +cpu.RAM[0xE9] = 1; +cpu.RAM[0xEA] = is_PHAB.Bytecode; +cpu.RAM[0xEB] = is_JMP_i.Bytecode; +cpu.RAM[0xEC] = 0x00D6; +cpu.RAM[0xED] = is_PLAB.Bytecode; // return +cpu.RAM[0xEE] = is_RTS.Bytecode; stringToRAM("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc maximus erat mollis, fermentum quam at, blandit turpis. Pellentesque arcu tortor, smoke weed guam sagittis ac, posuere ut ipsum. Nulla facilisi. Mauris eget urna id sem porttitor consequat ultrices porttitor magna. Quisque condimentum porta viverra. Suspendisse ac condimentum ante. Duis accumsan augue urna, at ultricies nunc accumsan eget. Nullam eleifend.",cpu.RAM,0x100); diff --git a/js/microcode_compiler.js b/js/microcode_compiler.js index ef88db6..9d9cb71 100644 --- a/js/microcode_compiler.js +++ b/js/microcode_compiler.js @@ -42,8 +42,10 @@ const CONTROL_OUT_CH = CONTROL_OEME | CONTROL_OEM2 | CONTROL_OEM1 | CONTROL_OEM0 const CONTROL_OUT_DL = CONTROL_OEME | CONTROL_OEM3; const CONTROL_OUT_DH = CONTROL_OEME | CONTROL_OEM3 | CONTROL_OEM0; const CONTROL_OUT_AB = CONTROL_OEME | CONTROL_OEM3 | CONTROL_OEM1; +const CONTROL_OUT_CA = CONTROL_OEME | CONTROL_OEM4; const CONTROL_OUT_CD = CONTROL_OEME | CONTROL_OEM4 | CONTROL_OEM1; -const CONTROL_OUT_AE = CONTROL_OEME | CONTROL_OEM4 | CONTROL_OEM3 | CONTROL_OEM2; +const CONTROL_OUT_DA = CONTROL_OEME | CONTROL_OEM4 | CONTROL_OEM1 | CONTROL_OEM0; +const CONTROL_OUT_AE = CONTROL_AE; const CONTROL_OUT_AO = CONTROL_OEME | CONTROL_OEM4 | CONTROL_OEM3 | CONTROL_OEM2 | CONTROL_OEM0; const CONTROL_OUT_RO = CONTROL_OEME | CONTROL_OEM4 | CONTROL_OEM3 | CONTROL_OEM2 | CONTROL_OEM1 | CONTROL_OEM0; @@ -59,10 +61,99 @@ const CONTROL_ALU_XNOR = CONTROL_OUT_AE | CONTROL_ALUM1 | CONTROL_ALUM0 | CONTRO let Instructions = new Array(); -function FindInstructon(ins) { +const InstructionTypes = { + SingleWord: { + Name: `Singe Word`, + toString() { + return this.Name; + } + }, + Immediate: { + Name: `Immediate`, + toString() { + return this.Name; + } + }, + Indirect: { + Name: `Indirect`, + toString() { + return this.Name; + } + }, + Absolute: { + Name: `Absolute`, + toString() { + return this.Name; + } + }, + Register: { + Name: `Register`, + 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()) { - return Instructions[a]; + if (type) { + if (Instructions[a].Type === type) return Instructions[a]; + } else { + return Instructions[a]; + } } } return false; @@ -91,16 +182,18 @@ function GenerateMicrocode(mcarray,cpu) { } } - class Microcode_Instruction { constructor() { this.Bytecode = 0x000; // MAX IS 0x3ff this.Mnemonic = "NOP"; + this.Aliases = new Array(); this.Microcode = new Array(16); - + this.Operands = new Array(); this.UsesCarry = false; this.UsesZero = false; + 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++) { @@ -109,11 +202,18 @@ class Microcode_Instruction { } } +//--------------------------- General Purpose Registers LDx Immediates --------------------------- + class IS_LDA_imm extends Microcode_Instruction { constructor(props) { super(props); this.Bytecode = 0x000; this.Mnemonic = "LDA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); + this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_PCC; } @@ -126,6 +226,10 @@ class IS_LDB_imm extends Microcode_Instruction { super(props); this.Bytecode = 0x001; this.Mnemonic = "LDB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RBIL | CONTROL_PCC; } @@ -138,6 +242,10 @@ class IS_LDC_imm extends Microcode_Instruction { super(props); this.Bytecode = 0x002; this.Mnemonic = "LDC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_PCC; } @@ -150,6 +258,10 @@ class IS_LDD_imm extends Microcode_Instruction { super(props); this.Bytecode = 0x003; this.Mnemonic = "LDD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RDIL | CONTROL_PCC; } @@ -157,11 +269,163 @@ class IS_LDD_imm extends Microcode_Instruction { is_LDD_i = new IS_LDD_imm; Instructions.push(is_LDD_i); +//--------------------------- General Purpose Registers LDx Absolutes --------------------------- + + +class IS_LDA_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x004; + this.Mnemonic = "LDA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Absolute; + this.Operands = new Array(); + + 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_abs; +Instructions.push(is_LDA_a); + +class IS_LDB_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x005; + this.Mnemonic = "LDB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Absolute; + this.Operands = new Array(); + 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_abs; +Instructions.push(is_LDB_a); + +class IS_LDC_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x006; + this.Mnemonic = "LDC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Absolute; + this.Operands = new Array(); + 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_abs; +Instructions.push(is_LDC_a); + +class IS_LDD_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x007; + this.Mnemonic = "LDD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Absolute; + this.Operands = new Array(); + 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_abs; +Instructions.push(is_LDD_a); + +//--------------------------- General Purpose Registers LDx Indirect --------------------------- + +class IS_LDA_ind extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x008; + this.Mnemonic = "LDA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Indirect; + this.Operands = new Array(); + + 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_ind; +Instructions.push(is_LDA_in); + +class IS_LDB_ind extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x009; + this.Mnemonic = "LDB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Indirect; + this.Operands = new Array(); + 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_ind; +Instructions.push(is_LDB_in); + +class IS_LDC_ind extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x00A; + this.Mnemonic = "LDC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Indirect; + this.Operands = new Array(); + 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_ind; +Instructions.push(is_LDC_in); + +class IS_LDD_ind extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x00B; + this.Mnemonic = "LDD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Indirect; + this.Operands = new Array(); + 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_ind; +Instructions.push(is_LDD_in); + + class IS_LDAB_GPCD extends Microcode_Instruction { constructor(props) { super(props); this.Bytecode = 0x020; this.Mnemonic = "LDAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("CD"); this.Microcode[2] = CONTROL_OUT_CD | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH; } @@ -174,6 +438,10 @@ class IS_LDAB_imm extends Microcode_Instruction { super(props); this.Bytecode = 0x021; this.Mnemonic = "LDAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH | CONTROL_PCC; } @@ -181,12 +449,33 @@ class IS_LDAB_imm extends Microcode_Instruction { is_LDAB_i = new IS_LDAB_imm; Instructions.push(is_LDAB_i); +class IS_LDAB_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x022; + this.Mnemonic = "LDAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Absolute; + this.Operands = new Array(); + 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_abs; +Instructions.push(is_LDAB_a); + class IS_STAL_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x004; + this.Bytecode = 0x030; this.Mnemonic = "STAL"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -198,8 +487,12 @@ Instructions.push(is_STAL_i); class IS_STAH_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x005; + this.Bytecode = 0x031; this.Mnemonic = "STAH"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -211,8 +504,12 @@ Instructions.push(is_STAH_i); class IS_STBL_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x006; + this.Bytecode = 0x032; this.Mnemonic = "STBL"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -224,8 +521,12 @@ Instructions.push(is_STBL_i); class IS_STBH_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x007; + this.Bytecode = 0x033; this.Mnemonic = "STBH"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -237,8 +538,12 @@ Instructions.push(is_STBH_i); class IS_STCL_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x008; + this.Bytecode = 0x034; this.Mnemonic = "STCL"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -250,8 +555,12 @@ Instructions.push(is_STCL_i); class IS_STCH_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x009; + this.Bytecode = 0x035; this.Mnemonic = "STCH"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -263,8 +572,12 @@ Instructions.push(is_STCH_i); class IS_STDL_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x00A; + this.Bytecode = 0x036; this.Mnemonic = "STDL"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -276,8 +589,12 @@ Instructions.push(is_STDL_i); class IS_STDH_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x00B; + this.Bytecode = 0x037; this.Mnemonic = "STDH"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -289,8 +606,12 @@ Instructions.push(is_STDH_i); class IS_STAB_imm extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x00C; + this.Bytecode = 0x038; this.Mnemonic = "STAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("$"); 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; @@ -302,8 +623,12 @@ Instructions.push(is_STAB_i); class IS_STAB_sp extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x00D; + this.Bytecode = 0x039; this.Mnemonic = "STAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("SP"); 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; @@ -313,12 +638,34 @@ class IS_STAB_sp extends Microcode_Instruction { is_STAB_sp = new IS_STAB_sp; Instructions.push(is_STAB_sp); +class IS_STAL_sp_ind extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x03A; + this.Mnemonic = "STAL"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array("#"); + 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_STAL_spin = new IS_STAL_sp_ind; +Instructions.push(is_STAL_spin); + class IS_TAB extends Microcode_Instruction { constructor(props) { super(props); this.Bytecode = 0x040; this.Mnemonic = "TAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RBIL; } } @@ -331,6 +678,10 @@ class IS_TAC extends Microcode_Instruction { super(props); this.Bytecode = 0x041; this.Mnemonic = "TAC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RCIL; } } @@ -343,6 +694,10 @@ class IS_TAD extends Microcode_Instruction { super(props); this.Bytecode = 0x042; this.Mnemonic = "TAD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_AL | CONTROL_RDIL; } } @@ -355,6 +710,10 @@ class IS_TBA extends Microcode_Instruction { super(props); this.Bytecode = 0x043; this.Mnemonic = "TBA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RAIL; } } @@ -367,6 +726,10 @@ class IS_TBC extends Microcode_Instruction { super(props); this.Bytecode = 0x044; this.Mnemonic = "TBC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RCIL; } } @@ -379,6 +742,10 @@ class IS_TBD extends Microcode_Instruction { super(props); this.Bytecode = 0x045; this.Mnemonic = "TBD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_BL | CONTROL_RDIL; } } @@ -391,6 +758,10 @@ class IS_TCA extends Microcode_Instruction { super(props); this.Bytecode = 0x046; this.Mnemonic = "TCA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RAIL; } } @@ -403,6 +774,10 @@ class IS_TCB extends Microcode_Instruction { super(props); this.Bytecode = 0x047; this.Mnemonic = "TCB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RBIL; } } @@ -415,6 +790,10 @@ class IS_TCD extends Microcode_Instruction { super(props); this.Bytecode = 0x048; this.Mnemonic = "TCD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_CL | CONTROL_RDIL; } } @@ -427,6 +806,10 @@ class IS_TDA extends Microcode_Instruction { super(props); this.Bytecode = 0x049; this.Mnemonic = "TDA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RAIL; } } @@ -439,6 +822,10 @@ class IS_TDB extends Microcode_Instruction { super(props); this.Bytecode = 0x04A; this.Mnemonic = "TDB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RBIL; } } @@ -451,6 +838,10 @@ class IS_TDC extends Microcode_Instruction { super(props); this.Bytecode = 0x04B; this.Mnemonic = "TDC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_DL | CONTROL_RCIL; } } @@ -464,7 +855,11 @@ class IS_ADD extends Microcode_Instruction { super(props); this.Bytecode = 0x100; this.Mnemonic = "ADD"; - this.Microcode[2] = CONTROL_ALU_ADD; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); + this.Microcode[2] = CONTROL_ALU_ADD | CONTROL_OUT_AB; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO; } } @@ -476,6 +871,10 @@ class IS_SUB extends Microcode_Instruction { super(props); this.Bytecode = 0x101; this.Mnemonic = "SUB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_SUB; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO; } @@ -488,6 +887,10 @@ class IS_NOT extends Microcode_Instruction { super(props); this.Bytecode = 0x102; this.Mnemonic = "NOT"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); 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; @@ -505,6 +908,10 @@ class IS_FNOT extends Microcode_Instruction { super(props); this.Bytecode = 0x103; this.Mnemonic = "FNOT"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_NOT; this.Microcode[3] = CONTROL_RBIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -517,6 +924,10 @@ class IS_AND extends Microcode_Instruction { super(props); this.Bytecode = 0x104; this.Mnemonic = "AND"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_AND; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -529,6 +940,10 @@ class IS_NAND extends Microcode_Instruction { super(props); this.Bytecode = 0x105; this.Mnemonic = "NAND"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_NAND; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -541,6 +956,10 @@ class IS_OR extends Microcode_Instruction { super(props); this.Bytecode = 0x106; this.Mnemonic = "OR"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_OR; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -553,6 +972,10 @@ class IS_NOR extends Microcode_Instruction { super(props); this.Bytecode = 0x107; this.Mnemonic = "NOR"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_NOR; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -565,6 +988,10 @@ class IS_XOR extends Microcode_Instruction { super(props); this.Bytecode = 0x108; this.Mnemonic = "XOR"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_XOR; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -577,6 +1004,10 @@ class IS_XNOR extends Microcode_Instruction { super(props); this.Bytecode = 0x109; this.Mnemonic = "XNOR"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_ALU_XNOR; this.Microcode[3] = CONTROL_RAIL | CONTROL_OUT_AO | CONTROL_SPC; } @@ -587,21 +1018,164 @@ Instructions.push(is_XNOR); class IS_CMP extends Microcode_Instruction { constructor(props) { super(props); - this.Bytecode = 0x110; + this.Bytecode = 0x10A; this.Mnemonic = "CMP"; - this.Microcode[2] = CONTROL_ALU_ADD; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); + this.Microcode[2] = CONTROL_ALU_ADD | CONTROL_OUT_AB; this.Microcode[3] = CONTROL_MCL0; } } is_CMP = new IS_CMP; Instructions.push(is_CMP); +class IS_CMP_gpcd_abs extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x10B; + this.Mnemonic = "CMP"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("CD"); + 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 = 0x10C; + this.Mnemonic = "CMP"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("C","D"); + 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 = 0x10D; + this.Mnemonic = "ADD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("A","$"); + 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 = 0x10E; + this.Mnemonic = "ADD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("B","$"); + 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 = 0x10F; + this.Mnemonic = "ADD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("C","$"); + 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 = 0x110; + this.Mnemonic = "ADD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("D","$"); + 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_CMP_gpa_gpb extends Microcode_Instruction { + constructor(props) { + super(props); + this.Bytecode = 0x111; + this.Mnemonic = "CMP"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array("A", "B"); + this.Microcode[2] = CONTROL_OUT_AB | CONTROL_ALU_ADD; + } +} +is_CMP_gpab = new IS_CMP_gpa_gpb(); +Instructions.push(is_CMP_gpab); + class IS_PHA extends Microcode_Instruction { constructor(props) { super(props); this.Bytecode = 0x180; this.Mnemonic = "PHA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_AL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -614,6 +1188,10 @@ class IS_PHB extends Microcode_Instruction { super(props); this.Bytecode = 0x181; this.Mnemonic = "PHB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_BL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -626,6 +1204,10 @@ class IS_PHC extends Microcode_Instruction { super(props); this.Bytecode = 0x182; this.Mnemonic = "PHC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_CL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -638,6 +1220,10 @@ class IS_PHD extends Microcode_Instruction { super(props); this.Bytecode = 0x183; this.Mnemonic = "PHD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_DL | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -650,6 +1236,10 @@ class IS_PHAB extends Microcode_Instruction { super(props); this.Bytecode = 0x184; this.Mnemonic = "PHAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_AB | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -662,6 +1252,10 @@ class IS_PHCD extends Microcode_Instruction { super(props); this.Bytecode = 0x185; this.Mnemonic = "PHCD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_CD | CONTROL_RI | CONTROL_SPD | CONTROL_SPC; } @@ -675,6 +1269,10 @@ class IS_PLA extends Microcode_Instruction { super(props); this.Bytecode = 0x1A0; this.Mnemonic = "PLA"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL; @@ -688,6 +1286,10 @@ class IS_PLB extends Microcode_Instruction { super(props); this.Bytecode = 0x1A1; this.Mnemonic = "PLB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + 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; @@ -701,6 +1303,10 @@ class IS_PLC extends Microcode_Instruction { super(props); this.Bytecode = 0x1A2; this.Mnemonic = "PLC"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RCIL; @@ -714,6 +1320,10 @@ class IS_PLD extends Microcode_Instruction { super(props); this.Bytecode = 0x1A3; this.Mnemonic = "PLD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RDIL; @@ -727,6 +1337,10 @@ class IS_PLAB extends Microcode_Instruction { super(props); this.Bytecode = 0x1A4; this.Mnemonic = "PLAB"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RAIL | CONTROL_RBIH; @@ -740,6 +1354,10 @@ class IS_PLCD extends Microcode_Instruction { super(props); this.Bytecode = 0x1A5; this.Mnemonic = "PLCD"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Register; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_RCIL | CONTROL_RDIH; @@ -754,6 +1372,10 @@ class IS_JMP_imm extends Microcode_Instruction { super(props); this.Bytecode = 0x200; this.Mnemonic = "JMP"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); this.Microcode[2] = CONTROL_OUT_PC | CONTROL_RRI; this.Microcode[3] = CONTROL_OUT_RO | CONTROL_PCI; } @@ -767,6 +1389,10 @@ class IS_BCC_imm extends Microcode_Instruction { this.UsesCarry = true; this.Bytecode = 0x201; this.Mnemonic = "BCC"; + this.Aliases = new Array("JNC"); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); this.MicrocodeCarry = new Array(16); for (let a = 0; a < 16; a++) { this.MicrocodeCarry[a] = this.Microcode[a]; @@ -785,6 +1411,10 @@ class IS_BCS_imm extends Microcode_Instruction { this.UsesCarry = true; this.Bytecode = 0x202; this.Mnemonic = "BCS"; + this.Aliases = new Array("JC"); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); this.MicrocodeCarry = new Array(16); for (let a = 0; a < 16; a++) { this.MicrocodeCarry[a] = this.Microcode[a]; @@ -804,6 +1434,10 @@ class IS_BEQ_imm extends Microcode_Instruction { this.UsesZero = true; this.Bytecode = 0x203; this.Mnemonic = "BEQ"; + this.Aliases = new Array("JE","JZ"); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); this.MicrocodeZero = new Array(16); for (let a = 0; a < 16; a++) { this.MicrocodeZero[a] = this.Microcode[a]; @@ -823,6 +1457,10 @@ class IS_BNE_imm extends Microcode_Instruction { this.UsesZero = true; this.Bytecode = 0x204; this.Mnemonic = "BNE"; + this.Aliases = new Array("JNE","JNZ"); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); this.MicrocodeZero = new Array(16); for (let a = 0; a < 16; a++) { this.MicrocodeZero[a] = this.Microcode[a]; @@ -841,6 +1479,10 @@ class IS_JSR extends Microcode_Instruction { super(props); this.Bytecode = 0x205; this.Mnemonic = "JSR"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.Immediate; + this.Operands = new Array(`$`); 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; @@ -856,6 +1498,10 @@ class IS_RTS extends Microcode_Instruction { super(props); this.Bytecode = 0x206; this.Mnemonic = "RTS"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); this.Microcode[2] = CONTROL_SPC; this.Microcode[3] = CONTROL_OUT_SP | CONTROL_RRI; this.Microcode[4] = CONTROL_OUT_RO | CONTROL_PCI; @@ -872,6 +1518,10 @@ class IS_NOP extends Microcode_Instruction { super(props); this.Bytecode = 0x3ff; this.Mnemonic = "NOP"; + this.Aliases = new Array(); + + this.Type = InstructionTypes.SingleWord; + this.Operands = new Array(); } } is_NOP = new IS_NOP;