GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ZhongRuoyu/opcoder: A utility for converting LEGv8 mnemonics into instructions in hexadecimal format.

This repository was archived by the owner on May 2, 2022. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.html
index.html
 
 
opcoder.js
opcoder.js
 
 
package.json
package.json
 
 

Repository files navigation

Opcoder

Opcoder is a utility for converting LEGv8 mnemonics into instructions in hexadecimal format which supports basic syntax error detection. It is modified from Dr K. G. Smitha's OPCoder.

Usage

To use it in your JavaScript scripts, see the example below:

import { convertLines } from "./opcoder.js";

const input = `ADD X5, X5, X6 // ADD
LDUR X5, [X2, #0] // LDUR
CBZ X7, #3 // CBZ
B #4 // B
STUR X5, [X2, #2] // STUR`;

console.log(convertLines(input));

To embed this in an HTML page, do this:

<script type="module">
    import { convert } from "./opcoder.js";

    function convertLines(lines) {
        return lines
            .split("\n")
            .map(line => (line.trim().length !== 0)
                ? `${convert(line).toUpperCase()} // ${line}`
                : line);
    }

    document.getElementById("input").addEventListener("input", e => {
        const lines = document.getElementById("input").value;
        document.getElementById("result").value = convertLines(lines).join("\n");
    });
</script>

A working example is available here.

License

Copyright (c) 2022 Zhong Ruoyu. Licensed under the MIT License.

About

A utility for converting LEGv8 mnemonics into instructions in hexadecimal format.

zhongruoyu.github.io/opcoder/

Topics

javascriptlegv8opcodes

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.