Skip to content

Commit

Permalink
Merge pull request #14 from yaacov/fetch-opcodes-from-src-in-webui
Browse files Browse the repository at this point in the history
Fetch opcode from compiler code in web ui
  • Loading branch information
yaacov authored Oct 2, 2023
2 parents 6f15c02 + 729762d commit 29caab5
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions public/js/components/op-codes-table.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable guard-for-in */
/* eslint-disable import/no-unresolved */
/* eslint-disable no-restricted-syntax */
import { html } from '../html.js';
import opcodes from '../src/opcodes.mjs';

class OpCodesTable extends HTMLElement {
constructor() {
Expand Down Expand Up @@ -35,30 +37,6 @@ class OpCodesTable extends HTMLElement {

connectedCallback() {
const table = this.shadowRoot.querySelector('table');
const opcodes = {
LOADA: 0x00,
LOADB: 0x01,
STOREA: 0x02,
STOREB: 0x03,
ORA: 0x04,
ORB: 0x05,
ANDA: 0x06,
ANDB: 0x07,
XORA: 0x08,
XORB: 0x09,
NOTA: 0x0A,
NOTB: 0x0B,
SHLA: 0x0C,
SHLB: 0x0D,
SHRA: 0x0E,
SHRB: 0x0F,
JUMP: 0x10,
JZA: 0x11,
JZB: 0x12,
ADDA: 0x13,
ADDB: 0x14,
END: 0xFF,
};

for (let opcode in opcodes) {
const row = document.createElement('tr');
Expand Down

0 comments on commit 29caab5

Please sign in to comment.