MCPcopy Create free account
hub / github.com/aesthetic0001/js-virtualizer / getLoadOpcode

Method getLoadOpcode

src/utils/assembler.js:110–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 }
109
110 getLoadOpcode() {
111 let encoded
112 switch (this.type) {
113 case 'BYTE': {
114 encoded = this.value;
115 break;
116 }
117 case 'BOOL': {
118 encoded = this.value ? 1 : 0;
119 break;
120 }
121 case 'DWORD': {
122 encoded = encodeDWORD(this.value);
123 break;
124 }
125 case 'FLOAT': {
126 encoded = encodeFloat(this.value);
127 break;
128 }
129 case 'STRING': {
130 encoded = encodeString(this.value);
131 break;
132 }
133 }
134 return new Opcode(`LOAD_${this.type}`, this.register, encoded);
135 }
136}
137
138function encodeFloat(float) {

Callers 3

handleNodeMethod · 0.95
resolveTemplateLiteralFunction · 0.95
resolveExpressionFunction · 0.95

Calls 3

encodeDWORDFunction · 0.85
encodeFloatFunction · 0.85
encodeStringFunction · 0.85

Tested by

no test coverage detected