Comments (4)
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.
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.
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.
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)
- VSCode Syntax highlighting not working. HOT 2
- Add option for addressing units when outputting intelhex? HOT 1
- Error with misaligned string ends. HOT 5
- `#struct` Directive HOT 2
- Way to Include Raw Binary File HOT 1
- EBNF for customasm syntax HOT 4
- Feature Request: Compile for MacOS in release section. HOT 2
- Relative Jumps? HOT 2
- Are there any stability guarantees if I use customasm as a library? HOT 3
- Stack overflow / Index out of bounds with recursive rules
- v0.11 syntax error using a'b instead of b`a syntax for a constant with a specified width HOT 2
- Feature: adding space separated format
- Internal Overhaul
- "Unknown variable" when forwarding primitive arguments HOT 3
- no-color option HOT 2
- no match for instruction found HOT 2
- Feature Request: Different number base options for annotated text output. HOT 3
- Calculate `.len` of labels automatically
- Cannot reference variables in #bankdef HOT 2
- Asserts in subruledefs are ignored when calling asm{...} HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customasm.