Giter VIP home page Giter VIP logo

Comments (4)

hlorenzi avatar hlorenzi commented on May 14, 2024

This would be incredibly cool, indeed! But with instructions being as free-form as they are now, I imagine it wouldn't be possible to do a reverse mapping so easily in general... Maybe only for a subset of instructions with simple representations?

About the parameter type specifications, please see here while I haven't got the proper documentation done!

from customasm.

ProxyPlayerHD avatar ProxyPlayerHD commented on May 14, 2024

i think the most difficult part would be dealing with Tokens. as they are the only things that effect the actual instruction mnemonic.
and maybe this could be done with an intermediate step that takes the CPU file and gets rid of all tokens before it disassembles a file?

so basically a de-tokenizer.
for example, this could be in the input CPU file:

#tokendef FLAGS
    {
        Z	= 0
        C	= 1
        N	= 2
    }

JR {fl:FLAGS} {src}		-> 0xE[3:0] @ fl[3:0] @ (src - pc)[15:0]

and it would take that and tear it apart into it's seperate possibilites:

JR Z {src}			-> 0xE0[7:0] @ (src - pc)[15:0]
JR C {src}			-> 0xE1[7:0] @ (src - pc)[15:0]
JR N {src}			-> 0xE2[7:0] @ (src - pc)[15:0]

which should make mapping a lot easier. (i assume)
values shouldn't be as difficult since you're taking a number from the binary file and display it... as a number, likely in HEX.

another thing that i would see as difficult would be labels, since the assembler itself has no idea what each instruction does it would be impossible to figure out where to put labels...

unless the CPU file would somehow allow you to specify what instructions are conditional branches, subroutine calls, and returns. since those 3 are the only ones required to implement such an automatic labeling system.

anyways, it seems like a fun "little" challange to reverse this assembler somehow,

from customasm.

virtimus avatar virtimus commented on May 14, 2024

Both issues closed ? Nobody working on this ? I 'm considering to implement this as a part of my custom cpu project ...
Somebody interested ? (by the way - brilliant project :_)

from customasm.

hlorenzi avatar hlorenzi commented on May 14, 2024

No, this issue isn't closed yet. It's just kind of a difficult-to-implement feature, so not really a priority. 😅

from customasm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.