A
A
Andrey Andryushchenko2017-04-23 18:59:43
Java
Andrey Andryushchenko, 2017-04-23 18:59:43

How to execute an assembler command in Java or C++?

The function is passed a string containing a string with an assembler command (for example, "add r0, r1"), you must execute it. How can I do that? Is there any library to perform assembler inserts from a string? Is there no, how best to do it yourself? Or just a switch with a bunch of cases:

switch(asmComStr){
case "mov":
//mov 
break;
case "add":
//add
break;
}
? And also with parameters.
PS It doesn't matter if it's Java or C++, since the project is written in Java, but you can use the NDK to call methods from C++

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2017-04-23
@15432

This is what you need to write an assembler interpreter. And yes, it essentially consists of a bunch of cases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question