New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mips-core

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mips-core - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

build/mips-core.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mips-core",[],t):"object"==typeof exports?exports["mips-core"]=t():e["mips-core"]=t()}(this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){(void 0)(["./assembler","./instruction","./hardware","./simulator"],function(e,t){"use strict";t&&t.id;function n(t){var n={};for(var o in t)"default"!==o&&(n[o]=t[o]);e(n)}return{setters:[function(e){n(e)},function(e){n(e)},function(e){n(e)},function(e){n(e)}],execute:function(){}}})}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mips-core",[],e):"object"==typeof exports?exports["mips-core"]=e():t["mips-core"]=e()}(this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){var n;void 0===(n=function(t,e){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.READ=0]="READ",t[t.WRITE=1]="WRITE",t[t.RESET=2]="RESET"}(r=e.RegisterAccessType||(e.RegisterAccessType={}));var n=function(){function t(t,e,r){this.observer=null,this.name=t,this.num=e,this.value=r,this.resetVal=r}return t.prototype.notifyObserver=function(t){this.observer&&this.observer(this.num,t)},t.prototype.reset=function(){this.value=this.resetVal,this.notifyObserver(r.RESET)},t.prototype.set=function(t){this.value=t,this.notifyObserver(r.WRITE)},t.prototype.get=function(){return this.notifyObserver(r.READ),this.value},t}();e.Register=n}.apply(e,[r,e]))||(t.exports=n)},function(t,e,r){var n,i;n=[r,e,r(0),r(7)],void 0===(i=function(t,e,r,n){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r),i(n)}.apply(e,n))||(t.exports=i)},function(t,e,r){var n;void 0===(n=function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.R_FORMAT=0]="R_FORMAT",t[t.I_FORMAT=1]="I_FORMAT"}(e.InstructionFormat||(e.InstructionFormat={}))}.apply(e,[r,e]))||(t.exports=n)},function(t,e,r){var n,i;n=[r,e,r(2),r(8)],void 0===(i=function(t,e,r,n){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r),i(n)}.apply(e,n))||(t.exports=i)},function(t,e,r){var n,i;n=[r,e,r(9)],void 0===(i=function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r)}.apply(e,n))||(t.exports=i)},function(t,e,r){var n,i;n=[r,e,r(4),r(1),r(3)],void 0===(i=function(t,e,r,n,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e,o){this.observer=null,this.registerFile=new n.RegisterFile(t);var s=1e3/(e*o);this.instructionSet=new i.InstructionSet(this.registerFile,s);var u=Object.keys(this.instructionSet.instructions);this.parser=new r.Parser(t,u)}return t.prototype.run=function(t){var e=this.parser.parse(t);for(var r in e){var n=parseInt(r,10);if(e[n]){this.notifyObserver(n);var i=e[n];this.instructionSet.getInstruction(i[0]).run(i[1],i[2],i[3])}}},t.prototype.notifyObserver=function(t){this.observer&&this.observer(t)},t}();e.Simulator=o}.apply(e,n))||(t.exports=i)},function(t,e,r){var n,i;n=[r,e,r(5)],void 0===(i=function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r)}.apply(e,n))||(t.exports=i)},function(t,e,r){var n,i;n=[r,e,r(0)],void 0===(i=function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){for(var e in this.registerList=[],t){var n=t[e];this.registerList[n]=new r.Register(e,n,0)}}return t.prototype.getRegister=function(t){return this.registerList[t]},t.prototype.setObserver=function(t){for(var e=0,r=this.registerList;e<r.length;e++){r[e].observer=t}},t}();e.RegisterFile=n}.apply(e,n))||(t.exports=i)},function(t,e,r){var n,i,o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function u(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}c((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=n[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};n=[r,e,r(2)],void 0===(i=function(t,e,r){"use strict";function n(t){return new Promise(function(e){return setTimeout(e,t)})}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){var i=this;this.instructions={add:{format:r.InstructionFormat.R_FORMAT,run:function(t,e,r){return o(i,void 0,void 0,function(){var i,o,u;return s(this,function(s){switch(s.label){case 0:return i=this.mspi/3,o=this.getRegVal(e),[4,n(i)];case 1:return s.sent(),u=this.getRegVal(r),[4,n(i)];case 2:return s.sent(),this.setRegVal(t,o+u),[4,n(i)];case 3:return s.sent(),[2]}})})}},addi:{format:r.InstructionFormat.I_FORMAT,run:function(t,e,r){return o(i,void 0,void 0,function(){var i,o;return s(this,function(s){switch(s.label){case 0:return i=this.mspi/2,o=this.getRegVal(e),[4,n(i)];case 1:return s.sent(),this.setRegVal(t,o+r),[4,n(i)];case 2:return s.sent(),[2]}})})}},sub:{format:r.InstructionFormat.R_FORMAT,run:function(t,e,r){return o(i,void 0,void 0,function(){var i,o,u;return s(this,function(s){switch(s.label){case 0:return i=this.mspi/3,o=this.getRegVal(e),[4,n(i)];case 1:return s.sent(),u=this.getRegVal(r),[4,n(i)];case 2:return s.sent(),this.setRegVal(t,o-u),[4,n(i)];case 3:return s.sent(),[2]}})})}}},this.registerFile=t,this.mspi=e}return t.prototype.getRegVal=function(t){return this.registerFile.getRegister(t).get()},t.prototype.setRegVal=function(t,e){return this.registerFile.getRegister(t).set(e)},t.prototype.getInstruction=function(t){return this.instructions[t]},t}();e.InstructionSet=i}.apply(e,n))||(t.exports=i)},function(t,e,r){var n;void 0===(n=function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){this.registerMap=t,this.keyword=e}return t.prototype.getRegisterNum=function(t){var e=this.registerMap[t];if(void 0===e)throw new Error("No such register "+t);return e},t.prototype.parse=function(t){for(var e=[],r=0,n=t.split(/\n/);r<n.length;r++){var i=n[r];e.push(this.parseLine(i))}return e},t.prototype.parseLine=function(t){for(var e=[],r=0,n=t.split(" ");r<n.length;r++){var i=n[r];if(i=i.split(",")[0]){if(i.startsWith("#"))break;if(i.startsWith("$"))e.push(this.getRegisterNum(i));else{if(i.endsWith(":"))throw new Error("label not support now");if(i.includes("("))throw new Error("sw/lw not support now");this.keyword.includes(i)?e.push(i):e.push(parseInt(i,10))}}}return e},t}();e.Parser=r}.apply(e,[r,e]))||(t.exports=n)},function(t,e,r){var n,i;n=[r,e,r(4),r(3),r(1),r(6)],void 0===(i=function(t,e,r,n,i,o){"use strict";function s(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),s(r),s(n),s(i),s(o)}.apply(e,n))||(t.exports=i)}])});
//# sourceMappingURL=mips-core.js.map
{
"name": "mips-core",
"version": "0.1.4",
"version": "0.1.5",
"description": "MIPS Assembler Simulator Inspired by MARS",

@@ -5,0 +5,0 @@ "main": "build/mips-core.js",

@@ -10,3 +10,3 @@ {

"outDir": "build",
"module": "system",
"module": "amd",
"outFile": "build/mips-core.js",

@@ -13,0 +13,0 @@ "noImplicitAny": true,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc