├── .gitignore ├── LICENSE ├── README.md ├── code ├── asm │ └── example.asm ├── bin │ └── example.bin ├── luts │ ├── ADD_AB_FB.lut │ ├── ADD_C.lut │ ├── AND_AB_AF.lut │ ├── AND_AB_FB.lut │ ├── AND_A_B_C.lut │ ├── AND_C.lut │ ├── AND_NOT_AB_FB.lut │ ├── BEQ_C.lut │ ├── BMI_C.lut │ ├── BNE_C.lut │ ├── BPL_C.lut │ ├── CLEAR.lut │ ├── CMP_AND_C.lut │ ├── CMP_C.lut │ ├── COPY_A_B.lut │ ├── COPY_A_B_C.lut │ ├── COPY_B_A.lut │ ├── COPY_B_A_C.lut │ ├── C_AND_A_NOT_B.lut │ ├── C_CMP.lut │ ├── C_COPY_A_B.lut │ ├── C_COPY_B_A.lut │ ├── C_MINUS.lut │ ├── C_ZERO.lut │ ├── DEC.lut │ ├── DEC_16.lut │ ├── DEC_C.lut │ ├── IDENTITY.lut │ ├── INC.lut │ ├── INC_16.lut │ ├── INC_16_C.lut │ ├── INC_C.lut │ ├── JMP_C.lut │ ├── JSR_C.lut │ ├── LDA_C.lut │ ├── LDB_C.lut │ ├── LDX_C.lut │ ├── LS2.lut │ ├── LS2_C.lut │ ├── LS3.lut │ ├── LS3_C.lut │ ├── LS4.lut │ ├── LS4_C.lut │ ├── MINUS_C.lut │ ├── OR_AB_FB.lut │ ├── OR_C.lut │ ├── RS1.lut │ ├── RS1_C.lut │ ├── RS5.lut │ ├── RS5_C.lut │ ├── RTS_C.lut │ ├── SEA_C.lut │ ├── SEB_C.lut │ ├── SEX_C.lut │ ├── SMN_C.lut │ ├── STA_C.lut │ ├── STB_C.lut │ ├── STX_C.lut │ ├── SUB_AB_FB.lut │ ├── SUB_C.lut │ ├── SWAP.lut │ ├── TAX_C.lut │ ├── TBX_C.lut │ ├── THREE_C.lut │ ├── TMX_C.lut │ ├── TNX_C.lut │ ├── TXA_C.lut │ ├── TXB_C.lut │ ├── TXM_C.lut │ ├── TXN_C.lut │ ├── XOR_AB_FB.lut │ ├── XOR_C.lut │ └── ZERO_C.lut ├── mc │ ├── ASSIGN_LOADED.mc │ ├── CYCLE_LEFT.mc │ ├── CYCLE_RIGHT.mc │ ├── DECODE_EXECUTE_ARITHMETIC_LOGIC.mc │ ├── DECODE_EXECUTE_BRANCH.mc │ ├── DECODE_EXECUTE_SET.mc │ ├── DECODE_EXECUTE_TRANSFER.mc │ ├── DECODE_LOAD_STORE.mc │ ├── EXECUTE_LOAD_STORE.mc │ ├── FETCH.mc │ ├── INCREMENT_P.mc │ ├── SLIDE_STATE_REG_LEFT.mc │ └── SLIDE_STATE_REG_RIGHT.mc └── ts │ ├── examples │ ├── constant42.js │ ├── constant42.t │ ├── crossing.js │ ├── crossing.t │ ├── example1.js │ ├── example1.t │ ├── example2.js │ ├── example2.t │ ├── example3.js │ ├── example3.t │ ├── example3Expanded.js │ ├── example3Expanded.t │ ├── fanIn.js │ ├── fanIn.t │ ├── fanOut.js │ ├── fanOut.t │ ├── fortyTwo.js │ ├── fortyTwo.t │ ├── ils.js │ ├── ils.t │ ├── irs.js │ ├── irs.t │ ├── method1.js │ ├── method1.t │ ├── method2.js │ ├── method2.t │ ├── nodes.js │ ├── nodes.t │ ├── zeros.js │ └── zeros.t │ ├── functions │ ├── ADD_AB_FB.js │ ├── ADD_AB_FB.t │ ├── ADD_C.js │ ├── ADD_C.t │ ├── AND_AB_AF.js │ ├── AND_AB_AF.t │ ├── AND_AB_FB.js │ ├── AND_AB_FB.t │ ├── AND_A_B_C.js │ ├── AND_A_B_C.t │ ├── AND_C.js │ ├── AND_C.t │ ├── AND_NOT_AB_FB.js │ ├── AND_NOT_AB_FB.t │ ├── BEQ_C.js │ ├── BEQ_C.t │ ├── BMI_C.js │ ├── BMI_C.t │ ├── BNE_C.js │ ├── BNE_C.t │ ├── BPL_C.js │ ├── BPL_C.t │ ├── CLEAR.js │ ├── CLEAR.t │ ├── CMP_AND_C.js │ ├── CMP_AND_C.t │ ├── CMP_C.js │ ├── CMP_C.t │ ├── COPY_A_B.js │ ├── COPY_A_B.t │ ├── COPY_A_B_C.js │ ├── COPY_A_B_C.t │ ├── COPY_B_A.js │ ├── COPY_B_A.t │ ├── COPY_B_A_C.js │ ├── COPY_B_A_C.t │ ├── C_AND_A_NOT_B.js │ ├── C_AND_A_NOT_B.t │ ├── C_CMP.js │ ├── C_CMP.t │ ├── C_COPY_A_B.js │ ├── C_COPY_A_B.t │ ├── C_COPY_B_A.js │ ├── C_COPY_B_A.t │ ├── C_MINUS.js │ ├── C_MINUS.t │ ├── C_ZERO.js │ ├── C_ZERO.t │ ├── DEC.js │ ├── DEC.t │ ├── DEC_16.js │ ├── DEC_16.t │ ├── DEC_C.js │ ├── DEC_C.t │ ├── IDENTITY.js │ ├── IDENTITY.t │ ├── INC.js │ ├── INC.t │ ├── INC_16.js │ ├── INC_16.t │ ├── INC_16_C.js │ ├── INC_16_C.t │ ├── INC_C.js │ ├── INC_C.t │ ├── JMP_C.js │ ├── JMP_C.t │ ├── JSR_C.js │ ├── JSR_C.t │ ├── LDA_C.js │ ├── LDA_C.t │ ├── LDB_C.js │ ├── LDB_C.t │ ├── LDX_C.js │ ├── LDX_C.t │ ├── LS2.js │ ├── LS2.t │ ├── LS2_C.js │ ├── LS2_C.t │ ├── LS3.js │ ├── LS3.t │ ├── LS3_C.js │ ├── LS3_C.t │ ├── LS4.js │ ├── LS4.t │ ├── LS4_C.js │ ├── LS4_C.t │ ├── MINUS_C.js │ ├── MINUS_C.t │ ├── OR_AB_FB.js │ ├── OR_AB_FB.t │ ├── OR_C.js │ ├── OR_C.t │ ├── RS1.js │ ├── RS1.t │ ├── RS1_C.js │ ├── RS1_C.t │ ├── RS5.js │ ├── RS5.t │ ├── RS5_C.js │ ├── RS5_C.t │ ├── RTS_C.js │ ├── RTS_C.t │ ├── SEA_C.js │ ├── SEA_C.t │ ├── SEB_C.js │ ├── SEB_C.t │ ├── SEX_C.js │ ├── SEX_C.t │ ├── SMN_C.js │ ├── SMN_C.t │ ├── STA_C.js │ ├── STA_C.t │ ├── STB_C.js │ ├── STB_C.t │ ├── STX_C.js │ ├── STX_C.t │ ├── SUB_AB_FB.js │ ├── SUB_AB_FB.t │ ├── SUB_C.js │ ├── SUB_C.t │ ├── SWAP.js │ ├── SWAP.t │ ├── TAX_C.js │ ├── TAX_C.t │ ├── TBX_C.js │ ├── TBX_C.t │ ├── THREE_C.js │ ├── THREE_C.t │ ├── TMX_C.js │ ├── TMX_C.t │ ├── TNX_C.js │ ├── TNX_C.t │ ├── TXA_C.js │ ├── TXA_C.t │ ├── TXB_C.js │ ├── TXB_C.t │ ├── TXM_C.js │ ├── TXM_C.t │ ├── TXN_C.js │ ├── TXN_C.t │ ├── XOR_AB_FB.js │ ├── XOR_AB_FB.t │ ├── XOR_C.js │ ├── XOR_C.t │ ├── ZERO_C.js │ ├── ZERO_C.t │ ├── adder.js │ ├── adder.t │ ├── adder2.js │ ├── adder2.t │ ├── adder4.js │ ├── adder4.t │ ├── adder8.js │ ├── adder8.t │ ├── bit0to7.js │ ├── bit0to7.t │ ├── bit7to0.js │ ├── bit7to0.t │ ├── comb15_8.js │ ├── comb15_8.t │ ├── copyABC.js │ ├── copyABC.t │ ├── copyBAC.js │ ├── copyBAC.t │ ├── copyCAB.js │ ├── copyCAB.t │ ├── copyCBA.js │ ├── copyCBA.t │ ├── func_AB_AF.js │ ├── func_AB_AF.t │ ├── func_AB_FB.js │ ├── func_AB_FB.t │ ├── i15_8.js │ ├── i15_8.t │ ├── interlacer8.js │ ├── interlacer8.t │ ├── leadBit0.js │ ├── leadBit0.t │ ├── notBit0.js │ ├── notBit0.t │ ├── shiftLeft.js │ ├── shiftLeft.t │ ├── uninterlacer8.js │ └── uninterlacer8.t │ ├── gates │ ├── intermediate │ │ ├── _andLeft.js │ │ ├── _andLeft.t │ │ ├── _andRight.js │ │ ├── _andRight.t │ │ ├── _nand.js │ │ ├── _nand.t │ │ ├── _norLeft.js │ │ ├── _norLeft.t │ │ ├── _norRight.js │ │ ├── _norRight.t │ │ ├── _notLeft.js │ │ ├── _notLeft.t │ │ ├── _notLeft2.js │ │ ├── _notLeft2.t │ │ ├── _notRight.js │ │ ├── _notRight.t │ │ ├── _notRight2.js │ │ ├── _notRight2.t │ │ ├── _xor.js │ │ └── _xor.t │ └── ordinary │ │ ├── and.js │ │ ├── and.t │ │ ├── and16.js │ │ ├── and16.t │ │ ├── and2.js │ │ ├── and2.t │ │ ├── and4.js │ │ ├── and4.t │ │ ├── and8.js │ │ ├── and8.t │ │ ├── andLeft.js │ │ ├── andLeft.t │ │ ├── andRight.js │ │ ├── andRight.t │ │ ├── buffer.js │ │ ├── buffer.t │ │ ├── buffer8.js │ │ ├── buffer8.t │ │ ├── nand.js │ │ ├── nand.t │ │ ├── nand16.js │ │ ├── nand16.t │ │ ├── nand2.js │ │ ├── nand2.t │ │ ├── nand4.js │ │ ├── nand4.t │ │ ├── nand8.js │ │ ├── nand8.t │ │ ├── nor.js │ │ ├── nor.t │ │ ├── nor16.js │ │ ├── nor16.t │ │ ├── nor2.js │ │ ├── nor2.t │ │ ├── nor4.js │ │ ├── nor4.t │ │ ├── nor8.js │ │ ├── nor8.t │ │ ├── not.js │ │ ├── not.t │ │ ├── not16.js │ │ ├── not16.t │ │ ├── not2.js │ │ ├── not2.t │ │ ├── not4.js │ │ ├── not4.t │ │ ├── not8.js │ │ ├── not8.t │ │ ├── notLeft.js │ │ ├── notLeft.t │ │ ├── notRight.js │ │ ├── notRight.t │ │ ├── or.js │ │ ├── or.t │ │ ├── or16.js │ │ ├── or16.t │ │ ├── or2.js │ │ ├── or2.t │ │ ├── or4.js │ │ ├── or4.t │ │ ├── or8.js │ │ ├── or8.t │ │ ├── xnor.js │ │ ├── xnor.t │ │ ├── xnor16.js │ │ ├── xnor16.t │ │ ├── xnor2.js │ │ ├── xnor2.t │ │ ├── xnor4.js │ │ ├── xnor4.t │ │ ├── xnor8.js │ │ ├── xnor8.t │ │ ├── xnorLeft.js │ │ ├── xnorLeft.t │ │ ├── xnorRight.js │ │ ├── xnorRight.t │ │ ├── xor.js │ │ ├── xor.t │ │ ├── xor16.js │ │ ├── xor16.t │ │ ├── xor2.js │ │ ├── xor2.t │ │ ├── xor4.js │ │ ├── xor4.t │ │ ├── xor8.js │ │ └── xor8.t │ └── logic │ ├── add.js │ ├── add.t │ ├── add16.js │ ├── add16.t │ ├── add2.js │ ├── add2.t │ ├── add4.js │ ├── add4.t │ ├── add8.js │ ├── add8.t │ ├── dec.js │ ├── dec.t │ ├── dec16.js │ ├── dec16.t │ ├── dec2.js │ ├── dec2.t │ ├── dec4.js │ ├── dec4.t │ ├── dec8.js │ ├── dec8.t │ ├── enableLeft.js │ ├── enableLeft.t │ ├── enableLeft16.js │ ├── enableLeft16.t │ ├── enableLeft2.js │ ├── enableLeft2.t │ ├── enableLeft4.js │ ├── enableLeft4.t │ ├── enableLeft8.js │ ├── enableLeft8.t │ ├── enableRight.js │ ├── enableRight.t │ ├── enableRight16.js │ ├── enableRight16.t │ ├── enableRight2.js │ ├── enableRight2.t │ ├── enableRight4.js │ ├── enableRight4.t │ ├── enableRight8.js │ ├── enableRight8.t │ ├── false.js │ ├── false.t │ ├── halfAdder.js │ ├── halfAdder.t │ ├── halfSubtractor.js │ ├── halfSubtractor.t │ ├── inc.js │ ├── inc.t │ ├── inc16.js │ ├── inc16.t │ ├── inc2.js │ ├── inc2.t │ ├── inc4.js │ ├── inc4.t │ ├── inc8.js │ ├── inc8.t │ ├── muxLeft.js │ ├── muxLeft.t │ ├── muxRight.js │ ├── muxRight.t │ ├── swap.js │ ├── swap.t │ ├── true.js │ └── true.t ├── pom.xml ├── src └── main │ ├── java │ └── tetrominocomputer │ │ ├── asm │ │ ├── Assembler.java │ │ ├── Lexer.java │ │ ├── LexerException.java │ │ ├── Operator.java │ │ ├── Token.java │ │ └── TokenType.java │ │ ├── gpc │ │ ├── app │ │ │ ├── EmulatedProcessorAndMemory.java │ │ │ ├── GeneralPurposeComputer.java │ │ │ ├── MCProcessorAndMemory.java │ │ │ └── ProcessorAndMemory.java │ │ └── ui │ │ │ ├── PlayfieldFrame.form │ │ │ ├── PlayfieldFrame.java │ │ │ ├── PlayfieldModel.java │ │ │ ├── PlayfieldPanel.form │ │ │ └── PlayfieldPanel.java │ │ ├── mc │ │ ├── CycleProgramsGenerator.java │ │ ├── Instruction.java │ │ ├── LexerParser.java │ │ ├── LexerParserException.java │ │ ├── Token.java │ │ └── TokenType.java │ │ ├── sim │ │ ├── Component.java │ │ ├── Extents.java │ │ ├── HorizontalLine.java │ │ ├── Instruction.java │ │ ├── Playfield.java │ │ ├── Point.java │ │ ├── Range.java │ │ ├── Simulator.java │ │ ├── SimulatorException.java │ │ ├── Structure.java │ │ ├── Terminal.java │ │ ├── TerminalRectangle.java │ │ ├── TerminalState.java │ │ ├── TerminalType.java │ │ └── Tetromino.java │ │ ├── ts │ │ ├── AbstractSimulator.java │ │ ├── ByteLut.java │ │ ├── ByteLutType.java │ │ ├── ComponentLut.java │ │ ├── ComponentLutType.java │ │ ├── LexerParser.java │ │ ├── LexerParserException.java │ │ ├── LutsGenerator.java │ │ ├── Tester.java │ │ ├── Token.java │ │ ├── TokenType.java │ │ └── TokenValueType.java │ │ ├── tse │ │ ├── app │ │ │ ├── BuildListener.java │ │ │ ├── Controller.java │ │ │ ├── License.java │ │ │ ├── OpenListener.java │ │ │ ├── OutputListener.java │ │ │ ├── RunListener.java │ │ │ ├── StructureListener.java │ │ │ ├── TetrominoScriptEditor.java │ │ │ └── Version.java │ │ └── ui │ │ │ ├── AboutPanel.form │ │ │ ├── AboutPanel.java │ │ │ ├── AutoCompletion.java │ │ │ ├── BlockFaces.java │ │ │ ├── CircuitsEditorPanel.form │ │ │ ├── CircuitsEditorPanel.java │ │ │ ├── CircuitsFrame.form │ │ │ ├── CircuitsFrame.java │ │ │ ├── CustomTextPane.java │ │ │ ├── FindReplacePanel.form │ │ │ ├── FindReplacePanel.java │ │ │ ├── GoToPanel.form │ │ │ ├── GoToPanel.java │ │ │ ├── HtmlExportModel.java │ │ │ ├── HtmlExportPanel.form │ │ │ ├── HtmlExportPanel.java │ │ │ ├── HtmlGenerator.java │ │ │ ├── JavaScriptDocumentFilter.java │ │ │ ├── LicensePanel.form │ │ │ ├── LicensePanel.java │ │ │ ├── LineNumberingTextArea.java │ │ │ ├── PathPoint.java │ │ │ ├── PlayfieldPanel.form │ │ │ ├── PlayfieldPanel.java │ │ │ ├── StructureRenderer.java │ │ │ ├── SvgExportModel.java │ │ │ ├── SvgExportPanel.form │ │ │ ├── SvgExportPanel.java │ │ │ ├── SvgGenerator.java │ │ │ ├── TetrominoPath.java │ │ │ ├── TetrominoRenderer.java │ │ │ ├── TetrominoScriptDocumentFilter.java │ │ │ ├── TranslatePanel.form │ │ │ ├── TranslatePanel.java │ │ │ └── WrapLayout.java │ │ └── util │ │ ├── Dirs.java │ │ ├── Js.java │ │ ├── Out.java │ │ └── Ui.java │ └── resources │ ├── icons │ ├── add.png │ ├── center-pressed.png │ ├── center-rollover.png │ ├── center.png │ ├── error.png │ ├── information.png │ ├── logo128x128.png │ ├── logo16x16.png │ ├── logo32x32.png │ ├── logo64x64.png │ ├── question.png │ ├── run.png │ └── warning.png │ ├── images │ └── logo.png │ └── license │ └── lgpl-2.1.txt ├── target └── tetromino-computer.jar └── web ├── abstract-machines.html ├── acknowledgements.html ├── add-schematic.svg ├── add.html ├── add.svg ├── adder-schematic.svg ├── and-a-b-c-schematic.svg ├── and-a-b-c.svg ├── and-a-not-b-schematic.svg ├── and-a-not-b.svg ├── and-c-a-not-b-schematic.svg ├── and-c-a-not-b.svg ├── and.html ├── and.svg ├── animated-buffer.svg ├── animated-intermediate-not-2.svg ├── animated-intermediate-not.svg ├── animated-not.svg ├── apple-touch-icon.png ├── applications.html ├── arithmetic-and-logic-instructions.html ├── assembler.html ├── assembly-language.html ├── bitwise-and-af-schematic.svg ├── bitwise-and-af.svg ├── bitwise-and-fb-schematic.svg ├── bitwise-and-fb.svg ├── bitwise-and.html ├── bitwise-or-schematic.svg ├── bitwise-or.html ├── bitwise-or.svg ├── bitwise-xor-schematic.svg ├── bitwise-xor.html ├── bitwise-xor.svg ├── boolean-circuit-nodes.svg ├── boolean-circuit.svg ├── branch-instructions.html ├── buffer.html ├── byte-copy.html ├── byte-match.html ├── byte-swap.html ├── classifier-data-to-reg-and-back.svg ├── classifier-data-to-reg.svg ├── classifier-reg-to-data.svg ├── classifier.html ├── clear.svg ├── computer-overview.html ├── conclusion.html ├── conditional-byte-copy.html ├── conditional-increment-schematic.svg ├── conditional-increment.html ├── conditional-increment.svg ├── constant-42.svg ├── constant.html ├── copy-a-b-c-schematic.svg ├── copy-a-b-c.svg ├── copy-a-b-schematic.svg ├── copy-a-b.svg ├── copy-b-a-c-schematic.svg ├── copy-b-a-c.svg ├── copy-b-a-schematic.svg ├── copy-b-a.svg ├── copy-c-a-b-schematic.svg ├── copy-c-a-b.svg ├── copy-c-b-a-schematic.svg ├── copy-c-b-a.svg ├── cross-seven.svg ├── crossing.html ├── cycle-programs-generator.html ├── decrement.html ├── decrementer-16.svg ├── decrementer-8.svg ├── decrementer-schematic.svg ├── discards-pile.svg ├── drop-interruption.svg ├── encoding-01010.svg ├── equals-a-b-and-e-schematic.svg ├── equals-a-b-and-e.svg ├── equals-a-b-e-schematic.svg ├── equals-a-b-e.svg ├── equals-e-a-b-schematic.svg ├── equals-e-a-b.svg ├── equals.html ├── example-program.html ├── example1.svg ├── example2.svg ├── example3.svg ├── false.svg ├── fan-in.html ├── fan-in.svg ├── fan-out.html ├── fan-out.svg ├── favicon.ico ├── favicon.svg ├── forty-two.svg ├── full-adder-schematic.svg ├── full-adder-x-0.svg ├── full-adder-x-1.svg ├── full-adder-x-schematic.svg ├── full.html ├── function-catalog.html ├── function-emulator.html ├── function-f-of-g.svg ├── function-f.svg ├── functions-overview.html ├── functions.html ├── fundamentals.html ├── general-purpose-computer-2.html ├── general-purpose-computer.html ├── general-purpose-computer.png ├── google-touch-icon-192.png ├── google-touch-icon-512.png ├── half-adder-schematic.svg ├── half-adder.svg ├── half-subtractor-schematic.svg ├── half-subtractor.svg ├── identity-sandwich.svg ├── identity.html ├── identity.svg ├── ils.svg ├── increment.html ├── incrementor-16.svg ├── incrementor-8.svg ├── incrementor-schematic.svg ├── index.html ├── infinite-array-abstraction.html ├── infinite-playfield.html ├── input-language.html ├── intermediate-and.svg ├── intermediate-gates.html ├── intermediate-nand.svg ├── intermediate-nor.svg ├── intermediate-xor.svg ├── introduction.html ├── inverter-not.html ├── irs.svg ├── lfsr-schematic.svg ├── load-instructions.html ├── logic-gates.html ├── logical-and-not.html ├── logical-and.html ├── logical-left-shift.html ├── logical-left-shift.svg ├── logical-right-shift.html ├── logical-right-shift.svg ├── lookup-table-generator.html ├── machine-code-padding-and-register.svg ├── manifest.json ├── mask-icon.svg ├── match-ff-left-schematic.svg ├── match-ff-right-schematic.svg ├── match-smn-right.svg ├── match-tax-right.svg ├── match-zero-left.svg ├── match-zero-right.svg ├── memory-code.html ├── memory-implementation.html ├── memory.html ├── method-overview.html ├── microcode.html ├── mnemonic-table.svg ├── multiplexing.html ├── mux-schematic.svg ├── mux.svg ├── nand-schematic.svg ├── nand.html ├── nand.svg ├── nodes.html ├── nodes.svg ├── nor.html ├── nor.svg ├── nots.svg ├── or.html ├── or.svg ├── register-a.svg ├── register-all-bytes.svg ├── register-all.svg ├── register-copy-ab-to-m.svg ├── register-copy-all.svg ├── register-copy-i-to-m.svg ├── register-copy-j-to-ab.svg ├── register-copy-jk-to-mn.svg ├── register-copy-jk-to-p-with-nz.svg ├── register-copy-jk-to-p.svg ├── register-copy-m-to-ab.svg ├── register-copy-m-to-i.svg ├── register-copy-p-to-r.svg ├── register-copy-r-to-p.svg ├── register-p.svg ├── registers.html ├── repository.html ├── sequencer.html ├── set-instructions.html ├── seven-tetrominoes.svg ├── shift-interruption.svg ├── simulator.html ├── ss-zs.svg ├── standard-playfield.svg ├── state-machine.html ├── state-machine.svg ├── store-instructions.html ├── style.css ├── subtract-schematic.svg ├── subtract.html ├── subtract.svg ├── svg.css ├── swap-8-schematic.svg ├── swap-8.svg ├── swap-memoized.svg ├── swap-schematic.svg ├── swap.svg ├── tetrominoes-table.svg ├── tetrominoscript-editor.html ├── tetrominoscript-tester.html ├── tetrominoscript.html ├── transducer.html ├── transducer.svg ├── transfer-instructions.html ├── true.svg ├── tse-cell-minus-two-zero.png ├── tse-comment.png ├── tse-depth-0.png ├── tse-depth-1.png ├── tse-depth-2.png ├── tse-depth-2a.png ├── tse-export-html.html ├── tse-export-html.png ├── tse-export-svg.html ├── tse-export-svg.png ├── tse-file-new.png ├── tse-in-a-coordinates.png ├── tse-in-a.png ├── tse-in-b.png ├── tse-input-01.png ├── tse-input-11.png ├── tse-inverters-0.png ├── tse-inverters-1.png ├── tse-inverters-2.png ├── tse-inverters-3.png ├── tse-inverters-4.png ├── tse-inverters-5.png ├── tse-inverters-6.png ├── tse-inverters-7.png ├── tse-inverters-8.png ├── tse-ir8-drag.png ├── tse-ir8-drop.png ├── tse-js.png ├── tse-nand-tutorial.html ├── tse-new-file-chooser.png ├── tse-new-result.png ├── tse-nodes.png ├── tse-not1-not2-depth-1.png ├── tse-not1-not2.png ├── tse-notleft-added.png ├── tse-notleft-drag.png ├── tse-notleft-insert.png ├── tse-notleft-select.png ├── tse-notright-appended.png ├── tse-notright-overlap.png ├── tse-notright-select.png ├── tse-notright-value.png ├── tse-or-added.png ├── tse-or-appended.png ├── tse-or-overlap.png ├── tse-or-select.png ├── tse-output-node.png ├── tse-run.html ├── tse-s7-bottom-input-1.png ├── tse-s7-bottom-input-2.png ├── tse-s7-drag.png ├── tse-s7-input-nodes.png ├── tse-s7-right-input-1.png ├── tse-s7-right-input-2.png ├── tse-status-bar.png ├── tse-swap.png ├── tse-test-failed.png ├── tse-test-fully.png ├── tse-test-passed.png ├── tse-three-wide-2.png ├── tse-three-wide.png ├── tse-toolbar.png ├── tse-translate.html ├── tse-translate.png ├── tse-user-interface.html ├── tse-wires.html ├── tse-z7.png ├── tse-zoom-32.png ├── turing-machine-definition.html ├── turing-machine-discussion.html ├── turing-machine-implementation.html ├── turing-machine.html ├── wires.html ├── xnor.html ├── xnor.svg ├── xor-schematic.svg ├── xor.html ├── xor.svg └── zeros.svg /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject/ 2 | nbactions-*.xml 3 | 4 | hs_err_pid* 5 | 6 | target/* 7 | !/target/tetromino-computer.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Project page: https://meatfighter.com/tetromino-computer -------------------------------------------------------------------------------- /code/bin/example.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/bin/example.bin -------------------------------------------------------------------------------- /code/luts/ADD_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/ADD_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/ADD_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/ADD_C.lut -------------------------------------------------------------------------------- /code/luts/AND_AB_AF.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/AND_AB_AF.lut -------------------------------------------------------------------------------- /code/luts/AND_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/AND_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/AND_A_B_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/AND_A_B_C.lut -------------------------------------------------------------------------------- /code/luts/AND_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/AND_C.lut -------------------------------------------------------------------------------- /code/luts/AND_NOT_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/AND_NOT_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/BEQ_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/BEQ_C.lut -------------------------------------------------------------------------------- /code/luts/BMI_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/BMI_C.lut -------------------------------------------------------------------------------- /code/luts/BNE_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/BNE_C.lut -------------------------------------------------------------------------------- /code/luts/BPL_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/BPL_C.lut -------------------------------------------------------------------------------- /code/luts/CLEAR.lut: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /code/luts/CMP_AND_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/CMP_AND_C.lut -------------------------------------------------------------------------------- /code/luts/CMP_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/CMP_C.lut -------------------------------------------------------------------------------- /code/luts/COPY_A_B.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/COPY_A_B.lut -------------------------------------------------------------------------------- /code/luts/COPY_A_B_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/COPY_A_B_C.lut -------------------------------------------------------------------------------- /code/luts/COPY_B_A.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/COPY_B_A.lut -------------------------------------------------------------------------------- /code/luts/COPY_B_A_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/COPY_B_A_C.lut -------------------------------------------------------------------------------- /code/luts/C_AND_A_NOT_B.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_AND_A_NOT_B.lut -------------------------------------------------------------------------------- /code/luts/C_CMP.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_CMP.lut -------------------------------------------------------------------------------- /code/luts/C_COPY_A_B.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_COPY_A_B.lut -------------------------------------------------------------------------------- /code/luts/C_COPY_B_A.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_COPY_B_A.lut -------------------------------------------------------------------------------- /code/luts/C_MINUS.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_MINUS.lut -------------------------------------------------------------------------------- /code/luts/C_ZERO.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/C_ZERO.lut -------------------------------------------------------------------------------- /code/luts/DEC.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/DEC.lut -------------------------------------------------------------------------------- /code/luts/DEC_16.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/DEC_16.lut -------------------------------------------------------------------------------- /code/luts/DEC_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/DEC_C.lut -------------------------------------------------------------------------------- /code/luts/IDENTITY.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/IDENTITY.lut -------------------------------------------------------------------------------- /code/luts/INC.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/INC.lut -------------------------------------------------------------------------------- /code/luts/INC_16.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/INC_16.lut -------------------------------------------------------------------------------- /code/luts/INC_16_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/INC_16_C.lut -------------------------------------------------------------------------------- /code/luts/INC_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/INC_C.lut -------------------------------------------------------------------------------- /code/luts/JMP_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/JMP_C.lut -------------------------------------------------------------------------------- /code/luts/JSR_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/JSR_C.lut -------------------------------------------------------------------------------- /code/luts/LDA_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LDA_C.lut -------------------------------------------------------------------------------- /code/luts/LDB_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LDB_C.lut -------------------------------------------------------------------------------- /code/luts/LDX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LDX_C.lut -------------------------------------------------------------------------------- /code/luts/LS2.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS2.lut -------------------------------------------------------------------------------- /code/luts/LS2_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS2_C.lut -------------------------------------------------------------------------------- /code/luts/LS3.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS3.lut -------------------------------------------------------------------------------- /code/luts/LS3_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS3_C.lut -------------------------------------------------------------------------------- /code/luts/LS4.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS4.lut -------------------------------------------------------------------------------- /code/luts/LS4_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/LS4_C.lut -------------------------------------------------------------------------------- /code/luts/MINUS_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/MINUS_C.lut -------------------------------------------------------------------------------- /code/luts/OR_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/OR_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/OR_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/OR_C.lut -------------------------------------------------------------------------------- /code/luts/RS1.lut: -------------------------------------------------------------------------------- 1 |  2 | 3 |  !!""##$$%%&&''(())**++,,--..//00112233445566778899::;;<<==>>??@@AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ[[\\]]^^__``aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~ -------------------------------------------------------------------------------- /code/luts/RS1_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/RS1_C.lut -------------------------------------------------------------------------------- /code/luts/RS5.lut: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /code/luts/RS5_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/RS5_C.lut -------------------------------------------------------------------------------- /code/luts/RTS_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/RTS_C.lut -------------------------------------------------------------------------------- /code/luts/SEA_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SEA_C.lut -------------------------------------------------------------------------------- /code/luts/SEB_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SEB_C.lut -------------------------------------------------------------------------------- /code/luts/SEX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SEX_C.lut -------------------------------------------------------------------------------- /code/luts/SMN_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SMN_C.lut -------------------------------------------------------------------------------- /code/luts/STA_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/STA_C.lut -------------------------------------------------------------------------------- /code/luts/STB_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/STB_C.lut -------------------------------------------------------------------------------- /code/luts/STX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/STX_C.lut -------------------------------------------------------------------------------- /code/luts/SUB_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SUB_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/SUB_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SUB_C.lut -------------------------------------------------------------------------------- /code/luts/SWAP.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/SWAP.lut -------------------------------------------------------------------------------- /code/luts/TAX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TAX_C.lut -------------------------------------------------------------------------------- /code/luts/TBX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TBX_C.lut -------------------------------------------------------------------------------- /code/luts/THREE_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/THREE_C.lut -------------------------------------------------------------------------------- /code/luts/TMX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TMX_C.lut -------------------------------------------------------------------------------- /code/luts/TNX_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TNX_C.lut -------------------------------------------------------------------------------- /code/luts/TXA_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TXA_C.lut -------------------------------------------------------------------------------- /code/luts/TXB_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TXB_C.lut -------------------------------------------------------------------------------- /code/luts/TXM_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TXM_C.lut -------------------------------------------------------------------------------- /code/luts/TXN_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/TXN_C.lut -------------------------------------------------------------------------------- /code/luts/XOR_AB_FB.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/XOR_AB_FB.lut -------------------------------------------------------------------------------- /code/luts/XOR_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/XOR_C.lut -------------------------------------------------------------------------------- /code/luts/ZERO_C.lut: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/code/luts/ZERO_C.lut -------------------------------------------------------------------------------- /code/mc/DECODE_EXECUTE_SET.mc: -------------------------------------------------------------------------------- 1 | SEA_C 12 ; s1 = (i is SEA); 2 | SWAP 15 3 | SWAP 14 4 | SWAP 3 5 | SWAP 4 6 | SWAP 5 7 | SWAP 6 8 | SWAP 7 9 | SWAP 8 10 | SWAP 9 11 | SWAP 10 12 | SWAP 11 13 | SWAP 12 14 | C_COPY_A_B 12 ; if (s1) A = j; 15 | SWAP 16 16 | SWAP 15 17 | SWAP 14 18 | SEB_C 11 ; s1 = (i is SEB); 19 | C_COPY_A_B 12 ; if (s1) B = j; 20 | SWAP 17 21 | SWAP 16 22 | SWAP 15 23 | SWAP 14 24 | SMN_C 11 ; s1 = (i is SMN); 25 | C_COPY_A_B 12 ; if (s1) M = j; 26 | SWAP 3 27 | SWAP 4 28 | SWAP 5 29 | SWAP 6 30 | SWAP 7 31 | SWAP 8 32 | SWAP 9 33 | SWAP 10 34 | SWAP 11 35 | SWAP 18 36 | SWAP 17 37 | SWAP 16 38 | SWAP 15 39 | SWAP 14 40 | SWAP 13 41 | C_COPY_A_B 11 ; if (s1) N = k; -------------------------------------------------------------------------------- /code/mc/DECODE_LOAD_STORE.mc: -------------------------------------------------------------------------------- 1 | SWAP 15 2 | SWAP 14 3 | SWAP 5 4 | SWAP 6 5 | SWAP 7 6 | SWAP 8 7 | SWAP 9 8 | SWAP 10 9 | SWAP 11 10 | SWAP 12 11 | STB_C 11 ; s1 = (i is STB); 12 | C_COPY_B_A 12 ; if (s1) m = B; 13 | SWAP 14 14 | SWAP 15 15 | SWAP 16 16 | SWAP 17 17 | SWAP 18 18 | SWAP 19 19 | SWAP 20 20 | SWAP 15 21 | SWAP 14 22 | STA_C 11 ; s1 = (i is STA); 23 | C_COPY_B_A 12 ; if (s1) m = A; 24 | SWAP 14 25 | SWAP 15 26 | SWAP 16 27 | SWAP 17 28 | SWAP 18 29 | SWAP 19 30 | SWAP 15 31 | SWAP 14 32 | SWAP 13 33 | SWAP 12 34 | SWAP 13 35 | SWAP 12 36 | SWAP 11 37 | SWAP 10 38 | SWAP 9 39 | SWAP 8 40 | SWAP 7 41 | SWAP 6 42 | SWAP 5 43 | LDB_C 12 ; d = (i is LDB); 44 | SWAP 13 45 | SWAP 14 46 | SWAP 15 47 | SWAP 16 48 | SWAP 15 49 | SWAP 14 50 | SWAP 11 51 | SWAP 10 52 | SWAP 9 53 | SWAP 8 54 | SWAP 7 55 | LDX_C 7 ; r = (i matches LD*); 56 | SWAP 6 57 | STX_C 6 ; w = (i matches ST*); 58 | SWAP 5 59 | SWAP 4 60 | SWAP 3 61 | SWAP 12 62 | SWAP 11 63 | SWAP 13 64 | SWAP 12 -------------------------------------------------------------------------------- /code/mc/EXECUTE_LOAD_STORE.mc: -------------------------------------------------------------------------------- 1 | SWAP 14 2 | SWAP 12 3 | SWAP 13 4 | CMP_C 12 ; s0 = (M == a1); 5 | SWAP 14 6 | SWAP 15 7 | CMP_AND_C 14 ; s0 &= (N == a0); 8 | SWAP 15 9 | SWAP 14 10 | SWAP 13 11 | SWAP 12 12 | SWAP 14 13 | SWAP 0 14 | SWAP 1 15 | SWAP 2 16 | SWAP 3 17 | SWAP 4 18 | COPY_B_A 11 ; s1 = s0; 19 | SWAP 10 20 | SWAP 9 21 | AND_AB_AF 8 ; s1 &= r; 22 | SWAP 8 23 | SWAP 7 24 | COPY_A_B_C 5 ; if (s1) m = I; 25 | SWAP 7 26 | SWAP 8 27 | SWAP 9 28 | SWAP 10 29 | COPY_B_A 11 ; s1 = s0; 30 | SWAP 10 31 | SWAP 9 32 | SWAP 8 33 | AND_AB_AF 7 ; s1 &= w; 34 | SWAP 7 35 | COPY_B_A_C 5 ; if (s1) I = m; 36 | SWAP 7 37 | SWAP 8 38 | SWAP 9 39 | SWAP 10 40 | SWAP 4 41 | SWAP 3 42 | SWAP 2 43 | SWAP 1 44 | SWAP 0 -------------------------------------------------------------------------------- /code/mc/FETCH.mc: -------------------------------------------------------------------------------- 1 | SWAP 12 2 | SWAP 11 3 | SWAP 10 4 | SWAP 11 5 | CMP_C 9 ; s1 = (P1 == a1); 6 | SWAP 11 7 | SWAP 10 8 | SWAP 11 9 | SWAP 12 10 | SWAP 13 11 | SWAP 12 12 | SWAP 11 13 | CMP_AND_C 10 ; s1 &= (P0 == a0); 14 | SWAP 11 15 | SWAP 12 16 | SWAP 13 17 | SWAP 10 18 | SWAP 9 19 | SWAP 8 20 | SWAP 7 21 | SWAP 6 22 | SWAP 5 23 | SWAP 4 24 | SWAP 0 25 | SWAP 1 26 | COPY_A_B_C 2 ; if (s1) i = I; 27 | SWAP 1 28 | SWAP 0 29 | SWAP 4 30 | SWAP 1 31 | SWAP 2 32 | COPY_A_B_C 3 ; if (s1) j = J; 33 | SWAP 2 34 | SWAP 1 35 | SWAP 2 36 | SWAP 3 37 | SWAP 5 38 | COPY_A_B_C 4 ; if (s1) k = K; 39 | SWAP 3 40 | SWAP 2 41 | SWAP 6 42 | SWAP 7 43 | SWAP 8 44 | SWAP 9 45 | SWAP 10 -------------------------------------------------------------------------------- /code/mc/INCREMENT_P.mc: -------------------------------------------------------------------------------- 1 | SWAP 12 2 | SWAP 13 3 | SWAP 14 4 | SWAP 11 5 | SWAP 12 6 | SWAP 3 7 | SWAP 4 8 | SWAP 5 9 | SWAP 6 10 | SWAP 7 11 | SWAP 8 12 | SWAP 9 13 | SWAP 10 14 | SWAP 11 15 | INC_16 8 ; ++P; 16 | SEX_C 12 ; s1 = (i is a 2-byte instruction); 17 | SWAP 12 18 | SWAP 11 19 | SWAP 10 20 | INC_16_C 8 ; if (s1) ++P; 21 | SWAP 10 22 | SWAP 11 23 | SWAP 12 24 | THREE_C 12 ; s1 = (i is a 3-byte instruction); 25 | SWAP 12 26 | SWAP 11 27 | SWAP 10 28 | INC_16_C 8 ; if (s1) ++P; 29 | INC_16_C 8 ; if (s1) ++P; 30 | SWAP 10 31 | SWAP 11 32 | SWAP 12 -------------------------------------------------------------------------------- /code/mc/SLIDE_STATE_REG_LEFT.mc: -------------------------------------------------------------------------------- 1 | DEC_16 13 ; --a; 2 | SWAP 2 ; swap K right 3 | SWAP 3 ; swap K right 4 | SWAP 4 ; swap K right 5 | SWAP 5 ; swap K right 6 | SWAP 6 ; swap K right 7 | SWAP 7 ; swap K right 8 | SWAP 8 ; swap K right 9 | SWAP 9 ; swap K right 10 | SWAP 10 ; swap K right 11 | SWAP 11 ; swap K right 12 | SWAP 12 ; swap K right 13 | SWAP 13 ; swap K right 14 | SWAP 14 ; swap K right 15 | SWAP 15 ; swap K right 16 | SWAP 16 ; swap K right 17 | SWAP 17 ; swap K right 18 | SWAP 18 ; swap K right 19 | SWAP 19 ; swap K right 20 | SWAP 20 ; swap K right 21 | SWAP 21 ; swap K right 22 | SWAP 22 ; swap K right -------------------------------------------------------------------------------- /code/mc/SLIDE_STATE_REG_RIGHT.mc: -------------------------------------------------------------------------------- 1 | INC_16 13 ; ++a; 2 | SWAP 23 ; swap Q left 3 | SWAP 22 ; swap Q left 4 | SWAP 21 ; swap Q left 5 | SWAP 20 ; swap Q left 6 | SWAP 19 ; swap Q left 7 | SWAP 18 ; swap Q left 8 | SWAP 17 ; swap Q left 9 | SWAP 16 ; swap Q left 10 | SWAP 15 ; swap Q left 11 | SWAP 14 ; swap Q left 12 | SWAP 13 ; swap Q left 13 | SWAP 12 ; swap Q left 14 | SWAP 11 ; swap Q left 15 | SWAP 10 ; swap Q left 16 | SWAP 9 ; swap Q left 17 | SWAP 8 ; swap Q left 18 | SWAP 7 ; swap Q left 19 | SWAP 6 ; swap Q left 20 | SWAP 5 ; swap Q left 21 | SWAP 4 ; swap Q left 22 | SWAP 3 ; swap Q left -------------------------------------------------------------------------------- /code/ts/examples/constant42.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = false; 3 | o5 = true; 4 | o4 = false; 5 | o3 = true; 6 | o2 = false; 7 | o1 = true; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/examples/constant42.t: -------------------------------------------------------------------------------- 1 | false -35 0 2 | false -25 0 3 | false -5 0 4 | false 15 0 5 | false 35 0 6 | true -15 0 7 | true 5 0 8 | true 25 0 9 | ir5 -35 12 10 | ir5 -25 12 11 | ir5 -5 12 12 | ir5 15 12 13 | ir5 35 12 14 | 15 | 16 | in i7 -35 0 17 | in i6 -25 0 18 | in i5 -15 0 19 | in i4 -5 0 20 | in i3 5 0 21 | in i2 15 0 22 | in i1 25 0 23 | in i0 35 0 24 | 25 | out o7 -35 17 26 | out o6 -25 17 27 | out o5 -16..-14 17 28 | out o4 -5 17 29 | out o3 4..6 17 30 | out o2 15 17 31 | out o1 24..26 17 32 | out o0 35 17 -------------------------------------------------------------------------------- /code/ts/examples/crossing.js: -------------------------------------------------------------------------------- 1 | o6 = i6; 2 | o5 = i5; 3 | o4 = i4; 4 | o3 = i3; 5 | o2 = i2; 6 | o1 = i1; 7 | o0 = i0; 8 | o7 = i7; -------------------------------------------------------------------------------- /code/ts/examples/crossing.t: -------------------------------------------------------------------------------- 1 | ih -33 2 | ih -30 3 | o -24 4 | swap -25 2 5 | ih -26 6 | ih -18 7 | ir24 -15 0 8 | swap -15 24 9 | ih -8 10 | ih -16 11 | il46 -5 0 12 | swap -5 46 13 | ih 2 14 | ih -6 15 | il68 5 0 16 | swap 5 68 17 | ih 12 18 | ih 4 19 | il90 15 0 20 | swap 15 90 21 | ih 22 22 | ih 14 23 | il112 25 0 24 | swap 25 112 25 | ih 32 26 | ih 24 27 | il134 35 0 28 | swap 35 134 29 | ih 34 30 | lu 34 31 | ih 42 32 | lu 44 33 | ir24 25 134 34 | ir46 15 112 35 | ir68 5 90 36 | ir90 -5 68 37 | ir112 -15 46 38 | ir134 -25 24 39 | 40 | in i7 -35 0 41 | in i6 -25 0 42 | in i5 -15 0 43 | in i4 -5 0 44 | in i3 5 0 45 | in i2 15 0 46 | in i1 25 0 47 | in i0 35 0 48 | out o6 -25 158 49 | out o5 -15 158 50 | out o4 -5 158 51 | out o3 5 158 52 | out o2 15 158 53 | out o1 25 158 54 | out o0 35 158 55 | out o7 45 158 -------------------------------------------------------------------------------- /code/ts/examples/example1.js: -------------------------------------------------------------------------------- 1 | // Example 1 -------------------------------------------------------------------------------- /code/ts/examples/example1.t: -------------------------------------------------------------------------------- 1 | td 1 2 | jd 5 3 | zh 9 4 | o 13 5 | sh 16 6 | ld 20 7 | ih 25 -------------------------------------------------------------------------------- /code/ts/examples/example2.js: -------------------------------------------------------------------------------- 1 | // Example 2 -------------------------------------------------------------------------------- /code/ts/examples/example2.t: -------------------------------------------------------------------------------- 1 | td 1 15 2 2 | jd 1 15 2 3 | zh 1 15 2 4 | o 1 15 2 5 | sh 1 15 2 6 | ld 1 15 2 7 | ih 1 15 2 -------------------------------------------------------------------------------- /code/ts/examples/example3.js: -------------------------------------------------------------------------------- 1 | // Example 3 -------------------------------------------------------------------------------- /code/ts/examples/example3.t: -------------------------------------------------------------------------------- 1 | example1 3 0 2 | example2 14 2 -------------------------------------------------------------------------------- /code/ts/examples/example3Expanded.js: -------------------------------------------------------------------------------- 1 | // Example 3 expanded -------------------------------------------------------------------------------- /code/ts/examples/example3Expanded.t: -------------------------------------------------------------------------------- 1 | # example1 3 0 2 | td 4 3 | jd 8 4 | zh 12 5 | o 16 6 | sh 19 7 | ld 23 8 | ih 28 9 | 10 | # example2 14 2 11 | td 15 17 16 12 | jd 15 17 16 13 | zh 15 17 16 14 | o 15 17 16 15 | sh 15 17 16 16 | ld 15 17 16 17 | ih 15 17 16 -------------------------------------------------------------------------------- /code/ts/examples/fanIn.js: -------------------------------------------------------------------------------- 1 | o = i7 || i6 || i5 || i4 || i3 || i2 || i1 || i0; -------------------------------------------------------------------------------- /code/ts/examples/fanIn.t: -------------------------------------------------------------------------------- 1 | iv -35 2 | iv -25 3 | iv -15 4 | iv -5 5 | iv 5 6 | iv 15 7 | iv 25 8 | iv 35 9 | zh -35 10 | zh -33 11 | zh -31 12 | zh -29 13 | zh -27 14 | zh -25 15 | zh -23 16 | zh -21 17 | zh -19 18 | zh -17 19 | zh -15 20 | zh -13 21 | zh -11 22 | zh -9 23 | zh -7 24 | zh -5 25 | zh -3 26 | zh -1 27 | zh 1 28 | zh 3 29 | zh 5 30 | zh 7 31 | zh 9 32 | zh 11 33 | zh 13 34 | zh 15 35 | zh 17 36 | zh 19 37 | zh 21 38 | zh 23 39 | zh 25 40 | zh 27 41 | zh 29 42 | zh 31 43 | zh 33 44 | zh 35 45 | iv 35 46 | 47 | in i7 -35 0 48 | in i6 -25 0 49 | in i5 -15 0 50 | in i4 -5 0 51 | in i3 5 0 52 | in i2 15 0 53 | in i1 25 0 54 | in i0 35 0 55 | out o 35 10 -------------------------------------------------------------------------------- /code/ts/examples/fanOut.js: -------------------------------------------------------------------------------- 1 | o7 = o6 = o5 = o4 = o3 = o2 = o1 = o0 = i; -------------------------------------------------------------------------------- /code/ts/examples/fanOut.t: -------------------------------------------------------------------------------- 1 | td 0 2 | z37 1 1 3 | s37 -1 1 4 | iv -35 5 | iv -25 6 | iv -15 7 | iv -5 8 | iv 5 9 | iv 15 10 | iv 25 11 | iv 35 12 | 13 | in i 0 0 14 | out o7 -35 7 15 | out o6 -25 7 16 | out o5 -15 7 17 | out o4 -5 7 18 | out o3 5 7 19 | out o2 15 7 20 | out o1 25 7 21 | out o0 35 7 -------------------------------------------------------------------------------- /code/ts/examples/fortyTwo.js: -------------------------------------------------------------------------------- 1 | o7 = o6 = o4 = o2 = o0 = false; 2 | o5 = o3 = o1 = true; -------------------------------------------------------------------------------- /code/ts/examples/fortyTwo.t: -------------------------------------------------------------------------------- 1 | ih 2 2 | ih 12 3 | ih 32 4 | ih 52 5 | ih 72 6 | o 22 7 | o 42 8 | o 62 9 | 10 | out o7 0..3 0 11 | out o6 10..13 0 12 | out o5 21..22 0 13 | out o4 30..33 0 14 | out o3 41..42 0 15 | out o2 50..53 0 16 | out o1 61..62 0 17 | out o0 70..73 0 -------------------------------------------------------------------------------- /code/ts/examples/ils.js: -------------------------------------------------------------------------------- 1 | // ils -------------------------------------------------------------------------------- /code/ts/examples/ils.t: -------------------------------------------------------------------------------- 1 | il3 -18 0 2 | il4 -14 0 3 | il5 -10 0 4 | il6 -6 0 5 | il7 -2 0 6 | il8 2 0 7 | il9 6 0 8 | il10 10 0 9 | il11 14 0 10 | il12 18 0 -------------------------------------------------------------------------------- /code/ts/examples/irs.js: -------------------------------------------------------------------------------- 1 | // irs -------------------------------------------------------------------------------- /code/ts/examples/irs.t: -------------------------------------------------------------------------------- 1 | ir3 -17 0 2 | ir4 -13 0 3 | ir5 -9 0 4 | ir6 -5 0 5 | ir7 -1 0 6 | ir8 3 0 7 | ir9 7 0 8 | ir10 11 0 9 | ir11 15 0 10 | ir12 19 0 -------------------------------------------------------------------------------- /code/ts/examples/method1.js: -------------------------------------------------------------------------------- 1 | o7 = i6; 2 | o6 = i7; 3 | o5 = i4; 4 | o4 = i5; 5 | o3 = i2; 6 | o2 = i3; 7 | o1 = i0; 8 | o0 = i1; -------------------------------------------------------------------------------- /code/ts/examples/method1.t: -------------------------------------------------------------------------------- 1 | swap -8 0 2 | swap 8 0 3 | swap -24 0 4 | swap 24 0 5 | tu -28 6 | tu -21 7 | tu -12 8 | tu -5 9 | tu 4 10 | tu 11 11 | tu 20 12 | tu 27 13 | 14 | in i7 -28 0 15 | in i6 -21 0 16 | in i5 -12 0 17 | in i4 -5 0 18 | in i3 4 0 19 | in i2 11 0 20 | in i1 20 0 21 | in i0 27 0 22 | 23 | out o7 -28 23 24 | out o6 -21 23 25 | out o5 -12 23 26 | out o4 -5 23 27 | out o3 4 23 28 | out o2 11 23 29 | out o1 20 23 30 | out o0 27 23 -------------------------------------------------------------------------------- /code/ts/examples/method2.js: -------------------------------------------------------------------------------- 1 | o7 = i6; 2 | o6 = i7; 3 | o5 = i4; 4 | o4 = i5; 5 | o3 = i2; 6 | o2 = i3; 7 | o1 = i0; 8 | o0 = i1; -------------------------------------------------------------------------------- /code/ts/examples/method2.t: -------------------------------------------------------------------------------- 1 | method1 0 0 2 | method1 0 23 3 | method1 0 46 4 | 5 | in i7 -28 0 6 | in i6 -21 0 7 | in i5 -12 0 8 | in i4 -5 0 9 | in i3 4 0 10 | in i2 11 0 11 | in i1 20 0 12 | in i0 27 0 13 | 14 | out o7 -28 69 15 | out o6 -21 69 16 | out o5 -12 69 17 | out o4 -5 69 18 | out o3 4 69 19 | out o2 11 69 20 | out o1 20 69 21 | out o0 27 69 -------------------------------------------------------------------------------- /code/ts/examples/nodes.js: -------------------------------------------------------------------------------- 1 | // Nodes -------------------------------------------------------------------------------- /code/ts/examples/nodes.t: -------------------------------------------------------------------------------- 1 | in a 0 0 2 | in b 2..4 0 3 | in c 6 0 4 | in d 7 0 5 | in e 9..10 0 12..13 0 -------------------------------------------------------------------------------- /code/ts/examples/zeros.js: -------------------------------------------------------------------------------- 1 | o7 = o6 = o5 = o4 = o3 = o2 = o1 = o0 = false; -------------------------------------------------------------------------------- /code/ts/examples/zeros.t: -------------------------------------------------------------------------------- 1 | ih 2 2 | ih 12 3 | ih 22 4 | ih 32 5 | ih 42 6 | ih 52 7 | ih 62 8 | ih 72 9 | 10 | out o7 0..3 0 11 | out o6 10..13 0 12 | out o5 20..23 0 13 | out o4 30..33 0 14 | out o3 40..43 0 15 | out o2 50..53 0 16 | out o1 60..63 0 17 | out o0 70..73 0 -------------------------------------------------------------------------------- /code/ts/functions/ADD_AB_FB.js: -------------------------------------------------------------------------------- 1 | a = 0; 2 | a <<= 1; 3 | a |= (ai7 ? 1 : 0); 4 | a <<= 1; 5 | a |= (ai6 ? 1 : 0); 6 | a <<= 1; 7 | a |= (ai5 ? 1 : 0); 8 | a <<= 1; 9 | a |= (ai4 ? 1 : 0); 10 | a <<= 1; 11 | a |= (ai3 ? 1 : 0); 12 | a <<= 1; 13 | a |= (ai2 ? 1 : 0); 14 | a <<= 1; 15 | a |= (ai1 ? 1 : 0); 16 | a <<= 1; 17 | a |= (ai0 ? 1 : 0); 18 | 19 | b = 0; 20 | b <<= 1; 21 | b |= (bi7 ? 1 : 0); 22 | b <<= 1; 23 | b |= (bi6 ? 1 : 0); 24 | b <<= 1; 25 | b |= (bi5 ? 1 : 0); 26 | b <<= 1; 27 | b |= (bi4 ? 1 : 0); 28 | b <<= 1; 29 | b |= (bi3 ? 1 : 0); 30 | b <<= 1; 31 | b |= (bi2 ? 1 : 0); 32 | b <<= 1; 33 | b |= (bi1 ? 1 : 0); 34 | b <<= 1; 35 | b |= (bi0 ? 1 : 0); 36 | 37 | s = a + b; 38 | 39 | s0 = (s & 1) != 0; 40 | s >>= 1; 41 | s1 = (s & 1) != 0; 42 | s >>= 1; 43 | s2 = (s & 1) != 0; 44 | s >>= 1; 45 | s3 = (s & 1) != 0; 46 | s >>= 1; 47 | s4 = (s & 1) != 0; 48 | s >>= 1; 49 | s5 = (s & 1) != 0; 50 | s >>= 1; 51 | s6 = (s & 1) != 0; 52 | s >>= 1; 53 | s7 = (s & 1) != 0; 54 | s >>= 1; 55 | 56 | bo7 = bi7; 57 | bo6 = bi6; 58 | bo5 = bi5; 59 | bo4 = bi4; 60 | bo3 = bi3; 61 | bo2 = bi2; 62 | bo1 = bi1; 63 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/ADD_AB_FB.t: -------------------------------------------------------------------------------- 1 | interlacer8 0 0 2 | z9 75 179 3 | false 81 181 4 | il13 -75 180 5 | il13 -65 180 6 | il13 -55 180 7 | il13 -45 180 8 | il13 -35 180 9 | il13 -25 180 10 | il13 -15 180 11 | il13 -5 180 12 | il13 5 180 13 | il13 15 180 14 | il13 25 180 15 | il13 35 180 16 | il13 45 180 17 | il13 55 180 18 | il13 65 180 19 | il12 75 181 20 | adder8 -4 193 21 | s7 79 1016 22 | s7 69 1016 23 | s7 59 1016 24 | s7 49 1016 25 | s7 39 1016 26 | s7 29 1016 27 | s7 19 1016 28 | s7 9 1016 29 | s7 -1 1016 30 | s7 -11 1016 31 | s7 -21 1016 32 | s7 -31 1016 33 | s7 -41 1016 34 | s7 -51 1016 35 | s7 -61 1016 36 | ih -73 37 | uninterlacer8 0 1018 38 | 39 | in ai7 -75 0 40 | in ai6 -65 0 41 | in ai5 -55 0 42 | in ai4 -45 0 43 | in ai3 -35 0 44 | in ai2 -25 0 45 | in ai1 -15 0 46 | in ai0 -5 0 47 | 48 | in bi7 5 0 49 | in bi6 15 0 50 | in bi5 25 0 51 | in bi4 35 0 52 | in bi3 45 0 53 | in bi2 55 0 54 | in bi1 65 0 55 | in bi0 75 0 56 | 57 | out s7 -75 1199 58 | out s6 -65 1199 59 | out s5 -55 1199 60 | out s4 -45 1199 61 | out s3 -35 1199 62 | out s2 -25 1199 63 | out s1 -15 1199 64 | out s0 -5 1199 65 | 66 | out bo7 5 1199 67 | out bo6 15 1199 68 | out bo5 25 1199 69 | out bo4 35 1199 70 | out bo3 45 1199 71 | out bo2 55 1199 72 | out bo1 65 1199 73 | out bo0 75 1199 -------------------------------------------------------------------------------- /code/ts/functions/ADD_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/AND_AB_AF.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | fo7 = ai7 && bi7; 11 | fo6 = ai6 && bi6; 12 | fo5 = ai5 && bi5; 13 | fo4 = ai4 && bi4; 14 | fo3 = ai3 && bi3; 15 | fo2 = ai2 && bi2; 16 | fo1 = ai1 && bi1; 17 | fo0 = ai0 && bi0; -------------------------------------------------------------------------------- /code/ts/functions/AND_AB_AF.t: -------------------------------------------------------------------------------- 1 | func_AB_AF 0 0 2 | and8 40 311 3 | il10 -75 311 4 | il10 -65 311 5 | il10 -55 311 6 | il10 -45 311 7 | il10 -35 311 8 | il10 -25 311 9 | il10 -15 311 10 | il10 -5 311 11 | 12 | in ai7 -75 0 13 | in ai6 -65 0 14 | in ai5 -55 0 15 | in ai4 -45 0 16 | in ai3 -35 0 17 | in ai2 -25 0 18 | in ai1 -15 0 19 | in ai0 -5 0 20 | 21 | in bi7 5 0 22 | in bi6 15 0 23 | in bi5 25 0 24 | in bi4 35 0 25 | in bi3 45 0 26 | in bi2 55 0 27 | in bi1 65 0 28 | in bi0 75 0 29 | 30 | out ao7 -75 321 31 | out ao6 -65 321 32 | out ao5 -55 321 33 | out ao4 -45 321 34 | out ao3 -35 321 35 | out ao2 -25 321 36 | out ao1 -15 321 37 | out ao0 -5 321 38 | 39 | out fo7 4..6 321 40 | out fo6 14..16 321 41 | out fo5 24..26 321 42 | out fo4 34..36 321 43 | out fo3 44..46 321 44 | out fo2 54..56 321 45 | out fo1 64..66 321 46 | out fo0 74..76 321 -------------------------------------------------------------------------------- /code/ts/functions/AND_AB_FB.js: -------------------------------------------------------------------------------- 1 | fo7 = ai7 && bi7; 2 | fo6 = ai6 && bi6; 3 | fo5 = ai5 && bi5; 4 | fo4 = ai4 && bi4; 5 | fo3 = ai3 && bi3; 6 | fo2 = ai2 && bi2; 7 | fo1 = ai1 && bi1; 8 | fo0 = ai0 && bi0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/AND_AB_FB.t: -------------------------------------------------------------------------------- 1 | func_AB_FB 0 0 2 | and8 -39 311 3 | ir10 75 311 4 | ir10 65 311 5 | ir10 55 311 6 | ir10 45 311 7 | ir10 35 311 8 | ir10 25 311 9 | ir10 15 311 10 | ir10 5 311 11 | 12 | in ai7 -75 0 13 | in ai6 -65 0 14 | in ai5 -55 0 15 | in ai4 -45 0 16 | in ai3 -35 0 17 | in ai2 -25 0 18 | in ai1 -15 0 19 | in ai0 -5 0 20 | 21 | in bi7 5 0 22 | in bi6 15 0 23 | in bi5 25 0 24 | in bi4 35 0 25 | in bi3 45 0 26 | in bi2 55 0 27 | in bi1 65 0 28 | in bi0 75 0 29 | 30 | out fo7 -75..-73 321 31 | out fo6 -65..-63 321 32 | out fo5 -55..-53 321 33 | out fo4 -45..-43 321 34 | out fo3 -35..-33 321 35 | out fo2 -25..-23 321 36 | out fo1 -15..-13 321 37 | out fo0 -5..-3 321 38 | 39 | out bo7 5 321 40 | out bo6 15 321 41 | out bo5 25 321 42 | out bo4 35 321 43 | out bo3 45 321 44 | out bo2 55 321 45 | out bo1 65 321 46 | out bo0 75 321 -------------------------------------------------------------------------------- /code/ts/functions/AND_A_B_C.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; 18 | 19 | co7 = false; 20 | co6 = false; 21 | co5 = false; 22 | co4 = false; 23 | co3 = false; 24 | co2 = false; 25 | co1 = false; 26 | co0 = ao0 && bo0; -------------------------------------------------------------------------------- /code/ts/functions/AND_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && !ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/AND_NOT_AB_FB.js: -------------------------------------------------------------------------------- 1 | ao7 = false; 2 | ao6 = false; 3 | ao5 = false; 4 | ao4 = false; 5 | ao3 = false; 6 | ao2 = false; 7 | ao1 = false; 8 | ao0 = ai0 && !bi0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/BEQ_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && !ii3 && !ii2 && ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/BMI_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && !ii3 && ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/BNE_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && !ii3 && !ii2 && ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/BPL_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && !ii3 && ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/CLEAR.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = false; 3 | o5 = false; 4 | o4 = false; 5 | o3 = false; 6 | o2 = false; 7 | o1 = false; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/functions/CLEAR.t: -------------------------------------------------------------------------------- 1 | false -35 0 2 | false -25 0 3 | false -15 0 4 | false -5 0 5 | false 5 0 6 | false 15 0 7 | false 25 0 8 | false 35 0 9 | 10 | in i7 -35 0 11 | in i6 -25 0 12 | in i5 -15 0 13 | in i4 -5 0 14 | in i3 5 0 15 | in i2 15 0 16 | in i1 25 0 17 | in i0 35 0 18 | 19 | out o7 -37..-34 12 20 | out o6 -27..-24 12 21 | out o5 -17..-14 12 22 | out o4 -7..-4 12 23 | out o3 3..6 12 24 | out o2 13..16 12 25 | out o1 23..26 12 26 | out o0 33..36 12 -------------------------------------------------------------------------------- /code/ts/functions/CMP_AND_C.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = ci0 && (ai7 == bi7) && (ai6 == bi6) && (ai5 == bi5) && (ai4 == bi4) && (ai3 == bi3) && (ai2 == bi2) && (ai1 == bi1) && (ai0 == bi0); 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; 18 | 19 | bo7 = bi7; 20 | bo6 = bi6; 21 | bo5 = bi5; 22 | bo4 = bi4; 23 | bo3 = bi3; 24 | bo2 = bi2; 25 | bo1 = bi1; 26 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/CMP_C.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = (ai7 == bi7) && (ai6 == bi6) && (ai5 == bi5) && (ai4 == bi4) && (ai3 == bi3) && (ai2 == bi2) && (ai1 == bi1) && (ai0 == bi0); 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; 18 | 19 | bo7 = bi7; 20 | bo6 = bi6; 21 | bo5 = bi5; 22 | bo4 = bi4; 23 | bo3 = bi3; 24 | bo2 = bi2; 25 | bo1 = bi1; 26 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/COPY_A_B.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = ai7; 11 | bo6 = ai6; 12 | bo5 = ai5; 13 | bo4 = ai4; 14 | bo3 = ai3; 15 | bo2 = ai2; 16 | bo1 = ai1; 17 | bo0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/COPY_A_B_C.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = ci0 ? ai7 : bi7; 11 | bo6 = ci0 ? ai6 : bi6; 12 | bo5 = ci0 ? ai5 : bi5; 13 | bo4 = ci0 ? ai4 : bi4; 14 | bo3 = ci0 ? ai3 : bi3; 15 | bo2 = ci0 ? ai2 : bi2; 16 | bo1 = ci0 ? ai1 : bi1; 17 | bo0 = ci0 ? ai0 : bi0; 18 | 19 | co7 = false; 20 | co6 = false; 21 | co5 = false; 22 | co4 = false; 23 | co3 = false; 24 | co2 = false; 25 | co1 = false; 26 | co0 = ci0; -------------------------------------------------------------------------------- /code/ts/functions/COPY_A_B_C.t: -------------------------------------------------------------------------------- 1 | bit0to7 40 0 2 | comb15_8 -80 0 3 | copyABC -40 15 4 | comb15_8 -80 694 5 | bit7to0 40 694 6 | 7 | in ai7 -115 0 8 | in ai6 -105 0 9 | in ai5 -95 0 10 | in ai4 -85 0 11 | in ai3 -75 0 12 | in ai2 -65 0 13 | in ai1 -55 0 14 | in ai0 -45 0 15 | 16 | in bi7 -35 0 17 | in bi6 -25 0 18 | in bi5 -15 0 19 | in bi4 -5 0 20 | in bi3 5 0 21 | in bi2 15 0 22 | in bi1 25 0 23 | in bi0 35 0 24 | 25 | in ci7 45 0 26 | in ci6 55 0 27 | in ci5 65 0 28 | in ci4 75 0 29 | in ci3 85 0 30 | in ci2 95 0 31 | in ci1 105 0 32 | in ci0 115 0 33 | 34 | out ao7 -115 709 35 | out ao6 -105 709 36 | out ao5 -95 709 37 | out ao4 -85 709 38 | out ao3 -75 709 39 | out ao2 -65 709 40 | out ao1 -55 709 41 | out ao0 -45 709 42 | 43 | out bo7 -35 709 44 | out bo6 -25 709 45 | out bo5 -15 709 46 | out bo4 -5 709 47 | out bo3 5 709 48 | out bo2 15 709 49 | out bo1 25 709 50 | out bo0 35 709 51 | 52 | out co7 44..47 709 53 | out co6 54..57 709 54 | out co5 64..67 709 55 | out co4 74..77 709 56 | out co3 84..87 709 57 | out co2 94..97 709 58 | out co1 104..107 709 59 | out co0 115 709 -------------------------------------------------------------------------------- /code/ts/functions/COPY_B_A.js: -------------------------------------------------------------------------------- 1 | ao7 = bi7; 2 | ao6 = bi6; 3 | ao5 = bi5; 4 | ao4 = bi4; 5 | ao3 = bi3; 6 | ao2 = bi2; 7 | ao1 = bi1; 8 | ao0 = bi0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/COPY_B_A_C.js: -------------------------------------------------------------------------------- 1 | ao7 = ci0 ? bi7 : ai7; 2 | ao6 = ci0 ? bi6 : ai6; 3 | ao5 = ci0 ? bi5 : ai5; 4 | ao4 = ci0 ? bi4 : ai4; 5 | ao3 = ci0 ? bi3 : ai3; 6 | ao2 = ci0 ? bi2 : ai2; 7 | ao1 = ci0 ? bi1 : ai1; 8 | ao0 = ci0 ? bi0 : ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; 18 | 19 | co7 = false; 20 | co6 = false; 21 | co5 = false; 22 | co4 = false; 23 | co3 = false; 24 | co2 = false; 25 | co1 = false; 26 | co0 = ci0; -------------------------------------------------------------------------------- /code/ts/functions/COPY_B_A_C.t: -------------------------------------------------------------------------------- 1 | bit0to7 40 0 2 | comb15_8 -80 0 3 | copyBAC -40 15 4 | comb15_8 -80 819 5 | bit7to0 40 819 6 | 7 | in ai7 -115 0 8 | in ai6 -105 0 9 | in ai5 -95 0 10 | in ai4 -85 0 11 | in ai3 -75 0 12 | in ai2 -65 0 13 | in ai1 -55 0 14 | in ai0 -45 0 15 | 16 | in bi7 -35 0 17 | in bi6 -25 0 18 | in bi5 -15 0 19 | in bi4 -5 0 20 | in bi3 5 0 21 | in bi2 15 0 22 | in bi1 25 0 23 | in bi0 35 0 24 | 25 | in ci7 45 0 26 | in ci6 55 0 27 | in ci5 65 0 28 | in ci4 75 0 29 | in ci3 85 0 30 | in ci2 95 0 31 | in ci1 105 0 32 | in ci0 115 0 33 | 34 | out ao7 -115 834 35 | out ao6 -105 834 36 | out ao5 -95 834 37 | out ao4 -85 834 38 | out ao3 -75 834 39 | out ao2 -65 834 40 | out ao1 -55 834 41 | out ao0 -45 834 42 | 43 | out bo7 -35 834 44 | out bo6 -25 834 45 | out bo5 -15 834 46 | out bo4 -5 834 47 | out bo3 5 834 48 | out bo2 15 834 49 | out bo1 25 834 50 | out bo0 35 834 51 | 52 | out co7 44..47 834 53 | out co6 54..57 834 54 | out co5 64..67 834 55 | out co4 74..77 834 56 | out co3 84..87 834 57 | out co2 94..97 834 58 | out co1 104..107 834 59 | out co0 115 834 -------------------------------------------------------------------------------- /code/ts/functions/C_AND_A_NOT_B.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = ai0 && !bi0; 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; 18 | 19 | bo7 = bi7; 20 | bo6 = bi6; 21 | bo5 = bi5; 22 | bo4 = bi4; 23 | bo3 = bi3; 24 | bo2 = bi2; 25 | bo1 = bi1; 26 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/C_CMP.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = (ai7 == bi7) && (ai6 == bi6) && (ai5 == bi5) && (ai4 == bi4) && (ai3 == bi3) && (ai2 == bi2) && (ai1 == bi1) && (ai0 == bi0); 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; 18 | 19 | bo7 = bi7; 20 | bo6 = bi6; 21 | bo5 = bi5; 22 | bo4 = bi4; 23 | bo3 = bi3; 24 | bo2 = bi2; 25 | bo1 = bi1; 26 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/C_COPY_A_B.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = ci0; 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; 18 | 19 | bo7 = ci0 ? ai7 : bi7; 20 | bo6 = ci0 ? ai6 : bi6; 21 | bo5 = ci0 ? ai5 : bi5; 22 | bo4 = ci0 ? ai4 : bi4; 23 | bo3 = ci0 ? ai3 : bi3; 24 | bo2 = ci0 ? ai2 : bi2; 25 | bo1 = ci0 ? ai1 : bi1; 26 | bo0 = ci0 ? ai0 : bi0; -------------------------------------------------------------------------------- /code/ts/functions/C_COPY_B_A.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = ci0; 9 | 10 | ao7 = ci0 ? bi7 : ai7; 11 | ao6 = ci0 ? bi6 : ai6; 12 | ao5 = ci0 ? bi5 : ai5; 13 | ao4 = ci0 ? bi4 : ai4; 14 | ao3 = ci0 ? bi3 : ai3; 15 | ao2 = ci0 ? bi2 : ai2; 16 | ao1 = ci0 ? bi1 : ai1; 17 | ao0 = ci0 ? bi0 : ai0; 18 | 19 | bo7 = bi7; 20 | bo6 = bi6; 21 | bo5 = bi5; 22 | bo4 = bi4; 23 | bo3 = bi3; 24 | bo2 = bi2; 25 | bo1 = bi1; 26 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/C_MINUS.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = ai7; 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/C_MINUS.t: -------------------------------------------------------------------------------- 1 | o 6 2 | s81 5 1 3 | false -75 3 4 | false -65 3 5 | false -55 3 6 | false -45 3 7 | false -35 3 8 | false -25 3 9 | false -15 3 10 | ir12 -5 3 11 | ir12 5 3 12 | ir15 15 0 13 | ir15 25 0 14 | ir15 35 0 15 | ir15 45 0 16 | ir15 55 0 17 | ir15 65 0 18 | ir15 75 0 19 | 20 | in ci7 -75 0 21 | in ci6 -65 0 22 | in ci5 -55 0 23 | in ci4 -45 0 24 | in ci3 -35 0 25 | in ci2 -25 0 26 | in ci1 -15 0 27 | in ci0 -5 0 28 | 29 | in ai7 5 0 30 | in ai6 15 0 31 | in ai5 25 0 32 | in ai4 35 0 33 | in ai3 45 0 34 | in ai2 55 0 35 | in ai1 65 0 36 | in ai0 75 0 37 | 38 | out co7 -77..-74 15 39 | out co6 -67..-64 15 40 | out co5 -57..-54 15 41 | out co4 -47..-44 15 42 | out co3 -37..-34 15 43 | out co2 -27..-24 15 44 | out co1 -17..-14 15 45 | out co0 -5 15 46 | 47 | out ao7 5 15 48 | out ao6 15 15 49 | out ao5 25 15 50 | out ao4 35 15 51 | out ao3 45 15 52 | out ao2 55 15 53 | out ao1 65 15 54 | out ao0 75 15 55 | -------------------------------------------------------------------------------- /code/ts/functions/C_ZERO.js: -------------------------------------------------------------------------------- 1 | co7 = false; 2 | co6 = false; 3 | co5 = false; 4 | co4 = false; 5 | co3 = false; 6 | co2 = false; 7 | co1 = false; 8 | co0 = !ai7 && !ai6 && !ai5 && !ai4 && !ai3 && !ai2 && !ai1 && !ai0; 9 | 10 | ao7 = ai7; 11 | ao6 = ai6; 12 | ao5 = ai5; 13 | ao4 = ai4; 14 | ao3 = ai3; 15 | ao2 = ai2; 16 | ao1 = ai1; 17 | ao0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/DEC.js: -------------------------------------------------------------------------------- 1 | i = i7 ? 1 : 0; 2 | i <<= 1; 3 | i |= i6 ? 1 : 0; 4 | i <<= 1; 5 | i |= i5 ? 1 : 0; 6 | i <<= 1; 7 | i |= i4 ? 1 : 0; 8 | i <<= 1; 9 | i |= i3 ? 1 : 0; 10 | i <<= 1; 11 | i |= i2 ? 1 : 0; 12 | i <<= 1; 13 | i |= i1 ? 1 : 0; 14 | i <<= 1; 15 | i |= i0 ? 1 : 0; 16 | 17 | --i; 18 | 19 | o0 = (i & 1) != 0; 20 | i >>= 1; 21 | o1 = (i & 1) != 0; 22 | i >>= 1; 23 | o2 = (i & 1) != 0; 24 | i >>= 1; 25 | o3 = (i & 1) != 0; 26 | i >>= 1; 27 | o4 = (i & 1) != 0; 28 | i >>= 1; 29 | o5 = (i & 1) != 0; 30 | i >>= 1; 31 | o6 = (i & 1) != 0; 32 | i >>= 1; 33 | o7 = (i & 1) != 0; -------------------------------------------------------------------------------- /code/ts/functions/DEC.t: -------------------------------------------------------------------------------- 1 | o 36 2 | ih 38 3 | true 41 3 4 | ir18 35 2 5 | ir20 25 0 6 | ir20 15 0 7 | ir20 5 0 8 | ir20 -5 0 9 | ir20 -15 0 10 | ir20 -25 0 11 | ir20 -35 0 12 | dec8 2 20 13 | 14 | in i7 -35 0 15 | in i6 -25 0 16 | in i5 -15 0 17 | in i4 -5 0 18 | in i3 5 0 19 | in i2 15 0 20 | in i1 25 0 21 | in i0 35 0 22 | 23 | out o7 -35 132 24 | out o6 -25 132 25 | out o5 -15 132 26 | out o4 -5 132 27 | out o3 5 132 28 | out o2 15 132 29 | out o1 25 132 30 | out o0 35 132 -------------------------------------------------------------------------------- /code/ts/functions/DEC_16.js: -------------------------------------------------------------------------------- 1 | v = 0; 2 | v |= i15 ? 1 : 0; 3 | v <<= 1; 4 | v |= i14 ? 1 : 0; 5 | v <<= 1; 6 | v |= i13 ? 1 : 0; 7 | v <<= 1; 8 | v |= i12 ? 1 : 0; 9 | v <<= 1; 10 | v |= i11 ? 1 : 0; 11 | v <<= 1; 12 | v |= i10 ? 1 : 0; 13 | v <<= 1; 14 | v |= i9 ? 1 : 0; 15 | v <<= 1; 16 | v |= i8 ? 1 : 0; 17 | v <<= 1; 18 | v |= i7 ? 1 : 0; 19 | v <<= 1; 20 | v |= i6 ? 1 : 0; 21 | v <<= 1; 22 | v |= i5 ? 1 : 0; 23 | v <<= 1; 24 | v |= i4 ? 1 : 0; 25 | v <<= 1; 26 | v |= i3 ? 1 : 0; 27 | v <<= 1; 28 | v |= i2 ? 1 : 0; 29 | v <<= 1; 30 | v |= i1 ? 1 : 0; 31 | v <<= 1; 32 | v |= i0 ? 1 : 0; 33 | 34 | --v; 35 | 36 | o0 = (v & 1) != 0; 37 | v >>= 1; 38 | o1 = (v & 1) != 0; 39 | v >>= 1; 40 | o2 = (v & 1) != 0; 41 | v >>= 1; 42 | o3 = (v & 1) != 0; 43 | v >>= 1; 44 | o4 = (v & 1) != 0; 45 | v >>= 1; 46 | o5 = (v & 1) != 0; 47 | v >>= 1; 48 | o6 = (v & 1) != 0; 49 | v >>= 1; 50 | o7 = (v & 1) != 0; 51 | v >>= 1; 52 | o8 = (v & 1) != 0; 53 | v >>= 1; 54 | o9 = (v & 1) != 0; 55 | v >>= 1; 56 | o10 = (v & 1) != 0; 57 | v >>= 1; 58 | o11 = (v & 1) != 0; 59 | v >>= 1; 60 | o12 = (v & 1) != 0; 61 | v >>= 1; 62 | o13 = (v & 1) != 0; 63 | v >>= 1; 64 | o14 = (v & 1) != 0; 65 | v >>= 1; 66 | o15 = (v & 1) != 0; -------------------------------------------------------------------------------- /code/ts/functions/DEC_16.t: -------------------------------------------------------------------------------- 1 | o 76 2 | ih 78 3 | true 81 3 4 | ir18 75 2 5 | ir20 65 0 6 | ir20 55 0 7 | ir20 45 0 8 | ir20 35 0 9 | ir20 25 0 10 | ir20 15 0 11 | ir20 5 0 12 | ir20 -5 0 13 | ir20 -15 0 14 | ir20 -25 0 15 | ir20 -35 0 16 | ir20 -45 0 17 | ir20 -55 0 18 | ir20 -65 0 19 | ir20 -75 0 20 | dec16 2 20 21 | 22 | in i15 -75 0 23 | in i14 -65 0 24 | in i13 -55 0 25 | in i12 -45 0 26 | in i11 -35 0 27 | in i10 -25 0 28 | in i9 -15 0 29 | in i8 -5 0 30 | in i7 5 0 31 | in i6 15 0 32 | in i5 25 0 33 | in i4 35 0 34 | in i3 45 0 35 | in i2 55 0 36 | in i1 65 0 37 | in i0 75 0 38 | 39 | out o15 -75 244 40 | out o14 -65 244 41 | out o13 -55 244 42 | out o12 -45 244 43 | out o11 -35 244 44 | out o10 -25 244 45 | out o9 -15 244 46 | out o8 -5 244 47 | out o7 5 244 48 | out o6 15 244 49 | out o5 25 244 50 | out o4 35 244 51 | out o3 45 244 52 | out o2 55 244 53 | out o1 65 244 54 | out o0 75 244 -------------------------------------------------------------------------------- /code/ts/functions/DEC_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && !ii2 && ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/IDENTITY.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; -------------------------------------------------------------------------------- /code/ts/functions/IDENTITY.t: -------------------------------------------------------------------------------- 1 | il32 -35 0 2 | il32 -25 0 3 | il32 -15 0 4 | il32 -5 0 5 | il32 5 0 6 | il32 15 0 7 | il32 25 0 8 | il32 35 0 9 | 10 | in i7 -35 0 11 | in i6 -25 0 12 | in i5 -15 0 13 | in i4 -5 0 14 | in i3 5 0 15 | in i2 15 0 16 | in i1 25 0 17 | in i0 35 0 18 | 19 | out o7 -35 32 20 | out o6 -25 32 21 | out o5 -15 32 22 | out o4 -5 32 23 | out o3 5 32 24 | out o2 15 32 25 | out o1 25 32 26 | out o0 35 32 -------------------------------------------------------------------------------- /code/ts/functions/INC.js: -------------------------------------------------------------------------------- 1 | i = i7 ? 1 : 0; 2 | i <<= 1; 3 | i |= i6 ? 1 : 0; 4 | i <<= 1; 5 | i |= i5 ? 1 : 0; 6 | i <<= 1; 7 | i |= i4 ? 1 : 0; 8 | i <<= 1; 9 | i |= i3 ? 1 : 0; 10 | i <<= 1; 11 | i |= i2 ? 1 : 0; 12 | i <<= 1; 13 | i |= i1 ? 1 : 0; 14 | i <<= 1; 15 | i |= i0 ? 1 : 0; 16 | 17 | ++i; 18 | 19 | o0 = (i & 1) != 0; 20 | i >>= 1; 21 | o1 = (i & 1) != 0; 22 | i >>= 1; 23 | o2 = (i & 1) != 0; 24 | i >>= 1; 25 | o3 = (i & 1) != 0; 26 | i >>= 1; 27 | o4 = (i & 1) != 0; 28 | i >>= 1; 29 | o5 = (i & 1) != 0; 30 | i >>= 1; 31 | o6 = (i & 1) != 0; 32 | i >>= 1; 33 | o7 = (i & 1) != 0; -------------------------------------------------------------------------------- /code/ts/functions/INC.t: -------------------------------------------------------------------------------- 1 | ih 37 2 | true 40 1 3 | ih 39 4 | ir18 35 1 5 | ir19 -35 0 6 | ir19 -25 0 7 | ir19 -15 0 8 | ir19 -5 0 9 | ir19 5 0 10 | ir19 15 0 11 | ir19 25 0 12 | inc8 0 19 13 | 14 | in i7 -35 0 15 | in i6 -25 0 16 | in i5 -15 0 17 | in i4 -5 0 18 | in i3 5 0 19 | in i2 15 0 20 | in i1 25 0 21 | in i0 35 0 22 | 23 | out o7 -35 371 24 | out o6 -25 371 25 | out o5 -15 371 26 | out o4 -5 371 27 | out o3 5 371 28 | out o2 15 371 29 | out o1 25 371 30 | out o0 35 371 -------------------------------------------------------------------------------- /code/ts/functions/INC_16.js: -------------------------------------------------------------------------------- 1 | v = 0; 2 | v |= i15 ? 1 : 0; 3 | v <<= 1; 4 | v |= i14 ? 1 : 0; 5 | v <<= 1; 6 | v |= i13 ? 1 : 0; 7 | v <<= 1; 8 | v |= i12 ? 1 : 0; 9 | v <<= 1; 10 | v |= i11 ? 1 : 0; 11 | v <<= 1; 12 | v |= i10 ? 1 : 0; 13 | v <<= 1; 14 | v |= i9 ? 1 : 0; 15 | v <<= 1; 16 | v |= i8 ? 1 : 0; 17 | v <<= 1; 18 | v |= i7 ? 1 : 0; 19 | v <<= 1; 20 | v |= i6 ? 1 : 0; 21 | v <<= 1; 22 | v |= i5 ? 1 : 0; 23 | v <<= 1; 24 | v |= i4 ? 1 : 0; 25 | v <<= 1; 26 | v |= i3 ? 1 : 0; 27 | v <<= 1; 28 | v |= i2 ? 1 : 0; 29 | v <<= 1; 30 | v |= i1 ? 1 : 0; 31 | v <<= 1; 32 | v |= i0 ? 1 : 0; 33 | 34 | ++v; 35 | 36 | o0 = (v & 1) != 0; 37 | v >>= 1; 38 | o1 = (v & 1) != 0; 39 | v >>= 1; 40 | o2 = (v & 1) != 0; 41 | v >>= 1; 42 | o3 = (v & 1) != 0; 43 | v >>= 1; 44 | o4 = (v & 1) != 0; 45 | v >>= 1; 46 | o5 = (v & 1) != 0; 47 | v >>= 1; 48 | o6 = (v & 1) != 0; 49 | v >>= 1; 50 | o7 = (v & 1) != 0; 51 | v >>= 1; 52 | o8 = (v & 1) != 0; 53 | v >>= 1; 54 | o9 = (v & 1) != 0; 55 | v >>= 1; 56 | o10 = (v & 1) != 0; 57 | v >>= 1; 58 | o11 = (v & 1) != 0; 59 | v >>= 1; 60 | o12 = (v & 1) != 0; 61 | v >>= 1; 62 | o13 = (v & 1) != 0; 63 | v >>= 1; 64 | o14 = (v & 1) != 0; 65 | v >>= 1; 66 | o15 = (v & 1) != 0; -------------------------------------------------------------------------------- /code/ts/functions/INC_16.t: -------------------------------------------------------------------------------- 1 | ih 77 2 | true 80 1 3 | ju 78 4 | ir19 75 1 5 | ir20 65 0 6 | ir20 55 0 7 | ir20 45 0 8 | ir20 35 0 9 | ir20 25 0 10 | ir20 15 0 11 | ir20 5 0 12 | ir20 -5 0 13 | ir20 -15 0 14 | ir20 -25 0 15 | ir20 -35 0 16 | ir20 -45 0 17 | ir20 -55 0 18 | ir20 -65 0 19 | ir20 -75 0 20 | inc16 0 20 21 | 22 | in i15 -75 0 23 | in i14 -65 0 24 | in i13 -55 0 25 | in i12 -45 0 26 | in i11 -35 0 27 | in i10 -25 0 28 | in i9 -15 0 29 | in i8 -5 0 30 | in i7 5 0 31 | in i6 15 0 32 | in i5 25 0 33 | in i4 35 0 34 | in i3 45 0 35 | in i2 55 0 36 | in i1 65 0 37 | in i0 75 0 38 | 39 | out o15 -75 724 40 | out o14 -65 724 41 | out o13 -55 724 42 | out o12 -45 724 43 | out o11 -35 724 44 | out o10 -25 724 45 | out o9 -15 724 46 | out o8 -5 724 47 | out o7 5 724 48 | out o6 15 724 49 | out o5 25 724 50 | out o4 35 724 51 | out o3 45 724 52 | out o2 55 724 53 | out o1 65 724 54 | out o0 75 724 -------------------------------------------------------------------------------- /code/ts/functions/INC_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && !ii2 && ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/JMP_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/JSR_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/LDA_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && !ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/LDB_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && !ii4 && !ii3 && !ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/LDX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && !ii4 && !ii3 && !ii2 && !ii1; -------------------------------------------------------------------------------- /code/ts/functions/LS2.js: -------------------------------------------------------------------------------- 1 | o7 = i5; 2 | o6 = i4; 3 | o5 = i3; 4 | o4 = i2; 5 | o3 = i1; 6 | o2 = i0; 7 | o1 = false; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/functions/LS2.t: -------------------------------------------------------------------------------- 1 | shiftLeft 0 0 2 | shiftLeft 0 33 3 | 4 | in i7 -35 0 5 | in i6 -25 0 6 | in i5 -15 0 7 | in i4 -5 0 8 | in i3 5 0 9 | in i2 15 0 10 | in i1 25 0 11 | in i0 35 0 12 | 13 | out o7 -35 66 14 | out o6 -25 66 15 | out o5 -15 66 16 | out o4 -5 66 17 | out o3 5 66 18 | out o2 15 66 19 | out o1 25 66 20 | out o0 33..36 66 -------------------------------------------------------------------------------- /code/ts/functions/LS2_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/LS3.js: -------------------------------------------------------------------------------- 1 | o7 = i4; 2 | o6 = i3; 3 | o5 = i2; 4 | o4 = i1; 5 | o3 = i0; 6 | o2 = false; 7 | o1 = false; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/functions/LS3.t: -------------------------------------------------------------------------------- 1 | LS2 0 0 2 | shiftLeft 0 66 3 | 4 | in i7 -35 0 5 | in i6 -25 0 6 | in i5 -15 0 7 | in i4 -5 0 8 | in i3 5 0 9 | in i2 15 0 10 | in i1 25 0 11 | in i0 35 0 12 | 13 | out o7 -35 99 14 | out o6 -25 99 15 | out o5 -15 99 16 | out o4 -5 99 17 | out o3 5 99 18 | out o2 15 99 19 | out o1 25 99 20 | out o0 33..36 99 -------------------------------------------------------------------------------- /code/ts/functions/LS3_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/LS4.js: -------------------------------------------------------------------------------- 1 | o7 = i3; 2 | o6 = i2; 3 | o5 = i1; 4 | o4 = i0; 5 | o3 = false; 6 | o2 = false; 7 | o1 = false; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/functions/LS4.t: -------------------------------------------------------------------------------- 1 | LS2 0 0 2 | LS2 0 66 3 | 4 | in i7 -35 0 5 | in i6 -25 0 6 | in i5 -15 0 7 | in i4 -5 0 8 | in i3 5 0 9 | in i2 15 0 10 | in i1 25 0 11 | in i0 35 0 12 | 13 | out o7 -35 132 14 | out o6 -25 132 15 | out o5 -15 132 16 | out o4 -5 132 17 | out o3 5 132 18 | out o2 15 132 19 | out o1 25 132 20 | out o0 33..36 132 -------------------------------------------------------------------------------- /code/ts/functions/LS4_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && ii2 && ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/MINUS_C.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = ai7; -------------------------------------------------------------------------------- /code/ts/functions/OR_AB_FB.js: -------------------------------------------------------------------------------- 1 | fo7 = ai7 || bi7; 2 | fo6 = ai6 || bi6; 3 | fo5 = ai5 || bi5; 4 | fo4 = ai4 || bi4; 5 | fo3 = ai3 || bi3; 6 | fo2 = ai2 || bi2; 7 | fo1 = ai1 || bi1; 8 | fo0 = ai0 || bi0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/OR_AB_FB.t: -------------------------------------------------------------------------------- 1 | func_AB_FB 0 0 2 | or8 -39 311 3 | ju 6 4 | ju 16 5 | ju 26 6 | ju 36 7 | ju 46 8 | ju 56 9 | ju 66 10 | lu 74 11 | 12 | in ai7 -75 0 13 | in ai6 -65 0 14 | in ai5 -55 0 15 | in ai4 -45 0 16 | in ai3 -35 0 17 | in ai2 -25 0 18 | in ai1 -15 0 19 | in ai0 -5 0 20 | 21 | in bi7 5 0 22 | in bi6 15 0 23 | in bi5 25 0 24 | in bi4 35 0 25 | in bi3 45 0 26 | in bi2 55 0 27 | in bi1 65 0 28 | in bi0 75 0 29 | 30 | out fo7 -75..-74 313 31 | out fo6 -65..-64 313 32 | out fo5 -55..-54 313 33 | out fo4 -45..-44 313 34 | out fo3 -35..-34 313 35 | out fo2 -25..-24 313 36 | out fo1 -15..-14 313 37 | out fo0 -5..-4 313 38 | 39 | out bo7 5 313 40 | out bo6 15 313 41 | out bo5 25 313 42 | out bo4 35 313 43 | out bo3 45 313 44 | out bo2 55 313 45 | out bo1 65 313 46 | out bo0 75 313 -------------------------------------------------------------------------------- /code/ts/functions/OR_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && !ii3 && ii2 && ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/RS1.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = i7; 3 | o5 = i6; 4 | o4 = i5; 5 | o3 = i4; 6 | o2 = i3; 7 | o1 = i2; 8 | o0 = i1; -------------------------------------------------------------------------------- /code/ts/functions/RS1.t: -------------------------------------------------------------------------------- 1 | o 25 2 | z11 25 1 3 | ir5 15 0 4 | z11 15 4 5 | ir8 5 0 6 | z11 5 7 7 | ir11 -5 0 8 | z11 -5 10 9 | ir14 -15 0 10 | z11 -15 13 11 | ir17 -25 0 12 | z11 -25 16 13 | ir20 -35 0 14 | z11 -35 19 15 | false -35 21 16 | il13 -25 20 17 | il16 -15 17 18 | il19 -5 14 19 | il22 5 11 20 | il25 15 8 21 | il28 25 5 22 | il31 35 2 23 | 24 | in i7 -35 0 25 | in i6 -25 0 26 | in i5 -15 0 27 | in i4 -5 0 28 | in i3 5 0 29 | in i2 15 0 30 | in i1 25 0 31 | in i0 35 0 32 | 33 | out o7 -37..-34 33 34 | out o6 -25 33 35 | out o5 -15 33 36 | out o4 -5 33 37 | out o3 5 33 38 | out o2 15 33 39 | out o1 25 33 40 | out o0 35 33 -------------------------------------------------------------------------------- /code/ts/functions/RS1_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/RS5.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = false; 3 | o5 = false; 4 | o4 = false; 5 | o3 = false; 6 | o2 = i7; 7 | o1 = i6; 8 | o0 = i5; -------------------------------------------------------------------------------- /code/ts/functions/RS5.t: -------------------------------------------------------------------------------- 1 | RS1 0 0 2 | RS1 0 33 3 | RS1 0 66 4 | RS1 0 99 5 | RS1 0 132 6 | 7 | in i7 -35 0 8 | in i6 -25 0 9 | in i5 -15 0 10 | in i4 -5 0 11 | in i3 5 0 12 | in i2 15 0 13 | in i1 25 0 14 | in i0 35 0 15 | 16 | out o7 -37..-34 165 17 | out o6 -25 165 18 | out o5 -15 165 19 | out o4 -5 165 20 | out o3 5 165 21 | out o2 15 165 22 | out o1 25 165 23 | out o0 35 165 -------------------------------------------------------------------------------- /code/ts/functions/RS5_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && ii3 && !ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/RTS_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && ii5 && ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/SEA_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/SEB_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && ii4 && !ii3 && !ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/SEX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && ii6 && !ii5 && ii4 && !ii3 && !ii2 && !ii1; -------------------------------------------------------------------------------- /code/ts/functions/SMN_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4 && ii3 && ii2 && ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/STA_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && ii4 && !ii3 && !ii2 && !ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/STB_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && ii4 && !ii3 && !ii2 && !ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/STX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && ii4 && !ii3 && !ii2 && !ii1; -------------------------------------------------------------------------------- /code/ts/functions/SUB_AB_FB.js: -------------------------------------------------------------------------------- 1 | a = 0; 2 | a <<= 1; 3 | a |= (ai7 ? 1 : 0); 4 | a <<= 1; 5 | a |= (ai6 ? 1 : 0); 6 | a <<= 1; 7 | a |= (ai5 ? 1 : 0); 8 | a <<= 1; 9 | a |= (ai4 ? 1 : 0); 10 | a <<= 1; 11 | a |= (ai3 ? 1 : 0); 12 | a <<= 1; 13 | a |= (ai2 ? 1 : 0); 14 | a <<= 1; 15 | a |= (ai1 ? 1 : 0); 16 | a <<= 1; 17 | a |= (ai0 ? 1 : 0); 18 | 19 | b = 0; 20 | b <<= 1; 21 | b |= (bi7 ? 1 : 0); 22 | b <<= 1; 23 | b |= (bi6 ? 1 : 0); 24 | b <<= 1; 25 | b |= (bi5 ? 1 : 0); 26 | b <<= 1; 27 | b |= (bi4 ? 1 : 0); 28 | b <<= 1; 29 | b |= (bi3 ? 1 : 0); 30 | b <<= 1; 31 | b |= (bi2 ? 1 : 0); 32 | b <<= 1; 33 | b |= (bi1 ? 1 : 0); 34 | b <<= 1; 35 | b |= (bi0 ? 1 : 0); 36 | 37 | d = a - b; 38 | 39 | d0 = (d & 1) != 0; 40 | d >>= 1; 41 | d1 = (d & 1) != 0; 42 | d >>= 1; 43 | d2 = (d & 1) != 0; 44 | d >>= 1; 45 | d3 = (d & 1) != 0; 46 | d >>= 1; 47 | d4 = (d & 1) != 0; 48 | d >>= 1; 49 | d5 = (d & 1) != 0; 50 | d >>= 1; 51 | d6 = (d & 1) != 0; 52 | d >>= 1; 53 | d7 = (d & 1) != 0; 54 | d >>= 1; 55 | 56 | bo7 = bi7; 57 | bo6 = bi6; 58 | bo5 = bi5; 59 | bo4 = bi4; 60 | bo3 = bi3; 61 | bo2 = bi2; 62 | bo1 = bi1; 63 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/SUB_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && ii3 && !ii2 && ii1 && !ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/SWAP.js: -------------------------------------------------------------------------------- 1 | ao7 = bi7; 2 | ao6 = bi6; 3 | ao5 = bi5; 4 | ao4 = bi4; 5 | ao3 = bi3; 6 | ao2 = bi2; 7 | ao1 = bi1; 8 | ao0 = bi0; 9 | 10 | bo7 = ai7; 11 | bo6 = ai6; 12 | bo5 = ai5; 13 | bo4 = ai4; 14 | bo3 = ai3; 15 | bo2 = ai2; 16 | bo1 = ai1; 17 | bo0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/TAX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && !ii3 && !ii2; -------------------------------------------------------------------------------- /code/ts/functions/TBX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && !ii3 && ii2; -------------------------------------------------------------------------------- /code/ts/functions/THREE_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && ii5 && !ii4; -------------------------------------------------------------------------------- /code/ts/functions/TMX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && ii3 && !ii2; -------------------------------------------------------------------------------- /code/ts/functions/TNX_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && ii3 && ii2; -------------------------------------------------------------------------------- /code/ts/functions/TXA_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && !ii1 && !ii0; -------------------------------------------------------------------------------- /code/ts/functions/TXB_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && !ii1 && ii0; -------------------------------------------------------------------------------- /code/ts/functions/TXM_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && ii1 && !ii0; -------------------------------------------------------------------------------- /code/ts/functions/TXN_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && ii1 && ii0; -------------------------------------------------------------------------------- /code/ts/functions/XOR_AB_FB.js: -------------------------------------------------------------------------------- 1 | fo7 = ai7 != bi7; 2 | fo6 = ai6 != bi6; 3 | fo5 = ai5 != bi5; 4 | fo4 = ai4 != bi4; 5 | fo3 = ai3 != bi3; 6 | fo2 = ai2 != bi2; 7 | fo1 = ai1 != bi1; 8 | fo0 = ai0 != bi0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/XOR_AB_FB.t: -------------------------------------------------------------------------------- 1 | func_AB_FB 0 0 2 | xor8 -39 311 3 | il11 5 311 4 | il11 15 311 5 | il11 25 311 6 | il11 35 311 7 | il11 45 311 8 | il11 55 311 9 | il11 65 311 10 | ir11 75 311 11 | 12 | 13 | in ai7 -75 0 14 | in ai6 -65 0 15 | in ai5 -55 0 16 | in ai4 -45 0 17 | in ai3 -35 0 18 | in ai2 -25 0 19 | in ai1 -15 0 20 | in ai0 -5 0 21 | 22 | in bi7 5 0 23 | in bi6 15 0 24 | in bi5 25 0 25 | in bi4 35 0 26 | in bi3 45 0 27 | in bi2 55 0 28 | in bi1 65 0 29 | in bi0 75 0 30 | 31 | out fo7 -76..-73 322 32 | out fo6 -66..-63 322 33 | out fo5 -56..-53 322 34 | out fo4 -46..-43 322 35 | out fo3 -36..-33 322 36 | out fo2 -26..-23 322 37 | out fo1 -16..-13 322 38 | out fo0 -6..-3 322 39 | 40 | out bo7 5 322 41 | out bo6 15 322 42 | out bo5 25 322 43 | out bo4 35 322 44 | out bo3 45 322 45 | out bo2 55 322 46 | out bo1 65 322 47 | out bo0 75 322 -------------------------------------------------------------------------------- /code/ts/functions/XOR_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && ii4 && ii3 && !ii2 && ii1 && ii0; 18 | -------------------------------------------------------------------------------- /code/ts/functions/ZERO_C.js: -------------------------------------------------------------------------------- 1 | io7 = ii7; 2 | io6 = ii6; 3 | io5 = ii5; 4 | io4 = ii4; 5 | io3 = ii3; 6 | io2 = ii2; 7 | io1 = ii1; 8 | io0 = ii0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = !ii7 && !ii6 && !ii5 && !ii4 && !ii3 && !ii2 && !ii1 && !ii0; -------------------------------------------------------------------------------- /code/ts/functions/adder.js: -------------------------------------------------------------------------------- 1 | sum = (ai ? 1 : 0) + (bi ? 1 : 0) + (ci ? 1 : 0); 2 | co = ((sum >> 1) & 1) != 0; 3 | ao = ai; 4 | s = (sum & 1) != 0; -------------------------------------------------------------------------------- /code/ts/functions/adder.t: -------------------------------------------------------------------------------- 1 | ih 6 2 | ih -4 3 | s7 -6 0 4 | z5 -3 0 5 | ih 3 6 | ih 7 7 | nor 5 2 8 | ir5 8 2 9 | nor 7 7 10 | il9 -5 1 11 | ih 3 12 | ju 0 13 | swap -3 10 14 | ir24 5 7 15 | o 3 16 | o 5 17 | nor 4 33 18 | ir27 8 12 19 | ih 5 20 | nor 7 39 21 | ir43 12 0 22 | lu 11 23 | iv 12 24 | nor 9 44 25 | nor 11 49 26 | s9 6 43 27 | ir7 -2 44 28 | ih 7 29 | ih 4 30 | swap 1 51 31 | ir24 9 49 32 | ih 6 33 | nor 8 73 34 | ir25 12 54 35 | ih 9 36 | nor 11 79 37 | ir42 -8 31 38 | ih -4 39 | nor -7 73 40 | ir76 -12 1 41 | ih -10 42 | jr -9 43 | ih -4 44 | o -3 45 | swap -4 81 46 | ir19 11 84 47 | ih -8 48 | ih 0 49 | 50 | in ai -6..-3 0 51 | in bi 4..7 0 52 | in ci 11..12 0 53 | 54 | out co -10..-7 103 55 | out ao -2..1 103 56 | out s 11 103 -------------------------------------------------------------------------------- /code/ts/functions/adder2.js: -------------------------------------------------------------------------------- 1 | a = 0 2 | a = (a << 1) | (ai1 ? 1 : 0); 3 | a = (a << 1) | (ai0 ? 1 : 0); 4 | 5 | b = 0 6 | b = (b << 1) | (bi1 ? 1 : 0); 7 | b = (b << 1) | (bi0 ? 1 : 0); 8 | 9 | sum = a + b + (ci ? 1 : 0); 10 | 11 | s0 = (sum & 1) != 0; 12 | sum >>= 1; 13 | s1 = (sum & 1) != 0; 14 | sum >>= 1; 15 | co = (sum & 1) != 0; 16 | 17 | ao1 = ai1; 18 | ao0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/adder2.t: -------------------------------------------------------------------------------- 1 | adder 10 0 2 | ir103 -13 0 3 | ir103 -3 0 4 | ir103 21 103 5 | ir103 11 103 6 | adder -10 103 7 | 8 | in ai1 -13 0 9 | in bi1 -3 0 10 | in ai0 7 0 11 | in bi0 17 0 12 | in ci 21..22 0 13 | 14 | out co -19..-18 206 15 | out ao1 -12..-9 206 16 | out s1 1 206 17 | out ao0 11 206 18 | out s0 21 206 -------------------------------------------------------------------------------- /code/ts/functions/adder4.js: -------------------------------------------------------------------------------- 1 | a = 0 2 | a = (a << 1) | (ai3 ? 1 : 0); 3 | a = (a << 1) | (ai2 ? 1 : 0); 4 | a = (a << 1) | (ai1 ? 1 : 0); 5 | a = (a << 1) | (ai0 ? 1 : 0); 6 | 7 | b = 0 8 | b = (b << 1) | (bi3 ? 1 : 0); 9 | b = (b << 1) | (bi2 ? 1 : 0); 10 | b = (b << 1) | (bi1 ? 1 : 0); 11 | b = (b << 1) | (bi0 ? 1 : 0); 12 | 13 | sum = a + b + (ci ? 1 : 0); 14 | 15 | s0 = (sum & 1) != 0; 16 | sum >>= 1; 17 | s1 = (sum & 1) != 0; 18 | sum >>= 1; 19 | s2 = (sum & 1) != 0; 20 | sum >>= 1; 21 | s3 = (sum & 1) != 0; 22 | sum >>= 1; 23 | co = (sum & 1) != 0; 24 | 25 | ao3 = ai3; 26 | ao2 = ai2; 27 | ao1 = ai1; 28 | ao0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/adder4.t: -------------------------------------------------------------------------------- 1 | adder2 20 0 2 | ir206 -3 0 3 | ir206 -13 0 4 | ir206 -23 0 5 | ir206 -33 0 6 | ir206 41 206 7 | ir206 31 206 8 | ir206 21 206 9 | ir206 11 206 10 | adder2 -20 206 11 | 12 | in ai3 -33 0 13 | in bi3 -23 0 14 | in ai2 -13 0 15 | in bi2 -3 0 16 | in ai1 7 0 17 | in bi1 17 0 18 | in ai0 27 0 19 | in bi0 37 0 20 | in ci 41..42 0 21 | 22 | out co -39..-38 412 23 | out ao3 -32..-29 412 24 | out s3 -19 412 25 | out ao2 -9 412 26 | out s2 1 412 27 | out ao1 11 412 28 | out s1 21 412 29 | out ao0 31 412 30 | out s0 41 412 -------------------------------------------------------------------------------- /code/ts/functions/adder8.js: -------------------------------------------------------------------------------- 1 | a = 0 2 | a = (a << 1) | (ai7 ? 1 : 0); 3 | a = (a << 1) | (ai6 ? 1 : 0); 4 | a = (a << 1) | (ai5 ? 1 : 0); 5 | a = (a << 1) | (ai4 ? 1 : 0); 6 | a = (a << 1) | (ai3 ? 1 : 0); 7 | a = (a << 1) | (ai2 ? 1 : 0); 8 | a = (a << 1) | (ai1 ? 1 : 0); 9 | a = (a << 1) | (ai0 ? 1 : 0); 10 | 11 | b = 0 12 | b = (b << 1) | (bi7 ? 1 : 0); 13 | b = (b << 1) | (bi6 ? 1 : 0); 14 | b = (b << 1) | (bi5 ? 1 : 0); 15 | b = (b << 1) | (bi4 ? 1 : 0); 16 | b = (b << 1) | (bi3 ? 1 : 0); 17 | b = (b << 1) | (bi2 ? 1 : 0); 18 | b = (b << 1) | (bi1 ? 1 : 0); 19 | b = (b << 1) | (bi0 ? 1 : 0); 20 | 21 | sum = a + b + (ci ? 1 : 0); 22 | 23 | s0 = (sum & 1) != 0; 24 | sum >>= 1; 25 | s1 = (sum & 1) != 0; 26 | sum >>= 1; 27 | s2 = (sum & 1) != 0; 28 | sum >>= 1; 29 | s3 = (sum & 1) != 0; 30 | sum >>= 1; 31 | s4 = (sum & 1) != 0; 32 | sum >>= 1; 33 | s5 = (sum & 1) != 0; 34 | sum >>= 1; 35 | s6 = (sum & 1) != 0; 36 | sum >>= 1; 37 | s7 = (sum & 1) != 0; 38 | sum >>= 1; 39 | co = (sum & 1) != 0; 40 | 41 | ao7 = ai7; 42 | ao6 = ai6; 43 | ao5 = ai5; 44 | ao4 = ai4; 45 | ao3 = ai3; 46 | ao2 = ai2; 47 | ao1 = ai1; 48 | ao0 = ai0; -------------------------------------------------------------------------------- /code/ts/functions/adder8.t: -------------------------------------------------------------------------------- 1 | adder4 42 0 2 | ir412 -71 0 3 | ir412 -61 0 4 | ir412 -51 0 5 | ir412 -41 0 6 | ir412 -31 0 7 | ir412 -21 0 8 | ir412 -11 0 9 | ir412 -1 0 10 | ir412 13 412 11 | ir412 23 412 12 | ir412 33 412 13 | ir412 43 412 14 | ir412 53 412 15 | ir412 63 412 16 | ir412 73 412 17 | ir412 83 412 18 | adder4 -38 412 19 | 20 | in ai7 -71 0 21 | in bi7 -61 0 22 | in ai6 -51 0 23 | in bi6 -41 0 24 | in ai5 -31 0 25 | in bi5 -21 0 26 | in ai4 -11 0 27 | in bi4 -1 0 28 | in ai3 9 0 29 | in bi3 19 0 30 | in ai2 29 0 31 | in bi2 39 0 32 | in ai1 49 0 33 | in bi1 59 0 34 | in ai0 69 0 35 | in bi0 79 0 36 | in ci 83..84 0 37 | 38 | out co -77..-76 824 39 | out ao7 -70..-67 824 40 | out s7 -57 824 41 | out ao6 -47 824 42 | out s6 -37 824 43 | out ao5 -27 824 44 | out s5 -17 824 45 | out ao4 -7 824 46 | out s4 3 824 47 | out ao3 13 824 48 | out s3 23 824 49 | out ao2 33 824 50 | out s2 43 824 51 | out ao1 53 824 52 | out s1 63 824 53 | out ao0 73 824 54 | out s0 83 824 -------------------------------------------------------------------------------- /code/ts/functions/bit0to7.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; 9 | 10 | co7 = ci0; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = false; -------------------------------------------------------------------------------- /code/ts/functions/bit0to7.t: -------------------------------------------------------------------------------- 1 | lu 74 2 | s71 75 1 3 | ir13 5 2 4 | false 16 3 5 | false 26 3 6 | false 36 3 7 | false 46 3 8 | false 56 3 9 | false 66 3 10 | false 76 3 11 | comb15_8 -40 0 12 | 13 | in i7 -75 0 14 | in i6 -65 0 15 | in i5 -55 0 16 | in i4 -45 0 17 | in i3 -35 0 18 | in i2 -25 0 19 | in i1 -15 0 20 | in i0 -5 0 21 | 22 | in ci7 5 0 23 | in ci6 15 0 24 | in ci5 25 0 25 | in ci4 35 0 26 | in ci3 45 0 27 | in ci2 55 0 28 | in ci1 65 0 29 | in ci0 75 0 30 | 31 | out o7 -75 15 32 | out o6 -65 15 33 | out o5 -55 15 34 | out o4 -45 15 35 | out o3 -35 15 36 | out o2 -25 15 37 | out o1 -15 15 38 | out o0 -5 15 39 | 40 | out co7 5 15 41 | out co6 14..17 15 42 | out co5 24..27 15 43 | out co4 34..37 15 44 | out co3 44..47 15 45 | out co2 54..57 15 46 | out co1 64..67 15 47 | out co0 74..77 15 -------------------------------------------------------------------------------- /code/ts/functions/bit7to0.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; 9 | 10 | co7 = false; 11 | co6 = false; 12 | co5 = false; 13 | co4 = false; 14 | co3 = false; 15 | co2 = false; 16 | co1 = false; 17 | co0 = ci; -------------------------------------------------------------------------------- /code/ts/functions/bit7to0.t: -------------------------------------------------------------------------------- 1 | ju 6 2 | z71 5 1 3 | false 6 3 4 | false 16 3 5 | false 26 3 6 | false 36 3 7 | false 46 3 8 | false 56 3 9 | false 66 3 10 | il13 75 2 11 | comb15_8 -40 0 12 | 13 | in i7 -75 0 14 | in i6 -65 0 15 | in i5 -55 0 16 | in i4 -45 0 17 | in i3 -35 0 18 | in i2 -25 0 19 | in i1 -15 0 20 | in i0 -5 0 21 | 22 | in ci 5 0 23 | 24 | out o7 -75 15 25 | out o6 -65 15 26 | out o5 -55 15 27 | out o4 -45 15 28 | out o3 -35 15 29 | out o2 -25 15 30 | out o1 -15 15 31 | out o0 -5 15 32 | 33 | out co7 4..7 15 34 | out co6 14..17 15 35 | out co5 24..27 15 36 | out co4 34..37 15 37 | out co3 44..47 15 38 | out co2 54..57 15 39 | out co1 64..67 15 40 | out co0 75 15 -------------------------------------------------------------------------------- /code/ts/functions/comb15_8.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; -------------------------------------------------------------------------------- /code/ts/functions/comb15_8.t: -------------------------------------------------------------------------------- 1 | il15 -35 0 2 | il15 -25 0 3 | il15 -15 0 4 | il15 -5 0 5 | il15 5 0 6 | il15 15 0 7 | il15 25 0 8 | il15 35 0 9 | 10 | in i7 -35 0 11 | in i6 -25 0 12 | in i5 -15 0 13 | in i4 -5 0 14 | in i3 5 0 15 | in i2 15 0 16 | in i1 25 0 17 | in i0 35 0 18 | 19 | out o7 -35 15 20 | out o6 -25 15 21 | out o5 -15 15 22 | out o4 -5 15 23 | out o3 5 15 24 | out o2 15 15 25 | out o1 25 15 26 | out o0 35 15 -------------------------------------------------------------------------------- /code/ts/functions/copyABC.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = ci ? ai7 : bi7; 11 | bo6 = ci ? ai6 : bi6; 12 | bo5 = ci ? ai5 : bi5; 13 | bo4 = ci ? ai4 : bi4; 14 | bo3 = ci ? ai3 : bi3; 15 | bo2 = ci ? ai2 : bi2; 16 | bo1 = ci ? ai1 : bi1; 17 | bo0 = ci ? ai0 : bi0; 18 | 19 | co = ci; -------------------------------------------------------------------------------- /code/ts/functions/copyBAC.js: -------------------------------------------------------------------------------- 1 | ao7 = ci ? bi7 : ai7; 2 | ao6 = ci ? bi6 : ai6; 3 | ao5 = ci ? bi5 : ai5; 4 | ao4 = ci ? bi4 : ai4; 5 | ao3 = ci ? bi3 : ai3; 6 | ao2 = ci ? bi2 : ai2; 7 | ao1 = ci ? bi1 : ai1; 8 | ao0 = ci ? bi0 : ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; 18 | 19 | co = ci; -------------------------------------------------------------------------------- /code/ts/functions/copyCAB.js: -------------------------------------------------------------------------------- 1 | co = ci; 2 | 3 | ao7 = ai7; 4 | ao6 = ai6; 5 | ao5 = ai5; 6 | ao4 = ai4; 7 | ao3 = ai3; 8 | ao2 = ai2; 9 | ao1 = ai1; 10 | ao0 = ai0; 11 | 12 | bo7 = ci ? ai7 : bi7; 13 | bo6 = ci ? ai6 : bi6; 14 | bo5 = ci ? ai5 : bi5; 15 | bo4 = ci ? ai4 : bi4; 16 | bo3 = ci ? ai3 : bi3; 17 | bo2 = ci ? ai2 : bi2; 18 | bo1 = ci ? ai1 : bi1; 19 | bo0 = ci ? ai0 : bi0; -------------------------------------------------------------------------------- /code/ts/functions/copyCBA.js: -------------------------------------------------------------------------------- 1 | co = ci; 2 | 3 | ao7 = ci ? bi7 : ai7; 4 | ao6 = ci ? bi6 : ai6; 5 | ao5 = ci ? bi5 : ai5; 6 | ao4 = ci ? bi4 : ai4; 7 | ao3 = ci ? bi3 : ai3; 8 | ao2 = ci ? bi2 : ai2; 9 | ao1 = ci ? bi1 : ai1; 10 | ao0 = ci ? bi0 : ai0; 11 | 12 | bo7 = bi7; 13 | bo6 = bi6; 14 | bo5 = bi5; 15 | bo4 = bi4; 16 | bo3 = bi3; 17 | bo2 = bi2; 18 | bo1 = bi1; 19 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/func_AB_AF.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/func_AB_FB.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/i15_8.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; -------------------------------------------------------------------------------- /code/ts/functions/i15_8.t: -------------------------------------------------------------------------------- 1 | il15 -35 0 2 | il15 -25 0 3 | il15 -15 0 4 | il15 -5 0 5 | il15 5 0 6 | il15 15 0 7 | il15 25 0 8 | il15 35 0 9 | 10 | in i7 -35 0 11 | in i6 -25 0 12 | in i5 -15 0 13 | in i4 -5 0 14 | in i3 5 0 15 | in i2 15 0 16 | in i1 25 0 17 | in i0 35 0 18 | 19 | out o7 -35 15 20 | out o6 -25 15 21 | out o5 -15 15 22 | out o4 -5 15 23 | out o3 5 15 24 | out o2 15 15 25 | out o1 25 15 26 | out o0 35 15 -------------------------------------------------------------------------------- /code/ts/functions/interlacer8.js: -------------------------------------------------------------------------------- 1 | ao7 = ai7; 2 | ao6 = ai6; 3 | ao5 = ai5; 4 | ao4 = ai4; 5 | ao3 = ai3; 6 | ao2 = ai2; 7 | ao1 = ai1; 8 | ao0 = ai0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/functions/leadBit0.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = false; 3 | o5 = false; 4 | o4 = false; 5 | o3 = false; 6 | o2 = false; 7 | o1 = false; 8 | o0 = i0; -------------------------------------------------------------------------------- /code/ts/functions/leadBit0.t: -------------------------------------------------------------------------------- 1 | il3 -35 0 2 | il3 -25 0 3 | il3 -15 0 4 | il3 -5 0 5 | il3 5 0 6 | il3 15 0 7 | il3 25 0 8 | false -34 3 9 | false -24 3 10 | false -14 3 11 | false -4 3 12 | false 6 3 13 | false 16 3 14 | false 26 3 15 | ir15 35 0 16 | 17 | in i7 -35 0 18 | in i6 -25 0 19 | in i5 -15 0 20 | in i4 -5 0 21 | in i3 5 0 22 | in i2 15 0 23 | in i1 25 0 24 | in i0 35 0 25 | 26 | out o7 -36..-33 15 27 | out o6 -26..-23 15 28 | out o5 -16..-13 15 29 | out o4 -6..-3 15 30 | out o3 4..7 15 31 | out o2 14..17 15 32 | out o1 24..27 15 33 | out o0 35 15 -------------------------------------------------------------------------------- /code/ts/functions/notBit0.js: -------------------------------------------------------------------------------- 1 | o7 = false; 2 | o6 = false; 3 | o5 = false; 4 | o4 = false; 5 | o3 = false; 6 | o2 = false; 7 | o1 = false; 8 | o0 = !(i7 || i6 || i5 || i4 || i3 || i2 || i1 || i0); -------------------------------------------------------------------------------- /code/ts/functions/notBit0.t: -------------------------------------------------------------------------------- 1 | zh -35 2 | zh -33 3 | zh -31 4 | zh -29 5 | zh -27 6 | zh -25 7 | zh -23 8 | zh -21 9 | zh -19 10 | zh -17 11 | zh -15 12 | zh -13 13 | zh -11 14 | zh -9 15 | zh -7 16 | zh -5 17 | zh -3 18 | zh -1 19 | zh 1 20 | zh 3 21 | zh 5 22 | zh 7 23 | zh 9 24 | zh 11 25 | zh 13 26 | zh 15 27 | zh 17 28 | zh 19 29 | zh 21 30 | zh 23 31 | zh 25 32 | zh 27 33 | zh 29 34 | zh 31 35 | zh 33 36 | zh 35 37 | not 35 2 38 | ir7 35 7 39 | false -35 2 40 | false -25 2 41 | false -15 2 42 | false -5 2 43 | false 5 2 44 | false 15 2 45 | false 25 2 46 | 47 | in i7 -35 0 48 | in i6 -25 0 49 | in i5 -15 0 50 | in i4 -5 0 51 | in i3 5 0 52 | in i2 15 0 53 | in i1 25 0 54 | in i0 35 0 55 | 56 | out o7 -37..-34 14 57 | out o6 -27..-24 14 58 | out o5 -17..-14 14 59 | out o4 -7..-4 14 60 | out o3 3..6 14 61 | out o2 13..16 14 62 | out o1 23..26 14 63 | out o0 35 14 -------------------------------------------------------------------------------- /code/ts/functions/shiftLeft.js: -------------------------------------------------------------------------------- 1 | o7 = i6; 2 | o6 = i5; 3 | o5 = i4; 4 | o4 = i3; 5 | o3 = i2; 6 | o2 = i1; 7 | o1 = i0; 8 | o0 = false; -------------------------------------------------------------------------------- /code/ts/functions/shiftLeft.t: -------------------------------------------------------------------------------- 1 | o -24 2 | s11 -25 1 3 | il5 -15 0 4 | s11 -15 4 5 | il8 -5 0 6 | s11 -5 7 7 | il11 5 0 8 | s11 5 10 9 | il14 15 0 10 | s11 15 13 11 | il17 25 0 12 | s11 25 16 13 | il20 35 0 14 | s11 35 19 15 | false 35 21 16 | ir13 25 20 17 | ir16 15 17 18 | ir19 5 14 19 | ir22 -5 11 20 | ir25 -15 8 21 | ir28 -25 5 22 | ir31 -35 2 23 | 24 | in i7 -35 0 25 | in i6 -25 0 26 | in i5 -15 0 27 | in i4 -5 0 28 | in i3 5 0 29 | in i2 15 0 30 | in i1 25 0 31 | in i0 35 0 32 | 33 | out o7 -35 33 34 | out o6 -25 33 35 | out o5 -15 33 36 | out o4 -5 33 37 | out o3 5 33 38 | out o2 15 33 39 | out o1 25 33 40 | out o0 33..36 33 -------------------------------------------------------------------------------- /code/ts/functions/uninterlacer8.js: -------------------------------------------------------------------------------- 1 | so7 = si7; 2 | so6 = si6; 3 | so5 = si5; 4 | so4 = si4; 5 | so3 = si3; 6 | so2 = si2; 7 | so1 = si1; 8 | so0 = si0; 9 | 10 | bo7 = bi7; 11 | bo6 = bi6; 12 | bo5 = bi5; 13 | bo4 = bi4; 14 | bo3 = bi3; 15 | bo2 = bi2; 16 | bo1 = bi1; 17 | bo0 = bi0; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_andLeft.js: -------------------------------------------------------------------------------- 1 | o = a && b; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_andLeft.t: -------------------------------------------------------------------------------- 1 | # and with square on left 2 | _nand 0 0 3 | _notLeft2 -1 3 4 | in a -1 0 5 | in b 0 0 6 | out o -1..0 4 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_andRight.js: -------------------------------------------------------------------------------- 1 | o = a && b; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_andRight.t: -------------------------------------------------------------------------------- 1 | # and with square on right 2 | _nand 0 0 3 | _notRight2 0 3 4 | in a -1 0 5 | in b 0 0 6 | out o -1..0 4 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_nand.js: -------------------------------------------------------------------------------- 1 | o = !(a && b); 2 | -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_nand.t: -------------------------------------------------------------------------------- 1 | _notLeft -1 0 2 | _notRight 0 0 3 | or 0 1 4 | in a -1 0 5 | in b 0 0 6 | out o -1..0 3 7 | -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_norLeft.js: -------------------------------------------------------------------------------- 1 | o = !(a || b); 2 | -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_norLeft.t: -------------------------------------------------------------------------------- 1 | # nor with square on left 2 | or 0 0 3 | _notLeft2 -1 2 4 | in a -1 0 5 | in b 0 0 6 | out o 0 3 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_norRight.js: -------------------------------------------------------------------------------- 1 | o = !(a || b); 2 | -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_norRight.t: -------------------------------------------------------------------------------- 1 | # nor with square on right 2 | or 0 0 3 | _notRight2 0 2 4 | in a -1 0 5 | in b 0 0 6 | out o 0 3 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notLeft.js: -------------------------------------------------------------------------------- 1 | o = !i; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notLeft.t: -------------------------------------------------------------------------------- 1 | # not with square on left and single tap right 2 | o -1 2 0 3 | in i 0 0 4 | out o 0 1 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notLeft2.js: -------------------------------------------------------------------------------- 1 | o = !i; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notLeft2.t: -------------------------------------------------------------------------------- 1 | # not with square on left and double tap right 2 | o -1 2 1 3 | in i 0 0 4 | out o 0 1 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notRight.js: -------------------------------------------------------------------------------- 1 | o = !i; 2 | -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notRight.t: -------------------------------------------------------------------------------- 1 | # not with square on right and single tap left 2 | o 2 2 1 3 | in i 0 0 4 | out o 0 1 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notRight2.js: -------------------------------------------------------------------------------- 1 | o = !i; -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_notRight2.t: -------------------------------------------------------------------------------- 1 | # not with square on right and single tap left 2 | o 2 2 0 3 | in i 0 0 4 | out o 0 1 -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_xor.js: -------------------------------------------------------------------------------- 1 | o = (a != b); -------------------------------------------------------------------------------- /code/ts/gates/intermediate/_xor.t: -------------------------------------------------------------------------------- 1 | ih -2 2 | ih 2 3 | iv -4 4 | iv 3 5 | _norLeft 0 1 6 | lu -2 7 | ju 1 8 | _norLeft -3 5 9 | _norRight 3 5 10 | ih -2 11 | ih 2 12 | or 0 9 13 | in a -4..-1 0 14 | in b 0..3 0 15 | out o -1..0 11 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and.js: -------------------------------------------------------------------------------- 1 | o = a && b; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and.t: -------------------------------------------------------------------------------- 1 | # andRight alias 2 | andRight 0 0 3 | in a -3..-1 0 4 | in b 0..2 0 5 | out o -1..1 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and16.js: -------------------------------------------------------------------------------- 1 | o15 = a15 && b15; 2 | o14 = a14 && b14; 3 | o13 = a13 && b13; 4 | o12 = a12 && b12; 5 | o11 = a11 && b11; 6 | o10 = a10 && b10; 7 | o9 = a9 && b9; 8 | o8 = a8 && b8; 9 | o7 = a7 && b7; 10 | o6 = a6 && b6; 11 | o5 = a5 && b5; 12 | o4 = a4 && b4; 13 | o3 = a3 && b3; 14 | o2 = a2 && b2; 15 | o1 = a1 && b1; 16 | o0 = a0 && b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and16.t: -------------------------------------------------------------------------------- 1 | and8 -40 0 2 | and8 40 0 3 | 4 | in a15 -78..-76 0 5 | in b15 -75..-73 0 6 | in a14 -68..-66 0 7 | in b14 -65..-63 0 8 | in a13 -58..-56 0 9 | in b13 -55..-53 0 10 | in a12 -48..-46 0 11 | in b12 -45..-43 0 12 | in a11 -38..-36 0 13 | in b11 -35..-33 0 14 | in a10 -28..-26 0 15 | in b10 -25..-23 0 16 | in a9 -18..-16 0 17 | in b9 -15..-13 0 18 | in a8 -8..-6 0 19 | in b8 -5..-3 0 20 | in a7 2..4 0 21 | in b7 5..7 0 22 | in a6 12..14 0 23 | in b6 15..17 0 24 | in a5 22..24 0 25 | in b5 25..27 0 26 | in a4 32..34 0 27 | in b4 35..37 0 28 | in a3 42..44 0 29 | in b3 45..47 0 30 | in a2 52..54 0 31 | in b2 55..57 0 32 | in a1 62..64 0 33 | in b1 65..67 0 34 | in a0 72..74 0 35 | in b0 75..77 0 36 | 37 | out o15 -76..-74 10 38 | out o14 -66..-64 10 39 | out o13 -56..-54 10 40 | out o12 -46..-44 10 41 | out o11 -36..-34 10 42 | out o10 -26..-24 10 43 | out o9 -16..-14 10 44 | out o8 -6..-4 10 45 | out o7 4..6 10 46 | out o6 14..16 10 47 | out o5 24..26 10 48 | out o4 34..36 10 49 | out o3 44..46 10 50 | out o2 54..56 10 51 | out o1 64..66 10 52 | out o0 74..76 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and2.js: -------------------------------------------------------------------------------- 1 | o1 = a1 && b1; 2 | o0 = a0 && b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and2.t: -------------------------------------------------------------------------------- 1 | and -4 0 2 | and 6 0 3 | 4 | in a1 -7..-5 0 5 | in b1 -4..-2 0 6 | in a0 3..5 0 7 | in b0 6..8 0 8 | 9 | out o1 -5..-3 10 10 | out o0 5..7 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and4.js: -------------------------------------------------------------------------------- 1 | o3 = a3 && b3; 2 | o2 = a2 && b2; 3 | o1 = a1 && b1; 4 | o0 = a0 && b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and4.t: -------------------------------------------------------------------------------- 1 | and2 -11 0 2 | and2 9 0 3 | 4 | in a3 -18..-16 0 5 | in b3 -15..-13 0 6 | in a2 -8..-6 0 7 | in b2 -5..-3 0 8 | in a1 2..4 0 9 | in b1 5..7 0 10 | in a0 12..14 0 11 | in b0 15..17 0 12 | 13 | out o3 -16..-14 10 14 | out o2 -6..-4 10 15 | out o1 4..6 10 16 | out o0 14..16 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and8.js: -------------------------------------------------------------------------------- 1 | o7 = a7 && b7; 2 | o6 = a6 && b6; 3 | o5 = a5 && b5; 4 | o4 = a4 && b4; 5 | o3 = a3 && b3; 6 | o2 = a2 && b2; 7 | o1 = a1 && b1; 8 | o0 = a0 && b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/and8.t: -------------------------------------------------------------------------------- 1 | and4 -20 0 2 | and4 20 0 3 | 4 | in a7 -38..-36 0 5 | in b7 -35..-33 0 6 | in a6 -28..-26 0 7 | in b6 -25..-23 0 8 | in a5 -18..-16 0 9 | in b5 -15..-13 0 10 | in a4 -8..-6 0 11 | in b4 -5..-3 0 12 | in a3 2..4 0 13 | in b3 5..7 0 14 | in a2 12..14 0 15 | in b2 15..17 0 16 | in a1 22..24 0 17 | in b1 25..27 0 18 | in a0 32..34 0 19 | in b0 35..37 0 20 | 21 | out o7 -36..-34 10 22 | out o6 -26..-24 10 23 | out o5 -16..-14 10 24 | out o4 -6..-4 10 25 | out o3 4..6 10 26 | out o2 14..16 10 27 | out o1 24..26 10 28 | out o0 34..36 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/andLeft.js: -------------------------------------------------------------------------------- 1 | o = a && b; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/andLeft.t: -------------------------------------------------------------------------------- 1 | # and with output toward left 2 | notLeft -2 0 3 | notRight 1 0 4 | notLeft -1 5 5 | in a -3..-1 0 6 | in b 0..2 0 7 | out o -2..0 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/andRight.js: -------------------------------------------------------------------------------- 1 | o = a && b; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/andRight.t: -------------------------------------------------------------------------------- 1 | # and with output toward right 2 | notLeft -2 0 3 | notRight 1 0 4 | notRight 0 5 5 | in a -3..-1 0 6 | in b 0..2 0 7 | out o -1..1 10 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/buffer.js: -------------------------------------------------------------------------------- 1 | o = i; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/buffer.t: -------------------------------------------------------------------------------- 1 | iv 0 2 | 3 | in i 0 0 4 | out o 0 4 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/buffer8.js: -------------------------------------------------------------------------------- 1 | o7 = i7; 2 | o6 = i6; 3 | o5 = i5; 4 | o4 = i4; 5 | o3 = i3; 6 | o2 = i2; 7 | o1 = i1; 8 | o0 = i0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/buffer8.t: -------------------------------------------------------------------------------- 1 | ir32 -35 0 2 | ir32 -25 0 3 | ir32 -15 0 4 | ir32 -5 0 5 | ir32 5 0 6 | ir32 15 0 7 | ir32 25 0 8 | ir32 35 0 9 | 10 | in i7 -35 0 11 | in i6 -25 0 12 | in i5 -15 0 13 | in i4 -5 0 14 | in i3 5 0 15 | in i2 15 0 16 | in i1 25 0 17 | in i0 35 0 18 | out o7 -35 32 19 | out o6 -25 32 20 | out o5 -15 32 21 | out o4 -5 32 22 | out o3 5 32 23 | out o2 15 32 24 | out o1 25 32 25 | out o0 35 32 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand.js: -------------------------------------------------------------------------------- 1 | o = !(a && b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand.t: -------------------------------------------------------------------------------- 1 | notLeft -2 0 2 | notRight 1 0 3 | ih 0 4 | in a -3..-1 0 5 | in b 0..2 0 6 | out o -2..1 6 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand16.js: -------------------------------------------------------------------------------- 1 | o15 = !(a15 && b15); 2 | o14 = !(a14 && b14); 3 | o13 = !(a13 && b13); 4 | o12 = !(a12 && b12); 5 | o11 = !(a11 && b11); 6 | o10 = !(a10 && b10); 7 | o9 = !(a9 && b9); 8 | o8 = !(a8 && b8); 9 | o7 = !(a7 && b7); 10 | o6 = !(a6 && b6); 11 | o5 = !(a5 && b5); 12 | o4 = !(a4 && b4); 13 | o3 = !(a3 && b3); 14 | o2 = !(a2 && b2); 15 | o1 = !(a1 && b1); 16 | o0 = !(a0 && b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand16.t: -------------------------------------------------------------------------------- 1 | nand8 -40 0 2 | nand8 40 0 3 | 4 | in a15 -78..-76 0 5 | in b15 -75..-73 0 6 | in a14 -68..-66 0 7 | in b14 -65..-63 0 8 | in a13 -58..-56 0 9 | in b13 -55..-53 0 10 | in a12 -48..-46 0 11 | in b12 -45..-43 0 12 | in a11 -38..-36 0 13 | in b11 -35..-33 0 14 | in a10 -28..-26 0 15 | in b10 -25..-23 0 16 | in a9 -18..-16 0 17 | in b9 -15..-13 0 18 | in a8 -8..-6 0 19 | in b8 -5..-3 0 20 | in a7 2..4 0 21 | in b7 5..7 0 22 | in a6 12..14 0 23 | in b6 15..17 0 24 | in a5 22..24 0 25 | in b5 25..27 0 26 | in a4 32..34 0 27 | in b4 35..37 0 28 | in a3 42..44 0 29 | in b3 45..47 0 30 | in a2 52..54 0 31 | in b2 55..57 0 32 | in a1 62..64 0 33 | in b1 65..67 0 34 | in a0 72..74 0 35 | in b0 75..77 0 36 | 37 | out o15 -77..-74 6 38 | out o14 -67..-64 6 39 | out o13 -57..-54 6 40 | out o12 -47..-44 6 41 | out o11 -37..-34 6 42 | out o10 -27..-24 6 43 | out o9 -17..-14 6 44 | out o8 -7..-4 6 45 | out o7 3..6 6 46 | out o6 13..16 6 47 | out o5 23..26 6 48 | out o4 33..36 6 49 | out o3 43..46 6 50 | out o2 53..56 6 51 | out o1 63..66 6 52 | out o0 73..76 6 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand2.js: -------------------------------------------------------------------------------- 1 | o1 = !(a1 && b1); 2 | o0 = !(a0 && b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand2.t: -------------------------------------------------------------------------------- 1 | nand -5 0 2 | nand 5 0 3 | 4 | in a1 -8..-6 0 5 | in b1 -5..-3 0 6 | in a0 2..4 0 7 | in b0 5..7 0 8 | 9 | out o1 -7..-4 6 10 | out o0 3..6 6 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand4.js: -------------------------------------------------------------------------------- 1 | o3 = !(a3 && b3); 2 | o2 = !(a2 && b2); 3 | o1 = !(a1 && b1); 4 | o0 = !(a0 && b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand4.t: -------------------------------------------------------------------------------- 1 | nand2 -10 0 2 | nand2 10 0 3 | 4 | in a3 -18..-16 0 5 | in b3 -15..-13 0 6 | in a2 -8..-6 0 7 | in b2 -5..-3 0 8 | in a1 2..4 0 9 | in b1 5..7 0 10 | in a0 12..14 0 11 | in b0 15..17 0 12 | 13 | out o3 -17..-14 6 14 | out o2 -7..-4 6 15 | out o1 3..6 6 16 | out o0 13..16 6 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand8.js: -------------------------------------------------------------------------------- 1 | o7 = !(a7 && b7); 2 | o6 = !(a6 && b6); 3 | o5 = !(a5 && b5); 4 | o4 = !(a4 && b4); 5 | o3 = !(a3 && b3); 6 | o2 = !(a2 && b2); 7 | o1 = !(a1 && b1); 8 | o0 = !(a0 && b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nand8.t: -------------------------------------------------------------------------------- 1 | nand4 -20 0 2 | nand4 20 0 3 | 4 | in a7 -38..-36 0 5 | in b7 -35..-33 0 6 | in a6 -28..-26 0 7 | in b6 -25..-23 0 8 | in a5 -18..-16 0 9 | in b5 -15..-13 0 10 | in a4 -8..-6 0 11 | in b4 -5..-3 0 12 | in a3 2..4 0 13 | in b3 5..7 0 14 | in a2 12..14 0 15 | in b2 15..17 0 16 | in a1 22..24 0 17 | in b1 25..27 0 18 | in a0 32..34 0 19 | in b0 35..37 0 20 | 21 | out o7 -37..-34 6 22 | out o6 -27..-24 6 23 | out o5 -17..-14 6 24 | out o4 -7..-4 6 25 | out o3 3..6 6 26 | out o2 13..16 6 27 | out o1 23..26 6 28 | out o0 33..36 6 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor.js: -------------------------------------------------------------------------------- 1 | o = !(a || b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor.t: -------------------------------------------------------------------------------- 1 | not 0 0 2 | in a -1..0 0 3 | in b 1 0 4 | out o -1..1 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor16.js: -------------------------------------------------------------------------------- 1 | o15 = !(a15 || b15); 2 | o14 = !(a14 || b14); 3 | o13 = !(a13 || b13); 4 | o12 = !(a12 || b12); 5 | o11 = !(a11 || b11); 6 | o10 = !(a10 || b10); 7 | o9 = !(a9 || b9); 8 | o8 = !(a8 || b8); 9 | o7 = !(a7 || b7); 10 | o6 = !(a6 || b6); 11 | o5 = !(a5 || b5); 12 | o4 = !(a4 || b4); 13 | o3 = !(a3 || b3); 14 | o2 = !(a2 || b2); 15 | o1 = !(a1 || b1); 16 | o0 = !(a0 || b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor16.t: -------------------------------------------------------------------------------- 1 | nor8 -40 0 2 | nor8 40 0 3 | 4 | in a15 -76..-75 0 5 | in b15 -74 0 6 | in a14 -66..-65 0 7 | in b14 -64 0 8 | in a13 -56..-55 0 9 | in b13 -54 0 10 | in a12 -46..-45 0 11 | in b12 -44 0 12 | in a11 -36..-35 0 13 | in b11 -34 0 14 | in a10 -26..-25 0 15 | in b10 -24 0 16 | in a9 -16..-15 0 17 | in b9 -14 0 18 | in a8 -6..-5 0 19 | in b8 -4 0 20 | in a7 4..5 0 21 | in b7 6 0 22 | in a6 14..15 0 23 | in b6 16 0 24 | in a5 24..25 0 25 | in b5 26 0 26 | in a4 34..35 0 27 | in b4 36 0 28 | in a3 44..45 0 29 | in b3 46 0 30 | in a2 54..55 0 31 | in b2 56 0 32 | in a1 64..65 0 33 | in b1 66 0 34 | in a0 74..75 0 35 | in b0 76 0 36 | 37 | out o15 -76..-74 5 38 | out o14 -66..-64 5 39 | out o13 -56..-54 5 40 | out o12 -46..-44 5 41 | out o11 -36..-34 5 42 | out o10 -26..-24 5 43 | out o9 -16..-14 5 44 | out o8 -6..-4 5 45 | out o7 4..6 5 46 | out o6 14..16 5 47 | out o5 24..26 5 48 | out o4 34..36 5 49 | out o3 44..46 5 50 | out o2 54..56 5 51 | out o1 64..66 5 52 | out o0 74..76 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor2.js: -------------------------------------------------------------------------------- 1 | o1 = !(a1 || b1); 2 | o0 = !(a0 || b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor2.t: -------------------------------------------------------------------------------- 1 | nor -5 0 2 | nor 5 0 3 | 4 | in a1 -6..-5 0 5 | in b1 -4 0 6 | in a0 4..5 0 7 | in b0 6 0 8 | 9 | out o1 -6..-4 5 10 | out o0 4..6 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor4.js: -------------------------------------------------------------------------------- 1 | o3 = !(a3 || b3); 2 | o2 = !(a2 || b2); 3 | o1 = !(a1 || b1); 4 | o0 = !(a0 || b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor4.t: -------------------------------------------------------------------------------- 1 | nor2 -10 0 2 | nor2 10 0 3 | 4 | in a3 -16..-15 0 5 | in b3 -14 0 6 | in a2 -6..-5 0 7 | in b2 -4 0 8 | in a1 4..5 0 9 | in b1 6 0 10 | in a0 14..15 0 11 | in b0 16 0 12 | 13 | out o3 -16..-14 5 14 | out o2 -6..-4 5 15 | out o1 4..6 5 16 | out o0 14..16 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor8.js: -------------------------------------------------------------------------------- 1 | o7 = !(a7 || b7); 2 | o6 = !(a6 || b6); 3 | o5 = !(a5 || b5); 4 | o4 = !(a4 || b4); 5 | o3 = !(a3 || b3); 6 | o2 = !(a2 || b2); 7 | o1 = !(a1 || b1); 8 | o0 = !(a0 || b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/nor8.t: -------------------------------------------------------------------------------- 1 | nor4 -20 0 2 | nor4 20 0 3 | 4 | in a7 -36..-35 0 5 | in b7 -34 0 6 | in a6 -26..-25 0 7 | in b6 -24 0 8 | in a5 -16..-15 0 9 | in b5 -14 0 10 | in a4 -6..-5 0 11 | in b4 -4 0 12 | in a3 4..5 0 13 | in b3 6 0 14 | in a2 14..15 0 15 | in b2 16 0 16 | in a1 24..25 0 17 | in b1 26 0 18 | in a0 34..35 0 19 | in b0 36 0 20 | 21 | out o7 -36..-34 5 22 | out o6 -26..-24 5 23 | out o5 -16..-14 5 24 | out o4 -6..-4 5 25 | out o3 4..6 5 26 | out o2 14..16 5 27 | out o1 24..26 5 28 | out o0 34..36 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not.js: -------------------------------------------------------------------------------- 1 | o = !i; 2 | -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not.t: -------------------------------------------------------------------------------- 1 | # notLeft alias 2 | lu 0 3 | o 0 4 1 4 | jd 0 5 | in i -1..1 0 6 | out o -1..1 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not16.js: -------------------------------------------------------------------------------- 1 | o15 = !a15; 2 | o14 = !a14; 3 | o13 = !a13; 4 | o12 = !a12; 5 | o11 = !a11; 6 | o10 = !a10; 7 | o9 = !a9; 8 | o8 = !a8; 9 | o7 = !a7; 10 | o6 = !a6; 11 | o5 = !a5; 12 | o4 = !a4; 13 | o3 = !a3; 14 | o2 = !a2; 15 | o1 = !a1; 16 | o0 = !a0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not16.t: -------------------------------------------------------------------------------- 1 | not8 40 0 2 | not8 -40 0 3 | 4 | in a15 -76..-74 0 5 | in a14 -66..-64 0 6 | in a13 -56..-54 0 7 | in a12 -46..-44 0 8 | in a11 -36..-34 0 9 | in a10 -26..-24 0 10 | in a9 -16..-14 0 11 | in a8 -6..-4 0 12 | in a7 4..6 0 13 | in a6 14..16 0 14 | in a5 24..26 0 15 | in a4 34..36 0 16 | in a3 44..46 0 17 | in a2 54..56 0 18 | in a1 64..66 0 19 | in a0 74..76 0 20 | 21 | out o15 -76..-74 5 22 | out o14 -66..-64 5 23 | out o13 -56..-54 5 24 | out o12 -46..-44 5 25 | out o11 -36..-34 5 26 | out o10 -26..-24 5 27 | out o9 -16..-14 5 28 | out o8 -6..-4 5 29 | out o7 4..6 5 30 | out o6 14..16 5 31 | out o5 24..26 5 32 | out o4 34..36 5 33 | out o3 44..46 5 34 | out o2 54..56 5 35 | out o1 64..66 5 36 | out o0 74..76 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not2.js: -------------------------------------------------------------------------------- 1 | o1 = !a1; 2 | o0 = !a0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not2.t: -------------------------------------------------------------------------------- 1 | notLeft -5 0 2 | notRight 5 0 3 | 4 | in a1 -6..-4 0 5 | in a0 4..6 0 6 | 7 | out o1 -6..-4 5 8 | out o0 4..6 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not4.js: -------------------------------------------------------------------------------- 1 | o3 = !a3; 2 | o2 = !a2; 3 | o1 = !a1; 4 | o0 = !a0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not4.t: -------------------------------------------------------------------------------- 1 | not2 -10 0 2 | not2 10 0 3 | 4 | in a3 -16..-14 0 5 | in a2 -6..-4 0 6 | in a1 4..6 0 7 | in a0 14..16 0 8 | 9 | out o3 -16..-14 5 10 | out o2 -6..-4 5 11 | out o1 4..6 5 12 | out o0 14..16 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not8.js: -------------------------------------------------------------------------------- 1 | o7 = !a7; 2 | o6 = !a6; 3 | o5 = !a5; 4 | o4 = !a4; 5 | o3 = !a3; 6 | o2 = !a2; 7 | o1 = !a1; 8 | o0 = !a0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/not8.t: -------------------------------------------------------------------------------- 1 | not4 20 0 2 | not4 -20 0 3 | 4 | in a7 -36..-34 0 5 | in a6 -26..-24 0 6 | in a5 -16..-14 0 7 | in a4 -6..-4 0 8 | in a3 4..6 0 9 | in a2 14..16 0 10 | in a1 24..26 0 11 | in a0 34..36 0 12 | 13 | out o7 -36..-34 5 14 | out o6 -26..-24 5 15 | out o5 -16..-14 5 16 | out o4 -6..-4 5 17 | out o3 4..6 5 18 | out o2 14..16 5 19 | out o1 24..26 5 20 | out o0 34..36 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/notLeft.js: -------------------------------------------------------------------------------- 1 | o = !i; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/notLeft.t: -------------------------------------------------------------------------------- 1 | # not with square on left 2 | lu 0 3 | o 0 4 1 4 | jd 0 5 | in i -1..1 0 6 | out o -1..1 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/notRight.js: -------------------------------------------------------------------------------- 1 | o = !i; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/notRight.t: -------------------------------------------------------------------------------- 1 | ju 0 2 | o 1 4 0 3 | ld 0 4 | in i -1..1 0 5 | out o -1..1 5 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or.js: -------------------------------------------------------------------------------- 1 | o = a || b; 2 | -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or.t: -------------------------------------------------------------------------------- 1 | o 0 2 | in a -1 0 3 | in b 0 0 4 | out o -1..0 2 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or16.js: -------------------------------------------------------------------------------- 1 | o15 = a15 || b15; 2 | o14 = a14 || b14; 3 | o13 = a13 || b13; 4 | o12 = a12 || b12; 5 | o11 = a11 || b11; 6 | o10 = a10 || b10; 7 | o9 = a9 || b9; 8 | o8 = a8 || b8; 9 | o7 = a7 || b7; 10 | o6 = a6 || b6; 11 | o5 = a5 || b5; 12 | o4 = a4 || b4; 13 | o3 = a3 || b3; 14 | o2 = a2 || b2; 15 | o1 = a1 || b1; 16 | o0 = a0 || b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or16.t: -------------------------------------------------------------------------------- 1 | or8 -40 0 2 | or8 40 0 3 | 4 | in a15 -76 0 5 | in b15 -75 0 6 | in a14 -66 0 7 | in b14 -65 0 8 | in a13 -56 0 9 | in b13 -55 0 10 | in a12 -46 0 11 | in b12 -45 0 12 | in a11 -36 0 13 | in b11 -35 0 14 | in a10 -26 0 15 | in b10 -25 0 16 | in a9 -16 0 17 | in b9 -15 0 18 | in a8 -6 0 19 | in b8 -5 0 20 | in a7 4 0 21 | in b7 5 0 22 | in a6 14 0 23 | in b6 15 0 24 | in a5 24 0 25 | in b5 25 0 26 | in a4 34 0 27 | in b4 35 0 28 | in a3 44 0 29 | in b3 45 0 30 | in a2 54 0 31 | in b2 55 0 32 | in a1 64 0 33 | in b1 65 0 34 | in a0 74 0 35 | in b0 75 0 36 | 37 | out o15 -76..-75 2 38 | out o14 -66..-65 2 39 | out o13 -56..-55 2 40 | out o12 -46..-45 2 41 | out o11 -36..-35 2 42 | out o10 -26..-25 2 43 | out o9 -16..-15 2 44 | out o8 -6..-5 2 45 | out o7 4..5 2 46 | out o6 14..15 2 47 | out o5 24..25 2 48 | out o4 34..35 2 49 | out o3 44..45 2 50 | out o2 54..55 2 51 | out o1 64..65 2 52 | out o0 74..75 2 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or2.js: -------------------------------------------------------------------------------- 1 | o1 = a1 || b1; 2 | o0 = a0 || b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or2.t: -------------------------------------------------------------------------------- 1 | or -5 0 2 | or 5 0 3 | 4 | in a1 -6 0 5 | in b1 -5 0 6 | in a0 4 0 7 | in b0 5 0 8 | 9 | out o1 -6..-5 2 10 | out o0 4..5 2 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or4.js: -------------------------------------------------------------------------------- 1 | o3 = a3 || b3; 2 | o2 = a2 || b2; 3 | o1 = a1 || b1; 4 | o0 = a0 || b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or4.t: -------------------------------------------------------------------------------- 1 | or2 10 0 2 | or2 -10 0 3 | 4 | in a3 -16 0 5 | in b3 -15 0 6 | in a2 -6 0 7 | in b2 -5 0 8 | in a1 4 0 9 | in b1 5 0 10 | in a0 14 0 11 | in b0 15 0 12 | 13 | out o3 -16..-15 2 14 | out o2 -6..-5 2 15 | out o1 4..5 2 16 | out o0 14..15 2 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or8.js: -------------------------------------------------------------------------------- 1 | o7 = a7 || b7; 2 | o6 = a6 || b6; 3 | o5 = a5 || b5; 4 | o4 = a4 || b4; 5 | o3 = a3 || b3; 6 | o2 = a2 || b2; 7 | o1 = a1 || b1; 8 | o0 = a0 || b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/or8.t: -------------------------------------------------------------------------------- 1 | or4 20 0 2 | or4 -20 0 3 | 4 | in a7 -36 0 5 | in b7 -35 0 6 | in a6 -26 0 7 | in b6 -25 0 8 | in a5 -16 0 9 | in b5 -15 0 10 | in a4 -6 0 11 | in b4 -5 0 12 | in a3 4 0 13 | in b3 5 0 14 | in a2 14 0 15 | in b2 15 0 16 | in a1 24 0 17 | in b1 25 0 18 | in a0 34 0 19 | in b0 35 0 20 | 21 | out o7 -36..-35 2 22 | out o6 -26..-25 2 23 | out o5 -16..-15 2 24 | out o4 -6..-5 2 25 | out o3 4..5 2 26 | out o2 14..15 2 27 | out o1 24..25 2 28 | out o0 34..35 2 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor.js: -------------------------------------------------------------------------------- 1 | o = (a == b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor.t: -------------------------------------------------------------------------------- 1 | # xnorRight alias 2 | xor 0 0 3 | notLeft 0 11 4 | in a -4..-1 0 5 | in b 0..3 0 6 | out o -1..1 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor16.js: -------------------------------------------------------------------------------- 1 | o15 = (a15 == b15); 2 | o14 = (a14 == b14); 3 | o13 = (a13 == b13); 4 | o12 = (a12 == b12); 5 | o11 = (a11 == b11); 6 | o10 = (a10 == b10); 7 | o9 = (a9 == b9); 8 | o8 = (a8 == b8); 9 | o7 = (a7 == b7); 10 | o6 = (a6 == b6); 11 | o5 = (a5 == b5); 12 | o4 = (a4 == b4); 13 | o3 = (a3 == b3); 14 | o2 = (a2 == b2); 15 | o1 = (a1 == b1); 16 | o0 = (a0 == b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor16.t: -------------------------------------------------------------------------------- 1 | xnor8 -40 0 2 | xnor8 40 0 3 | 4 | in a15 -79..-76 0 5 | in b15 -75..-72 0 6 | in a14 -69..-66 0 7 | in b14 -65..-62 0 8 | in a13 -59..-56 0 9 | in b13 -55..-52 0 10 | in a12 -49..-46 0 11 | in b12 -45..-42 0 12 | in a11 -39..-36 0 13 | in b11 -35..-32 0 14 | in a10 -29..-26 0 15 | in b10 -25..-22 0 16 | in a9 -19..-16 0 17 | in b9 -15..-12 0 18 | in a8 -9..-6 0 19 | in b8 -5..-2 0 20 | in a7 1..4 0 21 | in b7 5..8 0 22 | in a6 11..14 0 23 | in b6 15..18 0 24 | in a5 21..24 0 25 | in b5 25..28 0 26 | in a4 31..34 0 27 | in b4 35..38 0 28 | in a3 41..44 0 29 | in b3 45..48 0 30 | in a2 51..54 0 31 | in b2 55..58 0 32 | in a1 61..64 0 33 | in b1 65..68 0 34 | in a0 71..74 0 35 | in b0 75..78 0 36 | 37 | out o15 -77..-75 16 38 | out o14 -66..-64 16 39 | out o13 -57..-55 16 40 | out o12 -46..-44 16 41 | out o11 -37..-35 16 42 | out o10 -26..-24 16 43 | out o9 -17..-15 16 44 | out o8 -6..-4 16 45 | out o7 3..5 16 46 | out o6 14..16 16 47 | out o5 23..25 16 48 | out o4 34..36 16 49 | out o3 43..45 16 50 | out o2 54..56 16 51 | out o1 63..65 16 52 | out o0 74..76 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor2.js: -------------------------------------------------------------------------------- 1 | o1 = (a1 == b1); 2 | o0 = (a0 == b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor2.t: -------------------------------------------------------------------------------- 1 | xnorLeft -5 0 2 | xnorRight 5 0 3 | 4 | in a1 -9..-6 0 5 | in b1 -5..-2 0 6 | in a0 1..4 0 7 | in b0 5..8 0 8 | 9 | out o1 -7..-5 16 10 | out o0 4..6 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor4.js: -------------------------------------------------------------------------------- 1 | o3 = (a3 == b3); 2 | o2 = (a2 == b2); 3 | o1 = (a1 == b1); 4 | o0 = (a0 == b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor4.t: -------------------------------------------------------------------------------- 1 | xnor2 -10 0 2 | xnor2 10 0 3 | 4 | in a3 -19..-16 0 5 | in b3 -15..-12 0 6 | in a2 -9..-6 0 7 | in b2 -5..-2 0 8 | in a1 1..4 0 9 | in b1 5..8 0 10 | in a0 11..14 0 11 | in b0 15..18 0 12 | 13 | out o3 -17..-15 16 14 | out o2 -6..-4 16 15 | out o1 3..5 16 16 | out o0 14..16 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor8.js: -------------------------------------------------------------------------------- 1 | o7 = (a7 == b7); 2 | o6 = (a6 == b6); 3 | o5 = (a5 == b5); 4 | o4 = (a4 == b4); 5 | o3 = (a3 == b3); 6 | o2 = (a2 == b2); 7 | o1 = (a1 == b1); 8 | o0 = (a0 == b0); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnor8.t: -------------------------------------------------------------------------------- 1 | xnor4 -20 0 2 | xnor4 20 0 3 | 4 | in a7 -39..-36 0 5 | in b7 -35..-32 0 6 | in a6 -29..-26 0 7 | in b6 -25..-22 0 8 | in a5 -19..-16 0 9 | in b5 -15..-12 0 10 | in a4 -9..-6 0 11 | in b4 -5..-2 0 12 | in a3 1..4 0 13 | in b3 5..8 0 14 | in a2 11..14 0 15 | in b2 15..18 0 16 | in a1 21..24 0 17 | in b1 25..28 0 18 | in a0 31..34 0 19 | in b0 35..38 0 20 | 21 | out o7 -37..-35 16 22 | out o6 -26..-24 16 23 | out o5 -17..-15 16 24 | out o4 -6..-4 16 25 | out o3 3..5 16 26 | out o2 14..16 16 27 | out o1 23..25 16 28 | out o0 34..36 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnorLeft.js: -------------------------------------------------------------------------------- 1 | o = (a == b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnorLeft.t: -------------------------------------------------------------------------------- 1 | # xnor with output toward left 2 | xor 0 0 3 | notRight -1 11 4 | in a -4..-1 0 5 | in b 0..3 0 6 | out o -2..0 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnorRight.js: -------------------------------------------------------------------------------- 1 | o = (a == b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xnorRight.t: -------------------------------------------------------------------------------- 1 | # xnor with output toward right 2 | xor 0 0 3 | notLeft 0 11 4 | in a -4..-1 0 5 | in b 0..3 0 6 | out o -1..1 16 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor.js: -------------------------------------------------------------------------------- 1 | o = (a != b); -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor.t: -------------------------------------------------------------------------------- 1 | ih -2 2 | ih 2 3 | iv -4 4 | iv 3 5 | _norLeft 0 1 6 | lu -2 7 | ju 1 8 | notLeft 2 5 9 | notRight -3 5 10 | ih 0 11 | in a -4..-1 0 12 | in b 0..3 0 13 | out o -2..1 11 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor16.js: -------------------------------------------------------------------------------- 1 | o15 = a15 != b15; 2 | o14 = a14 != b14; 3 | o13 = a13 != b13; 4 | o12 = a12 != b12; 5 | o11 = a11 != b11; 6 | o10 = a10 != b10; 7 | o9 = a9 != b9; 8 | o8 = a8 != b8; 9 | o7 = a7 != b7; 10 | o6 = a6 != b6; 11 | o5 = a5 != b5; 12 | o4 = a4 != b4; 13 | o3 = a3 != b3; 14 | o2 = a2 != b2; 15 | o1 = a1 != b1; 16 | o0 = a0 != b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor16.t: -------------------------------------------------------------------------------- 1 | xor8 40 0 2 | xor8 -40 0 3 | 4 | in a15 -79..-76 0 5 | in b15 -75..-72 0 6 | in a14 -69..-66 0 7 | in b14 -65..-62 0 8 | in a13 -59..-56 0 9 | in b13 -55..-52 0 10 | in a12 -49..-46 0 11 | in b12 -45..-42 0 12 | in a11 -39..-36 0 13 | in b11 -35..-32 0 14 | in a10 -29..-26 0 15 | in b10 -25..-22 0 16 | in a9 -19..-16 0 17 | in b9 -15..-12 0 18 | in a8 -9..-6 0 19 | in b8 -5..-2 0 20 | in a7 1..4 0 21 | in b7 5..8 0 22 | in a6 11..14 0 23 | in b6 15..18 0 24 | in a5 21..24 0 25 | in b5 25..28 0 26 | in a4 31..34 0 27 | in b4 35..38 0 28 | in a3 41..44 0 29 | in b3 45..48 0 30 | in a2 51..54 0 31 | in b2 55..58 0 32 | in a1 61..64 0 33 | in b1 65..68 0 34 | in a0 71..74 0 35 | in b0 75..78 0 36 | 37 | out o15 -77..-74 11 38 | out o14 -67..-64 11 39 | out o13 -57..-54 11 40 | out o12 -47..-44 11 41 | out o11 -37..-34 11 42 | out o10 -27..-24 11 43 | out o9 -17..-14 11 44 | out o8 -7..-4 11 45 | out o7 3..6 11 46 | out o6 13..16 11 47 | out o5 23..26 11 48 | out o4 33..36 11 49 | out o3 43..46 11 50 | out o2 53..56 11 51 | out o1 63..66 11 52 | out o0 73..76 11 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor2.js: -------------------------------------------------------------------------------- 1 | o1 = a1 != b1; 2 | o0 = a0 != b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor2.t: -------------------------------------------------------------------------------- 1 | xor -5 0 2 | xor 5 0 3 | 4 | in a1 -9..-6 0 5 | in b1 -5..-2 0 6 | in a0 1..4 0 7 | in b0 5..8 0 8 | 9 | out o1 -7..-4 11 10 | out o0 3..6 11 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor4.js: -------------------------------------------------------------------------------- 1 | o3 = a3 != b3; 2 | o2 = a2 != b2; 3 | o1 = a1 != b1; 4 | o0 = a0 != b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor4.t: -------------------------------------------------------------------------------- 1 | xor2 -10 0 2 | xor2 10 0 3 | 4 | in a3 -19..-16 0 5 | in b3 -15..-12 0 6 | in a2 -9..-6 0 7 | in b2 -5..-2 0 8 | in a1 1..4 0 9 | in b1 5..8 0 10 | in a0 11..14 0 11 | in b0 15..18 0 12 | 13 | out o3 -17..-14 11 14 | out o2 -7..-4 11 15 | out o1 3..6 11 16 | out o0 13..16 11 -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor8.js: -------------------------------------------------------------------------------- 1 | o7 = a7 != b7; 2 | o6 = a6 != b6; 3 | o5 = a5 != b5; 4 | o4 = a4 != b4; 5 | o3 = a3 != b3; 6 | o2 = a2 != b2; 7 | o1 = a1 != b1; 8 | o0 = a0 != b0; -------------------------------------------------------------------------------- /code/ts/gates/ordinary/xor8.t: -------------------------------------------------------------------------------- 1 | xor4 -20 0 2 | xor4 20 0 3 | 4 | in a7 -39..-36 0 5 | in b7 -35..-32 0 6 | in a6 -29..-26 0 7 | in b6 -25..-22 0 8 | in a5 -19..-16 0 9 | in b5 -15..-12 0 10 | in a4 -9..-6 0 11 | in b4 -5..-2 0 12 | in a3 1..4 0 13 | in b3 5..8 0 14 | in a2 11..14 0 15 | in b2 15..18 0 16 | in a1 21..24 0 17 | in b1 25..28 0 18 | in a0 31..34 0 19 | in b0 35..38 0 20 | 21 | out o7 -37..-34 11 22 | out o6 -27..-24 11 23 | out o5 -17..-14 11 24 | out o4 -7..-4 11 25 | out o3 3..6 11 26 | out o2 13..16 11 27 | out o1 23..26 11 28 | out o0 33..36 11 -------------------------------------------------------------------------------- /code/ts/logic/add.js: -------------------------------------------------------------------------------- 1 | aXorB = (a != b); 2 | sum = (carryIn != aXorB); 3 | carryOut = (a && b) || (carryIn && aXorB); -------------------------------------------------------------------------------- /code/ts/logic/add.t: -------------------------------------------------------------------------------- 1 | ih 0 2 | ih 3 3 | jd 7 4 | nor 5 2 5 | ir5 8 2 6 | nor 7 7 7 | s7 1 1 8 | ir8 -5 2 9 | ih 3 10 | ju 0 11 | swap -3 10 12 | ir24 5 7 13 | o 3 14 | o 5 15 | nor 4 33 16 | ir27 8 12 17 | ih 5 18 | nor 7 39 19 | ir43 12 0 20 | lu 11 21 | iv 12 22 | nor 9 44 23 | nor 11 49 24 | s9 6 43 25 | ir7 -2 44 26 | ih 7 27 | ih 4 28 | swap 1 51 29 | ir24 9 49 30 | ih 6 31 | nor 8 73 32 | ir25 12 54 33 | ih 9 34 | nor 11 79 35 | ir42 -8 31 36 | ih -4 37 | nor -7 73 38 | il6 -8 78 39 | 40 | in a -2..1 0 41 | in b 8 0 42 | in carryIn 11..12 0 43 | 44 | out carryOut -8 84 45 | out sum 10..12 84 -------------------------------------------------------------------------------- /code/ts/logic/add16.js: -------------------------------------------------------------------------------- 1 | a = (a15 ? 0x8000 : 0) | (a14 ? 0x4000 : 0) | (a13 ? 0x2000 : 0) | (a12 ? 0x1000 : 0) | (a11 ? 0x0800 : 0) | (a10 ? 0x0400 : 0) | (a9 ? 0x0200 : 0) | (a8 ? 0x0100 : 0) | (a7 ? 0x0080 : 0) | (a6 ? 0x0040 : 0) | (a5 ? 0x0020 : 0) | (a4 ? 0x0010 : 0) | (a3 ? 0x0008 : 0) | (a2 ? 0x0004 : 0) | (a1 ? 0x0002 : 0) | (a0 ? 0x0001 : 0); 2 | b = (b15 ? 0x8000 : 0) | (b14 ? 0x4000 : 0) | (b13 ? 0x2000 : 0) | (b12 ? 0x1000 : 0) | (b11 ? 0x0800 : 0) | (b10 ? 0x0400 : 0) | (b9 ? 0x0200 : 0) | (b8 ? 0x0100 : 0) | (b7 ? 0x0080 : 0) | (b6 ? 0x0040 : 0) | (b5 ? 0x0020 : 0) | (b4 ? 0x0010 : 0) | (b3 ? 0x0008 : 0) | (b2 ? 0x0004 : 0) | (b1 ? 0x0002 : 0) | (b0 ? 0x0001 : 0); 3 | s = a + b + (carryIn ? 1 : 0); 4 | carryOut = (s & 0x010000) != 0; 5 | s15 = (s & 0x8000) != 0; 6 | s14 = (s & 0x4000) != 0; 7 | s13 = (s & 0x2000) != 0; 8 | s12 = (s & 0x1000) != 0; 9 | s11 = (s & 0x0800) != 0; 10 | s10 = (s & 0x0400) != 0; 11 | s9 = (s & 0x0200) != 0; 12 | s8 = (s & 0x0100) != 0; 13 | s7 = (s & 0x0080) != 0; 14 | s6 = (s & 0x0040) != 0; 15 | s5 = (s & 0x0020) != 0; 16 | s4 = (s & 0x0010) != 0; 17 | s3 = (s & 0x0008) != 0; 18 | s2 = (s & 0x0004) != 0; 19 | s1 = (s & 0x0002) != 0; 20 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/add2.js: -------------------------------------------------------------------------------- 1 | a = (a1 ? 0x0002 : 0) | (a0 ? 0x0001 : 0); 2 | b = (b1 ? 0x0002 : 0) | (b0 ? 0x0001 : 0); 3 | s = a + b + (carryIn ? 1 : 0); 4 | carryOut = (s & 0x0004) != 0; 5 | s1 = (s & 0x0002) != 0; 6 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/add2.t: -------------------------------------------------------------------------------- 1 | add 10 0 2 | ir84 -2 0 3 | ir84 -12 0 4 | ir84 22 84 5 | add -10 84 6 | 7 | in a1 -12 0 8 | in b1 -2 0 9 | in a0 8 0 10 | in b0 18 0 11 | in carryIn 22 0 12 | 13 | out carryOut -18 168 14 | out s1 2 168 15 | out s0 22 168 -------------------------------------------------------------------------------- /code/ts/logic/add4.js: -------------------------------------------------------------------------------- 1 | a = (a3 ? 0x0008 : 0) | (a2 ? 0x0004 : 0) | (a1 ? 0x0002 : 0) | (a0 ? 0x0001 : 0); 2 | b = (b3 ? 0x0008 : 0) | (b2 ? 0x0004 : 0) | (b1 ? 0x0002 : 0) | (b0 ? 0x0001 : 0); 3 | s = a + b + (carryIn ? 1 : 0); 4 | carryOut = (s & 0x0010) != 0; 5 | s3 = (s & 0x0008) != 0; 6 | s2 = (s & 0x0004) != 0; 7 | s1 = (s & 0x0002) != 0; 8 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/add4.t: -------------------------------------------------------------------------------- 1 | add2 20 0 2 | ir168 -32 0 3 | ir168 -22 0 4 | ir168 -12 0 5 | ir168 -2 0 6 | ir168 22 168 7 | ir168 42 168 8 | add2 -20 168 9 | 10 | in a3 -32 0 11 | in b3 -22 0 12 | in a2 -12 0 13 | in b2 -2 0 14 | in a1 8 0 15 | in b1 18 0 16 | in a0 28 0 17 | in b0 38 0 18 | in carryIn 42 0 19 | 20 | out carryOut -38 336 21 | out s3 -18 336 22 | out s2 2 336 23 | out s1 22 336 24 | out s0 42 336 -------------------------------------------------------------------------------- /code/ts/logic/add8.js: -------------------------------------------------------------------------------- 1 | a = (a7 ? 0x0080 : 0) | (a6 ? 0x0040 : 0) | (a5 ? 0x0020 : 0) | (a4 ? 0x0010 : 0) | (a3 ? 0x0008 : 0) | (a2 ? 0x0004 : 0) | (a1 ? 0x0002 : 0) | (a0 ? 0x0001 : 0); 2 | b = (b7 ? 0x0080 : 0) | (b6 ? 0x0040 : 0) | (b5 ? 0x0020 : 0) | (b4 ? 0x0010 : 0) | (b3 ? 0x0008 : 0) | (b2 ? 0x0004 : 0) | (b1 ? 0x0002 : 0) | (b0 ? 0x0001 : 0); 3 | s = a + b + (carryIn ? 1 : 0); 4 | carryOut = (s & 0x0100) != 0; 5 | s7 = (s & 0x0080) != 0; 6 | s6 = (s & 0x0040) != 0; 7 | s5 = (s & 0x0020) != 0; 8 | s4 = (s & 0x0010) != 0; 9 | s3 = (s & 0x0008) != 0; 10 | s2 = (s & 0x0004) != 0; 11 | s1 = (s & 0x0002) != 0; 12 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/add8.t: -------------------------------------------------------------------------------- 1 | add4 40 0 2 | ir336 -72 0 3 | ir336 -62 0 4 | ir336 -52 0 5 | ir336 -42 0 6 | ir336 -32 0 7 | ir336 -22 0 8 | ir336 -12 0 9 | ir336 -2 0 10 | ir336 22 336 11 | ir336 42 336 12 | ir336 62 336 13 | ir336 82 336 14 | add4 -40 336 15 | 16 | in a7 -72 0 17 | in b7 -62 0 18 | in a6 -52 0 19 | in b6 -42 0 20 | in a5 -32 0 21 | in b5 -22 0 22 | in a4 -12 0 23 | in b4 -2 0 24 | in a3 8 0 25 | in b3 18 0 26 | in a2 28 0 27 | in b2 38 0 28 | in a1 48 0 29 | in b1 58 0 30 | in a0 68 0 31 | in b0 78 0 32 | in carryIn 82 0 33 | 34 | out carryOut -78 672 35 | out s7 -58 672 36 | out s6 -38 672 37 | out s5 -18 672 38 | out s4 2 672 39 | out s3 22 672 40 | out s2 42 672 41 | out s1 62 672 42 | out s0 82 672 -------------------------------------------------------------------------------- /code/ts/logic/dec.js: -------------------------------------------------------------------------------- 1 | r = enabled ? -1 : 0; 2 | r += a ? 0x0001 : 0; 3 | 4 | borrow = (r & 0x0002) != 0; 5 | difference = (r & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/dec.t: -------------------------------------------------------------------------------- 1 | ih 0 2 | ih 4 3 | il5 -2 1 4 | ir5 4 1 5 | nor nor1 1 1 6 | nor nor2 -1 6 7 | nor nor3 3 6 8 | ih -3 9 | ih 1 10 | ju -1 11 | ju -4 12 | 13 | in a -2 0 14 | in enabled 5 0 15 | 16 | out borrow -5 14 17 | out difference -2 14 -------------------------------------------------------------------------------- /code/ts/logic/dec16.js: -------------------------------------------------------------------------------- 1 | a = enabled ? -1 : 0; 2 | a += a15 ? 0x8000 : 0; 3 | a += a14 ? 0x4000 : 0; 4 | a += a13 ? 0x2000 : 0; 5 | a += a12 ? 0x1000 : 0; 6 | a += a11 ? 0x0800 : 0; 7 | a += a10 ? 0x0400 : 0; 8 | a += a9 ? 0x0200 : 0; 9 | a += a8 ? 0x0100 : 0; 10 | a += a7 ? 0x0080 : 0; 11 | a += a6 ? 0x0040 : 0; 12 | a += a5 ? 0x0020 : 0; 13 | a += a4 ? 0x0010 : 0; 14 | a += a3 ? 0x0008 : 0; 15 | a += a2 ? 0x0004 : 0; 16 | a += a1 ? 0x0002 : 0; 17 | a += a0 ? 0x0001 : 0; 18 | 19 | borrow = (a & 0x10000) != 0; 20 | d15 = (a & 0x8000) != 0; 21 | d14 = (a & 0x4000) != 0; 22 | d13 = (a & 0x2000) != 0; 23 | d12 = (a & 0x1000) != 0; 24 | d11 = (a & 0x0800) != 0; 25 | d10 = (a & 0x0400) != 0; 26 | d9 = (a & 0x0200) != 0; 27 | d8 = (a & 0x0100) != 0; 28 | d7 = (a & 0x0080) != 0; 29 | d6 = (a & 0x0040) != 0; 30 | d5 = (a & 0x0020) != 0; 31 | d4 = (a & 0x0010) != 0; 32 | d3 = (a & 0x0008) != 0; 33 | d2 = (a & 0x0004) != 0; 34 | d1 = (a & 0x0002) != 0; 35 | d0 = (a & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/dec16.t: -------------------------------------------------------------------------------- 1 | dec8 40 0 2 | ir112 -77 0 3 | ir112 -67 0 4 | ir112 -57 0 5 | ir112 -47 0 6 | ir112 -37 0 7 | ir112 -27 0 8 | ir112 -17 0 9 | ir112 -7 0 10 | ir112 3 112 11 | ir112 13 112 12 | ir112 23 112 13 | ir112 33 112 14 | ir112 43 112 15 | ir112 53 112 16 | ir112 63 112 17 | ir112 73 112 18 | dec8 -40 112 19 | 20 | in a15 -77 0 21 | in a14 -67 0 22 | in a13 -57 0 23 | in a12 -47 0 24 | in a11 -37 0 25 | in a10 -27 0 26 | in a9 -17 0 27 | in a8 -7 0 28 | in a7 3 0 29 | in a6 13 0 30 | in a5 23 0 31 | in a4 33 0 32 | in a3 43 0 33 | in a2 53 0 34 | in a1 63 0 35 | in a0 73 0 36 | in enabled 80 0 37 | 38 | out borrow -80 224 39 | out d15 -77 224 40 | out d14 -67 224 41 | out d13 -57 224 42 | out d12 -47 224 43 | out d11 -37 224 44 | out d10 -27 224 45 | out d9 -17 224 46 | out d8 -7 224 47 | out d7 3 224 48 | out d6 13 224 49 | out d5 23 224 50 | out d4 33 224 51 | out d3 43 224 52 | out d2 53 224 53 | out d1 63 224 54 | out d0 73 224 55 | -------------------------------------------------------------------------------- /code/ts/logic/dec2.js: -------------------------------------------------------------------------------- 1 | a = enabled ? -1 : 0; 2 | a += a1 ? 0x0002 : 0; 3 | a += a0 ? 0x0001 : 0; 4 | 5 | borrow = (a & 0x0004) != 0; 6 | d1 = (a & 0x0002) != 0; 7 | d0 = (a & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/dec2.t: -------------------------------------------------------------------------------- 1 | dec 5 0 2 | ir14 -7 0 3 | il14 3 14 4 | dec -5 14 5 | 6 | in a1 -7 0 7 | in a0 3 0 8 | in enabled 10 0 9 | 10 | out borrow -10 28 11 | out d1 -7 28 12 | out d0 3 28 -------------------------------------------------------------------------------- /code/ts/logic/dec4.js: -------------------------------------------------------------------------------- 1 | a = enabled ? -1 : 0; 2 | a += a3 ? 0x0008 : 0; 3 | a += a2 ? 0x0004 : 0; 4 | a += a1 ? 0x0002 : 0; 5 | a += a0 ? 0x0001 : 0; 6 | 7 | borrow = (a & 0x0010) != 0; 8 | d3 = (a & 0x0008) != 0; 9 | d2 = (a & 0x0004) != 0; 10 | d1 = (a & 0x0002) != 0; 11 | d0 = (a & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/dec4.t: -------------------------------------------------------------------------------- 1 | dec2 10 0 2 | ir28 -7 0 3 | ir28 -17 0 4 | ir28 3 28 5 | ir28 13 28 6 | dec2 -10 28 7 | 8 | in a3 -17 0 9 | in a2 -7 0 10 | in a1 3 0 11 | in a0 13 0 12 | in enabled 20 0 13 | 14 | out borrow -20 56 15 | out d3 -17 56 16 | out d2 -7 56 17 | out d1 3 56 18 | out d0 13 56 -------------------------------------------------------------------------------- /code/ts/logic/dec8.js: -------------------------------------------------------------------------------- 1 | a = enabled ? -1 : 0; 2 | a += a7 ? 0x0080 : 0; 3 | a += a6 ? 0x0040 : 0; 4 | a += a5 ? 0x0020 : 0; 5 | a += a4 ? 0x0010 : 0; 6 | a += a3 ? 0x0008 : 0; 7 | a += a2 ? 0x0004 : 0; 8 | a += a1 ? 0x0002 : 0; 9 | a += a0 ? 0x0001 : 0; 10 | 11 | borrow = (a & 0x0100) != 0; 12 | d7 = (a & 0x0080) != 0; 13 | d6 = (a & 0x0040) != 0; 14 | d5 = (a & 0x0020) != 0; 15 | d4 = (a & 0x0010) != 0; 16 | d3 = (a & 0x0008) != 0; 17 | d2 = (a & 0x0004) != 0; 18 | d1 = (a & 0x0002) != 0; 19 | d0 = (a & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/dec8.t: -------------------------------------------------------------------------------- 1 | dec4 20 0 2 | ir56 -37 0 3 | ir56 -27 0 4 | ir56 -17 0 5 | ir56 -7 0 6 | ir56 3 56 7 | ir56 13 56 8 | ir56 23 56 9 | ir56 33 56 10 | dec4 -20 56 11 | 12 | in a7 -37 0 13 | in a6 -27 0 14 | in a5 -17 0 15 | in a4 -7 0 16 | in a3 3 0 17 | in a2 13 0 18 | in a1 23 0 19 | in a0 33 0 20 | in enabled 40 0 21 | 22 | out borrow -40 112 23 | out d7 -37 112 24 | out d6 -27 112 25 | out d5 -17 112 26 | out d4 -7 112 27 | out d3 3 112 28 | out d2 13 112 29 | out d1 23 112 30 | out d0 33 112 -------------------------------------------------------------------------------- /code/ts/logic/enableLeft.js: -------------------------------------------------------------------------------- 1 | dataOut = dataIn; 2 | enabledOut = enabledIn; -------------------------------------------------------------------------------- /code/ts/logic/enableLeft.t: -------------------------------------------------------------------------------- 1 | swap 0 0 2 | zh 6 3 | td 8 4 | ih -2 5 | ih 2 6 | 7 | in enabledIn -1 0 8 | in dataIn 0 0 9 | 10 | out dataOut -1 22 11 | out enabledOut 0 22 9 22 -------------------------------------------------------------------------------- /code/ts/logic/enableLeft16.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do15 = di15; 3 | do14 = di14; 4 | do13 = di13; 5 | do12 = di12; 6 | do11 = di11; 7 | do10 = di10; 8 | do9 = di9; 9 | do8 = di8; 10 | do7 = di7; 11 | do6 = di6; 12 | do5 = di5; 13 | do4 = di4; 14 | do3 = di3; 15 | do2 = di2; 16 | do1 = di1; 17 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableLeft16.t: -------------------------------------------------------------------------------- 1 | enableLeft8 -40 0 2 | il176 5 0 3 | il176 15 0 4 | il176 25 0 5 | il176 35 0 6 | il176 45 0 7 | il176 55 0 8 | il176 65 0 9 | il176 75 0 10 | il176 -76 176 11 | il176 -75 176 12 | il176 -66 176 13 | il176 -65 176 14 | il176 -56 176 15 | il176 -55 176 16 | il176 -46 176 17 | il176 -45 176 18 | il176 -36 176 19 | il176 -35 176 20 | il176 -26 176 21 | il176 -25 176 22 | il176 -16 176 23 | il176 -15 176 24 | il176 -6 176 25 | il176 -5 176 26 | enableLeft8 40 176 27 | 28 | in enabledIn -76 0 29 | in di15 -75 0 30 | in di14 -65 0 31 | in di13 -55 0 32 | in di12 -45 0 33 | in di11 -35 0 34 | in di10 -25 0 35 | in di9 -15 0 36 | in di8 -5 0 37 | in di7 5 0 38 | in di6 15 0 39 | in di5 25 0 40 | in di4 35 0 41 | in di3 45 0 42 | in di2 55 0 43 | in di1 65 0 44 | in di0 75 0 45 | 46 | out enabledOut -75 352 -65 352 -55 352 -45 352 -35 352 -25 352 -15 352 -5 352 5 352 15 352 25 352 35 352 45 352 55 352 65 352 75 352 84 352 47 | out do15 -76 352 48 | out do14 -66 352 49 | out do13 -56 352 50 | out do12 -46 352 51 | out do11 -36 352 52 | out do10 -26 352 53 | out do9 -16 352 54 | out do8 -6 352 55 | out do7 4 352 56 | out do6 14 352 57 | out do5 24 352 58 | out do4 34 352 59 | out do3 44 352 60 | out do2 54 352 61 | out do1 64 352 62 | out do0 74 352 -------------------------------------------------------------------------------- /code/ts/logic/enableLeft2.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do1 = di1; 3 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableLeft2.t: -------------------------------------------------------------------------------- 1 | enableLeft -5 0 2 | il22 5 0 3 | il22 -5 22 4 | ir22 -6 22 5 | enableLeft 5 22 6 | 7 | in enabledIn -6 0 8 | in di1 -5 0 9 | in di0 5 0 10 | 11 | out enabledOut -5 44 5 44 14 44 12 | out do1 -6 44 13 | out do0 4 44 -------------------------------------------------------------------------------- /code/ts/logic/enableLeft4.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do3 = di3; 3 | do2 = di2; 4 | do1 = di1; 5 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableLeft4.t: -------------------------------------------------------------------------------- 1 | enableLeft2 -10 0 2 | il44 5 0 3 | il44 15 0 4 | il44 -16 44 5 | il44 -15 44 6 | il44 -6 44 7 | il44 -5 44 8 | enableLeft2 10 44 9 | 10 | in enabledIn -16 0 11 | in di3 -15 0 12 | in di2 -5 0 13 | in di1 5 0 14 | in di0 15 0 15 | 16 | out enabledOut -15 88 -5 88 5 88 15 88 24 88 17 | out do3 -16 88 18 | out do2 -6 88 19 | out do1 4 88 20 | out do0 14 88 -------------------------------------------------------------------------------- /code/ts/logic/enableLeft8.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do7 = di7; 3 | do6 = di6; 4 | do5 = di5; 5 | do4 = di4; 6 | do3 = di3; 7 | do2 = di2; 8 | do1 = di1; 9 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableLeft8.t: -------------------------------------------------------------------------------- 1 | enableLeft4 -20 0 2 | il88 5 0 3 | il88 15 0 4 | il88 25 0 5 | il88 35 0 6 | il88 -36 88 7 | il88 -35 88 8 | il88 -26 88 9 | il88 -25 88 10 | il88 -16 88 11 | il88 -15 88 12 | il88 -6 88 13 | il88 -5 88 14 | enableLeft4 20 88 15 | 16 | in enabledIn -36 0 17 | in di7 -35 0 18 | in di6 -25 0 19 | in di5 -15 0 20 | in di4 -5 0 21 | in di3 5 0 22 | in di2 15 0 23 | in di1 25 0 24 | in di0 35 0 25 | 26 | out enabledOut -35 176 -25 176 -15 176 -5 176 5 176 15 176 25 176 35 176 44 176 27 | out do7 -36 176 28 | out do6 -26 176 29 | out do5 -16 176 30 | out do4 -6 176 31 | out do3 4 176 32 | out do2 14 176 33 | out do1 24 176 34 | out do0 34 176 -------------------------------------------------------------------------------- /code/ts/logic/enableRight.js: -------------------------------------------------------------------------------- 1 | dataOut = dataIn; 2 | enabledOut = enabledIn; -------------------------------------------------------------------------------- /code/ts/logic/enableRight.t: -------------------------------------------------------------------------------- 1 | swap 0 0 2 | sh -7 3 | td -9 4 | ih 2 5 | ih -2 6 | 7 | in dataIn -1 0 8 | in enabledIn 0 0 9 | 10 | out dataOut 0 22 11 | out enabledOut -10 22 -1 22 -------------------------------------------------------------------------------- /code/ts/logic/enableRight16.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do15 = di15; 3 | do14 = di14; 4 | do13 = di13; 5 | do12 = di12; 6 | do11 = di11; 7 | do10 = di10; 8 | do9 = di9; 9 | do8 = di8; 10 | do7 = di7; 11 | do6 = di6; 12 | do5 = di5; 13 | do4 = di4; 14 | do3 = di3; 15 | do2 = di2; 16 | do1 = di1; 17 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableRight16.t: -------------------------------------------------------------------------------- 1 | enableRight8 40 0 2 | ir176 -74 0 3 | ir176 -64 0 4 | ir176 -54 0 5 | ir176 -44 0 6 | ir176 -34 0 7 | ir176 -24 0 8 | ir176 -14 0 9 | ir176 -4 0 10 | ir176 6 176 11 | ir176 7 176 12 | ir176 16 176 13 | ir176 17 176 14 | ir176 26 176 15 | ir176 27 176 16 | ir176 36 176 17 | ir176 37 176 18 | ir176 46 176 19 | ir176 47 176 20 | ir176 56 176 21 | ir176 57 176 22 | ir176 66 176 23 | ir176 67 176 24 | ir176 76 176 25 | ir176 77 176 26 | enableRight8 -40 176 27 | 28 | in di15 -74 0 29 | in di14 -64 0 30 | in di13 -54 0 31 | in di12 -44 0 32 | in di11 -34 0 33 | in di10 -24 0 34 | in di9 -14 0 35 | in di8 -4 0 36 | in di7 6 0 37 | in di6 16 0 38 | in di5 26 0 39 | in di4 36 0 40 | in di3 46 0 41 | in di2 56 0 42 | in di1 66 0 43 | in di0 76 0 44 | in enabledIn 77 0 45 | 46 | out enabledOut -83 352 -74 352 -64 352 -54 352 -44 352 -34 352 -24 352 -14 352 -4 352 6 352 16 352 26 352 36 352 46 352 56 352 66 352 76 352 47 | out do15 -73 352 48 | out do14 -63 352 49 | out do13 -53 352 50 | out do12 -43 352 51 | out do11 -33 352 52 | out do10 -23 352 53 | out do9 -13 352 54 | out do8 -3 352 55 | out do7 7 352 56 | out do6 17 352 57 | out do5 27 352 58 | out do4 37 352 59 | out do3 47 352 60 | out do2 57 352 61 | out do1 67 352 62 | out do0 77 352 -------------------------------------------------------------------------------- /code/ts/logic/enableRight2.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do1 = di1; 3 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableRight2.t: -------------------------------------------------------------------------------- 1 | enableRight 7 0 2 | ir22 -4 0 3 | ir22 6 22 4 | il22 7 22 5 | enableRight -3 22 6 | 7 | in di1 -4 0 8 | in di0 6 0 9 | in enabledIn 7 0 10 | 11 | out enabledOut -13 44 -4 44 6 44 12 | out do1 -3 44 13 | out do0 7 44 -------------------------------------------------------------------------------- /code/ts/logic/enableRight4.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do3 = di3; 3 | do2 = di2; 4 | do1 = di1; 5 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableRight4.t: -------------------------------------------------------------------------------- 1 | enableRight2 10 0 2 | ir44 -14 0 3 | ir44 -4 0 4 | ir44 6 44 5 | ir44 7 44 6 | ir44 16 44 7 | ir44 17 44 8 | enableRight2 -10 44 9 | 10 | in di3 -14 0 11 | in di2 -4 0 12 | in di1 6 0 13 | in di0 16 0 14 | in enabledIn 17 0 15 | 16 | out enabledOut -23 88 -14 88 -4 88 6 88 16 88 17 | out do3 -13 88 18 | out do2 -3 88 19 | out do1 7 88 20 | out do0 17 88 -------------------------------------------------------------------------------- /code/ts/logic/enableRight8.js: -------------------------------------------------------------------------------- 1 | enabledOut = enabledIn; 2 | do7 = di7; 3 | do6 = di6; 4 | do5 = di5; 5 | do4 = di4; 6 | do3 = di3; 7 | do2 = di2; 8 | do1 = di1; 9 | do0 = di0; -------------------------------------------------------------------------------- /code/ts/logic/enableRight8.t: -------------------------------------------------------------------------------- 1 | enableRight4 20 0 2 | ir88 -4 0 3 | ir88 -14 0 4 | ir88 -24 0 5 | ir88 -34 0 6 | ir88 6 88 7 | ir88 7 88 8 | ir88 16 88 9 | ir88 17 88 10 | ir88 26 88 11 | ir88 27 88 12 | ir88 36 88 13 | ir88 37 88 14 | enableRight4 -20 88 15 | 16 | in di7 -34 0 17 | in di6 -24 0 18 | in di5 -14 0 19 | in di4 -4 0 20 | in di3 6 0 21 | in di2 16 0 22 | in di1 26 0 23 | in di0 36 0 24 | in enabledIn 37 0 25 | 26 | out enabledOut -43 176 -34 176 -24 176 -14 176 -4 176 6 176 16 176 26 176 36 176 27 | out do7 -33 176 28 | out do6 -23 176 29 | out do5 -13 176 30 | out do4 -3 176 31 | out do3 7 176 32 | out do2 17 176 33 | out do1 27 176 34 | out do0 37 176 -------------------------------------------------------------------------------- /code/ts/logic/false.js: -------------------------------------------------------------------------------- 1 | o = false; -------------------------------------------------------------------------------- /code/ts/logic/false.t: -------------------------------------------------------------------------------- 1 | ih 0 2 | xor 0 1 3 | 4 | in i -2..1 0 5 | out o -2..1 12 -------------------------------------------------------------------------------- /code/ts/logic/halfAdder.js: -------------------------------------------------------------------------------- 1 | t = y ? 1 : 0; 2 | t += x ? 1 : 0; 3 | c = (t & 0x0002) != 0; 4 | s = (t & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/halfAdder.t: -------------------------------------------------------------------------------- 1 | ih -1 2 | sh -4 3 | sh -6 4 | jl -7 5 | iv -7 6 | iv -7 7 | iv -7 8 | iv -7 9 | iv -7 10 | iv -7 11 | jl 2 12 | jr 2 13 | nor 0 1 14 | swap 2 6 15 | ih -2 16 | notRight -7 28 17 | notLeft -3 28 18 | nor -5 33 19 | lr 4 20 | iv 4 21 | iv 4 22 | sh 3 23 | sh 1 24 | sh -1 25 | nor -3 38 26 | ju -7 27 | iv -8 28 | ih -1 29 | 30 | in x -3..0 0 31 | in y 1..2 0 32 | out c -8 44 33 | out s -3..0 44 -------------------------------------------------------------------------------- /code/ts/logic/halfSubtractor.js: -------------------------------------------------------------------------------- 1 | r = y ? -1 : 0; 2 | r += x ? 0x0001 : 0; 3 | 4 | b = (r & 0x0002) != 0; 5 | d = (r & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/halfSubtractor.t: -------------------------------------------------------------------------------- 1 | ih 0 2 | ih 4 3 | jl -1 4 | iv -2 5 | lr 3 6 | iv 4 7 | nor nor1 1 1 8 | nor nor2 -1 6 9 | nor nor3 3 6 10 | ih -3 11 | ih 1 12 | ju -1 13 | ju -4 14 | 15 | in x -2..1 0 16 | in y 2..5 0 17 | out b -5 14 18 | out d -2 14 -------------------------------------------------------------------------------- /code/ts/logic/inc.js: -------------------------------------------------------------------------------- 1 | s = enabled ? 1 : 0; 2 | s += a ? 1 : 0; 3 | carryOut = (s & 0x0002) != 0; 4 | sum = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/inc.t: -------------------------------------------------------------------------------- 1 | ih -1 2 | s5 -3 0 3 | ir27 -7 1 4 | jl 2 5 | jr 2 6 | nor nor1 0 1 7 | swap 2 6 8 | ih -2 9 | notRight not2 -7 28 10 | notLeft not3 -3 28 11 | nor nor4 -5 33 12 | il11 4 27 13 | s7 4 37 14 | nor nor5 -3 38 15 | ju -7 16 | iv -8 17 | ih -1 18 | 19 | in a 0 0 20 | in enabled 2 0 21 | 22 | out carryOut -8 44 23 | out sum 0 44 -------------------------------------------------------------------------------- /code/ts/logic/inc16.js: -------------------------------------------------------------------------------- 1 | s = enabled ? 1 : 0; 2 | s += a15 ? 0x8000 : 0; 3 | s += a14 ? 0x4000 : 0; 4 | s += a13 ? 0x2000 : 0; 5 | s += a12 ? 0x1000 : 0; 6 | s += a11 ? 0x0800 : 0; 7 | s += a10 ? 0x0400 : 0; 8 | s += a9 ? 0x0200 : 0; 9 | s += a8 ? 0x0100 : 0; 10 | s += a7 ? 0x0080 : 0; 11 | s += a6 ? 0x0040 : 0; 12 | s += a5 ? 0x0020 : 0; 13 | s += a4 ? 0x0010 : 0; 14 | s += a3 ? 0x0008 : 0; 15 | s += a2 ? 0x0004 : 0; 16 | s += a1 ? 0x0002 : 0; 17 | s += a0 ? 0x0001 : 0; 18 | carryOut = (s & 0x10000) != 0; 19 | s15 = (s & 0x8000) != 0; 20 | s14 = (s & 0x4000) != 0; 21 | s13 = (s & 0x2000) != 0; 22 | s12 = (s & 0x1000) != 0; 23 | s11 = (s & 0x0800) != 0; 24 | s10 = (s & 0x0400) != 0; 25 | s9 = (s & 0x0200) != 0; 26 | s8 = (s & 0x0100) != 0; 27 | s7 = (s & 0x0080) != 0; 28 | s6 = (s & 0x0040) != 0; 29 | s5 = (s & 0x0020) != 0; 30 | s4 = (s & 0x0010) != 0; 31 | s3 = (s & 0x0008) != 0; 32 | s2 = (s & 0x0004) != 0; 33 | s1 = (s & 0x0002) != 0; 34 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/inc16.t: -------------------------------------------------------------------------------- 1 | inc8 40 0 2 | ir352 -75 0 3 | ir352 -65 0 4 | ir352 -55 0 5 | ir352 -45 0 6 | ir352 -35 0 7 | ir352 -25 0 8 | ir352 -15 0 9 | ir352 -5 0 10 | ir352 5 352 11 | ir352 15 352 12 | ir352 25 352 13 | ir352 35 352 14 | ir352 45 352 15 | ir352 55 352 16 | ir352 65 352 17 | ir352 75 352 18 | inc8 -40 352 19 | 20 | in a15 -75 0 21 | in a14 -65 0 22 | in a13 -55 0 23 | in a12 -45 0 24 | in a11 -35 0 25 | in a10 -25 0 26 | in a9 -15 0 27 | in a8 -5 0 28 | in a7 5 0 29 | in a6 15 0 30 | in a5 25 0 31 | in a4 35 0 32 | in a3 45 0 33 | in a2 55 0 34 | in a1 65 0 35 | in a0 75 0 36 | in enabled 77 0 37 | 38 | out carryOut -83 704 39 | out s15 -75 704 40 | out s14 -65 704 41 | out s13 -55 704 42 | out s12 -45 704 43 | out s11 -35 704 44 | out s10 -25 704 45 | out s9 -15 704 46 | out s8 -5 704 47 | out s7 5 704 48 | out s6 15 704 49 | out s5 25 704 50 | out s4 35 704 51 | out s3 45 704 52 | out s2 55 704 53 | out s1 65 704 54 | out s0 75 704 -------------------------------------------------------------------------------- /code/ts/logic/inc2.js: -------------------------------------------------------------------------------- 1 | s = enabled ? 1 : 0; 2 | s += a1 ? 2 : 0; 3 | s += a0 ? 1 : 0; 4 | carryOut = (s & 0x0004) != 0; 5 | s1 = (s & 0x0002) != 0; 6 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/inc2.t: -------------------------------------------------------------------------------- 1 | inc 5 0 2 | ir44 -5 0 3 | ir44 5 44 4 | inc -5 44 5 | 6 | in a1 -5 0 7 | in a0 5 0 8 | in enabled 7 0 9 | 10 | out carryOut -13 88 11 | out s1 -5 88 12 | out s0 5 88 -------------------------------------------------------------------------------- /code/ts/logic/inc4.js: -------------------------------------------------------------------------------- 1 | s = enabled ? 1 : 0; 2 | s += a3 ? 8 : 0; 3 | s += a2 ? 4 : 0; 4 | s += a1 ? 2 : 0; 5 | s += a0 ? 1 : 0; 6 | carryOut = (s & 0x0010) != 0; 7 | s3 = (s & 0x0008) != 0; 8 | s2 = (s & 0x0004) != 0; 9 | s1 = (s & 0x0002) != 0; 10 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/inc4.t: -------------------------------------------------------------------------------- 1 | inc2 10 0 2 | ir88 -15 0 3 | ir88 -5 0 4 | ir88 5 88 5 | ir88 15 88 6 | inc2 -10 88 7 | 8 | in a3 -15 0 9 | in a2 -5 0 10 | in a1 5 0 11 | in a0 15 0 12 | in enabled 17 0 13 | 14 | out carryOut -23 176 15 | out s3 -15 176 16 | out s2 -5 176 17 | out s1 5 176 18 | out s0 15 176 -------------------------------------------------------------------------------- /code/ts/logic/inc8.js: -------------------------------------------------------------------------------- 1 | s = enabled ? 1 : 0; 2 | s += a7 ? 0x0080 : 0; 3 | s += a6 ? 0x0040 : 0; 4 | s += a5 ? 0x0020 : 0; 5 | s += a4 ? 0x0010 : 0; 6 | s += a3 ? 0x0008 : 0; 7 | s += a2 ? 0x0004 : 0; 8 | s += a1 ? 0x0002 : 0; 9 | s += a0 ? 0x0001 : 0; 10 | carryOut = (s & 0x0100) != 0; 11 | s7 = (s & 0x0080) != 0; 12 | s6 = (s & 0x0040) != 0; 13 | s5 = (s & 0x0020) != 0; 14 | s4 = (s & 0x0010) != 0; 15 | s3 = (s & 0x0008) != 0; 16 | s2 = (s & 0x0004) != 0; 17 | s1 = (s & 0x0002) != 0; 18 | s0 = (s & 0x0001) != 0; -------------------------------------------------------------------------------- /code/ts/logic/inc8.t: -------------------------------------------------------------------------------- 1 | inc4 20 0 2 | ir176 -35 0 3 | ir176 -25 0 4 | ir176 -15 0 5 | ir176 -5 0 6 | ir176 5 176 7 | ir176 15 176 8 | ir176 25 176 9 | ir176 35 176 10 | inc4 -20 176 11 | 12 | in a7 -35 0 13 | in a6 -25 0 14 | in a5 -15 0 15 | in a4 -5 0 16 | in a3 5 0 17 | in a2 15 0 18 | in a1 25 0 19 | in a0 35 0 20 | in enabled 37 0 21 | 22 | out carryOut -43 352 23 | out s7 -35 352 24 | out s6 -25 352 25 | out s5 -15 352 26 | out s4 -5 352 27 | out s3 5 352 28 | out s2 15 352 29 | out s1 25 352 30 | out s0 35 352 -------------------------------------------------------------------------------- /code/ts/logic/muxLeft.js: -------------------------------------------------------------------------------- 1 | o = s ? l : r; -------------------------------------------------------------------------------- /code/ts/logic/muxLeft.t: -------------------------------------------------------------------------------- 1 | # (left, select left, right) 2 | ih 0 3 | ih 4 4 | ih -4 5 | notLeft -4 1 6 | notRight -1 1 7 | notRight 4 1 8 | jr 1 9 | o 2 10 | ih -2 11 | ih 3 12 | nand 0 7 13 | in l -6..-3 0 14 | in s -2..1 0 15 | in r 2..5 0 16 | out o -2..1 13 -------------------------------------------------------------------------------- /code/ts/logic/muxRight.js: -------------------------------------------------------------------------------- 1 | o = s ? r : l; -------------------------------------------------------------------------------- /code/ts/logic/muxRight.t: -------------------------------------------------------------------------------- 1 | # (left, select right, right) 2 | ih 0 3 | ih 4 4 | ih -4 5 | notLeft 0 1 6 | notRight 3 1 7 | notLeft -5 1 8 | ll -2 9 | o -2 10 | ih -3 11 | ih 2 12 | nand 0 7 13 | in l -6..-3 0 14 | in s -2..1 0 15 | in r 2..5 0 16 | out o -2..1 13 -------------------------------------------------------------------------------- /code/ts/logic/swap.js: -------------------------------------------------------------------------------- 1 | o0 = i1; 2 | o1 = i0; -------------------------------------------------------------------------------- /code/ts/logic/swap.t: -------------------------------------------------------------------------------- 1 | ih -2 2 | ih 2 3 | ll -4 4 | jr 3 5 | ih -5 6 | ih 5 7 | _norLeft 0 1 8 | lu -2 9 | ju 1 10 | _norLeft -3 5 11 | _norRight 3 5 12 | ih -2 13 | ih 2 14 | iv -7 15 | iv 6 7 16 | ih 0 17 | jd -6 18 | ld 5 19 | xor -4 10 20 | xor 4 10 21 | in i1 -4..-1 0 22 | in i0 0..3 0 23 | out o1 -6..-3 21 24 | out o0 2..5 21 -------------------------------------------------------------------------------- /code/ts/logic/true.js: -------------------------------------------------------------------------------- 1 | o = true; -------------------------------------------------------------------------------- /code/ts/logic/true.t: -------------------------------------------------------------------------------- 1 | ih 0 2 | xnor 0 1 3 | 4 | in i -2..1 0 5 | out o -1..1 17 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/asm/LexerException.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.asm; 2 | 3 | public class LexerException extends RuntimeException { 4 | 5 | private final String filename; 6 | private final int lineNumber; 7 | private final int lineColumn; 8 | 9 | public LexerException(final Token token, final String message) { 10 | this(token.getFilename(), token.getLineNumber(), token.getLineColumn(), message); 11 | } 12 | 13 | public LexerException(final String filename, final int lineNumber, final int lineColumn, final String message) { 14 | super(message); 15 | this.filename = filename; 16 | this.lineNumber = lineNumber; 17 | this.lineColumn = lineColumn; 18 | } 19 | 20 | public String getFilename() { 21 | return filename; 22 | } 23 | 24 | public int getLineNumber() { 25 | return lineNumber; 26 | } 27 | 28 | public int getLineColumn() { 29 | return lineColumn; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return String.format("%s:[%d,%d] error: %s", filename, lineNumber, lineColumn, getMessage()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/asm/TokenType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.asm; 2 | 3 | public enum TokenType { 4 | BYTE, 5 | COMMENT, 6 | DEFINE, 7 | END, 8 | IDENTIFIER, 9 | INSTRUCTION, 10 | LABEL, 11 | SEGMENT, 12 | WORD, 13 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/gpc/app/ProcessorAndMemory.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.gpc.app; 2 | 3 | public interface ProcessorAndMemory { 4 | boolean init(String[] args) throws Exception; 5 | void executeInstruction(); 6 | int read(int address); 7 | void write(int address, int value); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/mc/Instruction.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.mc; 2 | 3 | public class Instruction { 4 | 5 | private final String component; 6 | private final int index; 7 | 8 | public Instruction(final String component, final int index) { 9 | this.component = component; 10 | this.index = index; 11 | } 12 | 13 | public String getComponent() { 14 | return component; 15 | } 16 | 17 | public int getIndex() { 18 | return index; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return String.format("%s %d", component, index); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/mc/LexerParserException.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.mc; 2 | 3 | public class LexerParserException extends RuntimeException { 4 | 5 | private final String filename; 6 | private final int lineNumber; 7 | private final int lineColumn; 8 | 9 | public LexerParserException(final Token token, final String message) { 10 | this(token.getFilename(), token.getLineNumber(), token.getLineColumn(), message); 11 | } 12 | 13 | public LexerParserException(final String filename, final int lineNumber, final int lineColumn, 14 | final String message) { 15 | super(message); 16 | this.filename = filename; 17 | this.lineNumber = lineNumber; 18 | this.lineColumn = lineColumn; 19 | } 20 | 21 | public String getFilename() { 22 | return filename; 23 | } 24 | 25 | public int getLineNumber() { 26 | return lineNumber; 27 | } 28 | 29 | public int getLineColumn() { 30 | return lineColumn; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.format("%s:[%d,%d] error: %s", filename, lineNumber, lineColumn, getMessage()); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/mc/TokenType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.mc; 2 | 3 | enum TokenType { 4 | STRING, 5 | NUMBER, 6 | END, 7 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/Extents.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class Extents { 4 | 5 | private final int minX; 6 | private final int maxX; 7 | private final int minY; 8 | private final int maxY; 9 | 10 | public Extents(final int minX, final int maxX, final int minY, final int maxY) { 11 | this.minX = minX; 12 | this.maxX = maxX; 13 | this.minY = minY; 14 | this.maxY = maxY; 15 | } 16 | 17 | public int getMinX() { 18 | return minX; 19 | } 20 | 21 | public int getMaxX() { 22 | return maxX; 23 | } 24 | 25 | public int getMinY() { 26 | return minY; 27 | } 28 | 29 | public int getMaxY() { 30 | return maxY; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.format("%d %d %d %d", minX, maxX, minY, maxY); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/HorizontalLine.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class HorizontalLine { 4 | 5 | private final int minX; 6 | private final int maxX; 7 | private final int y; 8 | 9 | public HorizontalLine(final int x, final int y) { 10 | this(x, x, y); 11 | } 12 | 13 | public HorizontalLine(final int minX, final int maxX, final int y) { 14 | if (minX > maxX) { 15 | this.minX = maxX; 16 | this.maxX = minX; 17 | } else { 18 | this.minX = minX; 19 | this.maxX = maxX; 20 | } 21 | this.y = y; 22 | } 23 | 24 | public int getMinX() { 25 | return minX; 26 | } 27 | 28 | public int getMaxX() { 29 | return maxX; 30 | } 31 | 32 | public int getY() { 33 | return y; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return (minX == maxX) ? String.format("%d %d", minX, y) : String.format("%d..%d %d", minX, maxX, y); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/Point.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class Point { 4 | 5 | public final int x; 6 | public final int y; 7 | 8 | public Point(final int x, final int y) { 9 | this.x = x; 10 | this.y = y; 11 | } 12 | 13 | public int getX() { 14 | return x; 15 | } 16 | 17 | public int getY() { 18 | return y; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return String.format("%d %d", x, y); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/Range.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class Range { 4 | 5 | private final int min; 6 | private final int max; 7 | 8 | public Range(final int value) { 9 | this(value, value); 10 | } 11 | 12 | public Range(final int min, final int max) { 13 | if (min > max) { 14 | this.min = max; 15 | this.max = min; 16 | } else { 17 | this.min = min; 18 | this.max = max; 19 | } 20 | } 21 | 22 | public int getMin() { 23 | return min; 24 | } 25 | 26 | public int getMax() { 27 | return max; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return (min == max) ? Integer.toString(min) : String.format("%d..%d", min, max); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/SimulatorException.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class SimulatorException extends Exception { 4 | 5 | public SimulatorException() { 6 | } 7 | 8 | public SimulatorException(final String message) { 9 | super(message); 10 | } 11 | 12 | public SimulatorException(final String message, final Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public SimulatorException(final Throwable cause) { 17 | super(cause); 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/TerminalRectangle.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public class TerminalRectangle { 4 | 5 | public final int x; 6 | public final int y; 7 | public final int width; 8 | final TerminalState state; 9 | 10 | public TerminalRectangle(final int x, final int y, final int width, final TerminalState state) { 11 | this.x = x; 12 | this.y = y; 13 | this.width = width; 14 | this.state = state; 15 | } 16 | 17 | public int getX() { 18 | return x; 19 | } 20 | 21 | public int getY() { 22 | return y; 23 | } 24 | 25 | public int getWidth() { 26 | return width; 27 | } 28 | 29 | public TerminalState getState() { 30 | return state; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.format("%d %d %d %s", x, y, width, state); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/TerminalState.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public enum TerminalState { 4 | UNKNOWN, 5 | ZERO, 6 | ONE, 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/sim/TerminalType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.sim; 2 | 3 | public enum TerminalType { 4 | 5 | INPUT("in"), 6 | OUTPUT("out"); 7 | 8 | private final String name; 9 | 10 | private TerminalType(final String name) { 11 | this.name = name; 12 | } 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | return name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/ts/ByteLutType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.ts; 2 | 3 | import java.util.Collections; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public enum ByteLutType { 8 | 9 | ONE_BYTE(1), 10 | TWO_BYTES(2), 11 | BIT_TWO_BYTES(3), 12 | TWO_BYTES_BIT(4), 13 | THREE_BYTES(5); 14 | 15 | private static final Map lutTypes; 16 | 17 | static { 18 | final Map types = new HashMap<>(); 19 | for (final ByteLutType lutType : ByteLutType.values()) { 20 | types.put(lutType.value, lutType); 21 | } 22 | lutTypes = Collections.unmodifiableMap(types); 23 | } 24 | 25 | public static ByteLutType fromValue(final int value) { 26 | return lutTypes.get(value); 27 | } 28 | 29 | private final int value; 30 | 31 | ByteLutType(final int value) { 32 | this.value = value; 33 | } 34 | 35 | public int getValue() { 36 | return value; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/ts/ComponentLutType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.ts; 2 | 3 | public enum ComponentLutType { 4 | ANY, 5 | BIT_TWO_BYTES, 6 | TWO_BYTES_BIT, 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/ts/LexerParserException.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.ts; 2 | 3 | public class LexerParserException extends RuntimeException { 4 | 5 | private final String filename; 6 | private final int lineNumber; 7 | private final int lineColumn; 8 | 9 | public LexerParserException(final Token token, final String message) { 10 | this(token.getFilename(), token.getLineNumber(), token.getLineColumn(), message); 11 | } 12 | 13 | public LexerParserException(final String filename, final int lineNumber, final int lineColumn, 14 | final String message) { 15 | super(message); 16 | this.filename = filename; 17 | this.lineNumber = lineNumber; 18 | this.lineColumn = lineColumn; 19 | } 20 | 21 | public String getFilename() { 22 | return filename; 23 | } 24 | 25 | public int getLineNumber() { 26 | return lineNumber; 27 | } 28 | 29 | public int getLineColumn() { 30 | return lineColumn; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.format("%s:[%d,%d] error: %s", filename, lineNumber, lineColumn, getMessage()); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/ts/TokenType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.ts; 2 | 3 | enum TokenType { 4 | STRING, 5 | NUMBER, 6 | RANGE, 7 | END, 8 | } -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/ts/TokenValueType.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.ts; 2 | 3 | enum TokenValueType { 4 | UNKNOWN, 5 | X, 6 | Y, 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/BuildListener.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | import tetrominocomputer.sim.Structure; 4 | import java.util.Map; 5 | 6 | public interface BuildListener { 7 | void buildStarted(); 8 | void buildCompleted(String[] componentNames, Map structures); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/License.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | 7 | public final class License { 8 | 9 | private static final String LICENSE; 10 | 11 | static { 12 | final StringBuilder sb = new StringBuilder(); 13 | try (final BufferedReader br = new BufferedReader(new InputStreamReader( 14 | License.class.getResourceAsStream("/license/lgpl-2.1.txt")))) { 15 | String line; 16 | while ((line = br.readLine()) != null) { 17 | sb.append(line).append(System.lineSeparator()); 18 | } 19 | } catch (final IOException e) { 20 | e.printStackTrace(); 21 | } 22 | LICENSE = sb.toString(); 23 | } 24 | 25 | public static String getLicense() { 26 | return LICENSE; 27 | } 28 | 29 | private License() { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/OpenListener.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | import java.io.File; 4 | 5 | public interface OpenListener { 6 | void openedFiles(String componentName, File tetrominoScriptFile, String tetrominoScript, File javaScriptFile, 7 | String javaScript, String testBits); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/OutputListener.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | public interface OutputListener { 4 | void clear(); 5 | void format(String text, Object... args); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/RunListener.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | import tetrominocomputer.sim.Structure; 4 | 5 | public interface RunListener { 6 | void runCompleted(Structure structure); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/StructureListener.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | import tetrominocomputer.sim.Structure; 4 | 5 | public interface StructureListener { 6 | void clear(); 7 | void structureLocked(final Structure lockedStructure); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/app/Version.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.app; 2 | 3 | public final class Version { 4 | 5 | private static final String YEAR = "2023"; 6 | private static final String VERSION = "1.0.0"; 7 | 8 | public static String getVersion() { 9 | return VERSION; 10 | } 11 | 12 | public static String getYear() { 13 | return YEAR; 14 | } 15 | 16 | private Version() { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/tse/ui/PathPoint.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.tse.ui; 2 | 3 | public class PathPoint { 4 | 5 | public final int x; 6 | public final int y; 7 | public final boolean right; 8 | public final boolean bottom; 9 | 10 | public PathPoint(final int x, final int y, final boolean right, final boolean bottom) { 11 | this.x = x; 12 | this.y = y; 13 | this.right = right; 14 | this.bottom = bottom; 15 | } 16 | 17 | public int getX() { 18 | return x; 19 | } 20 | 21 | public int getY() { 22 | return y; 23 | } 24 | 25 | public boolean isRight() { 26 | return right; 27 | } 28 | 29 | public boolean isBottom() { 30 | return bottom; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return String.format("%d %d %b %b", x, y, right, bottom); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/util/Dirs.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.util; 2 | 3 | import java.io.File; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | public interface Dirs { 7 | 8 | String USER = System.getProperty("user.dir"); 9 | 10 | String CODE = USER + File.separator + "code" + File.separator; 11 | 12 | String ASM = CODE + "asm" + File.separator; 13 | String BIN = CODE + "bin" + File.separator; 14 | String LUTS = CODE + "luts" + File.separator; 15 | String MC = CODE + "mc" + File.separator; 16 | String TS = CODE + "ts" + File.separator; 17 | 18 | String WEB = USER + File.separator + "web" + File.separator; 19 | 20 | static File toFile(final String dirName) { 21 | String name = StringUtils.trimToEmpty(dirName); 22 | if (!(name.endsWith("/") || name.endsWith("\\") || name.endsWith(File.separator))) { 23 | name += File.separator; 24 | } 25 | return new File(name); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/tetrominocomputer/util/Js.java: -------------------------------------------------------------------------------- 1 | package tetrominocomputer.util; 2 | 3 | import javax.script.ScriptEngine; 4 | import javax.script.ScriptEngineManager; 5 | import jdk.nashorn.api.scripting.NashornScriptEngineFactory; 6 | 7 | public final class Js { 8 | 9 | public static ScriptEngine getScriptEngine() { 10 | 11 | if (Double.parseDouble(System.getProperty("java.specification.version")) < 15) { 12 | return new NashornScriptEngineFactory().getScriptEngine(); 13 | } 14 | 15 | return new ScriptEngineManager().getEngineByName("nashorn"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/add.png -------------------------------------------------------------------------------- /src/main/resources/icons/center-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/center-pressed.png -------------------------------------------------------------------------------- /src/main/resources/icons/center-rollover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/center-rollover.png -------------------------------------------------------------------------------- /src/main/resources/icons/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/center.png -------------------------------------------------------------------------------- /src/main/resources/icons/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/error.png -------------------------------------------------------------------------------- /src/main/resources/icons/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/information.png -------------------------------------------------------------------------------- /src/main/resources/icons/logo128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/logo128x128.png -------------------------------------------------------------------------------- /src/main/resources/icons/logo16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/logo16x16.png -------------------------------------------------------------------------------- /src/main/resources/icons/logo32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/logo32x32.png -------------------------------------------------------------------------------- /src/main/resources/icons/logo64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/logo64x64.png -------------------------------------------------------------------------------- /src/main/resources/icons/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/question.png -------------------------------------------------------------------------------- /src/main/resources/icons/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/run.png -------------------------------------------------------------------------------- /src/main/resources/icons/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/icons/warning.png -------------------------------------------------------------------------------- /src/main/resources/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/src/main/resources/images/logo.png -------------------------------------------------------------------------------- /target/tetromino-computer.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/target/tetromino-computer.jar -------------------------------------------------------------------------------- /web/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/apple-touch-icon.png -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/favicon.ico -------------------------------------------------------------------------------- /web/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /web/general-purpose-computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/general-purpose-computer.png -------------------------------------------------------------------------------- /web/google-touch-icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/google-touch-icon-192.png -------------------------------------------------------------------------------- /web/google-touch-icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/google-touch-icon-512.png -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Tetromino Computer", 3 | "name": "Tetris is Capable of Universal Computation", 4 | "icons": [ 5 | { 6 | "src": "google-touch-icon-192.png", 7 | "sizes": "192x192" 8 | }, 9 | { 10 | "src": "google-touch-icon-512.png", 11 | "sizes": "512x512" 12 | } 13 | ], 14 | "start_url": "/index.html", 15 | "background_color": "#FFFFFF", 16 | "theme_color": "#FFFFFF", 17 | "display": "fullscreen" 18 | } -------------------------------------------------------------------------------- /web/mask-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /web/tse-cell-minus-two-zero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-cell-minus-two-zero.png -------------------------------------------------------------------------------- /web/tse-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-comment.png -------------------------------------------------------------------------------- /web/tse-depth-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-depth-0.png -------------------------------------------------------------------------------- /web/tse-depth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-depth-1.png -------------------------------------------------------------------------------- /web/tse-depth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-depth-2.png -------------------------------------------------------------------------------- /web/tse-depth-2a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-depth-2a.png -------------------------------------------------------------------------------- /web/tse-export-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-export-html.png -------------------------------------------------------------------------------- /web/tse-export-svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-export-svg.png -------------------------------------------------------------------------------- /web/tse-file-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-file-new.png -------------------------------------------------------------------------------- /web/tse-in-a-coordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-in-a-coordinates.png -------------------------------------------------------------------------------- /web/tse-in-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-in-a.png -------------------------------------------------------------------------------- /web/tse-in-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-in-b.png -------------------------------------------------------------------------------- /web/tse-input-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-input-01.png -------------------------------------------------------------------------------- /web/tse-input-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-input-11.png -------------------------------------------------------------------------------- /web/tse-inverters-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-0.png -------------------------------------------------------------------------------- /web/tse-inverters-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-1.png -------------------------------------------------------------------------------- /web/tse-inverters-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-2.png -------------------------------------------------------------------------------- /web/tse-inverters-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-3.png -------------------------------------------------------------------------------- /web/tse-inverters-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-4.png -------------------------------------------------------------------------------- /web/tse-inverters-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-5.png -------------------------------------------------------------------------------- /web/tse-inverters-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-6.png -------------------------------------------------------------------------------- /web/tse-inverters-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-7.png -------------------------------------------------------------------------------- /web/tse-inverters-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-inverters-8.png -------------------------------------------------------------------------------- /web/tse-ir8-drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-ir8-drag.png -------------------------------------------------------------------------------- /web/tse-ir8-drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-ir8-drop.png -------------------------------------------------------------------------------- /web/tse-js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-js.png -------------------------------------------------------------------------------- /web/tse-new-file-chooser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-new-file-chooser.png -------------------------------------------------------------------------------- /web/tse-new-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-new-result.png -------------------------------------------------------------------------------- /web/tse-nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-nodes.png -------------------------------------------------------------------------------- /web/tse-not1-not2-depth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-not1-not2-depth-1.png -------------------------------------------------------------------------------- /web/tse-not1-not2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-not1-not2.png -------------------------------------------------------------------------------- /web/tse-notleft-added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notleft-added.png -------------------------------------------------------------------------------- /web/tse-notleft-drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notleft-drag.png -------------------------------------------------------------------------------- /web/tse-notleft-insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notleft-insert.png -------------------------------------------------------------------------------- /web/tse-notleft-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notleft-select.png -------------------------------------------------------------------------------- /web/tse-notright-appended.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notright-appended.png -------------------------------------------------------------------------------- /web/tse-notright-overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notright-overlap.png -------------------------------------------------------------------------------- /web/tse-notright-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notright-select.png -------------------------------------------------------------------------------- /web/tse-notright-value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-notright-value.png -------------------------------------------------------------------------------- /web/tse-or-added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-or-added.png -------------------------------------------------------------------------------- /web/tse-or-appended.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-or-appended.png -------------------------------------------------------------------------------- /web/tse-or-overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-or-overlap.png -------------------------------------------------------------------------------- /web/tse-or-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-or-select.png -------------------------------------------------------------------------------- /web/tse-output-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-output-node.png -------------------------------------------------------------------------------- /web/tse-s7-bottom-input-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-bottom-input-1.png -------------------------------------------------------------------------------- /web/tse-s7-bottom-input-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-bottom-input-2.png -------------------------------------------------------------------------------- /web/tse-s7-drag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-drag.png -------------------------------------------------------------------------------- /web/tse-s7-input-nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-input-nodes.png -------------------------------------------------------------------------------- /web/tse-s7-right-input-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-right-input-1.png -------------------------------------------------------------------------------- /web/tse-s7-right-input-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-s7-right-input-2.png -------------------------------------------------------------------------------- /web/tse-status-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-status-bar.png -------------------------------------------------------------------------------- /web/tse-swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-swap.png -------------------------------------------------------------------------------- /web/tse-test-failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-test-failed.png -------------------------------------------------------------------------------- /web/tse-test-fully.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-test-fully.png -------------------------------------------------------------------------------- /web/tse-test-passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-test-passed.png -------------------------------------------------------------------------------- /web/tse-three-wide-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-three-wide-2.png -------------------------------------------------------------------------------- /web/tse-three-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-three-wide.png -------------------------------------------------------------------------------- /web/tse-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-toolbar.png -------------------------------------------------------------------------------- /web/tse-translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-translate.png -------------------------------------------------------------------------------- /web/tse-z7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-z7.png -------------------------------------------------------------------------------- /web/tse-zoom-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meatfighter/tetromino-computer/63fb6cc24348435a259569aad341df6a481d71be/web/tse-zoom-32.png --------------------------------------------------------------------------------