Re: Two Click disassembly/reassembly



Betov wrote:
> Frank Kotler <fbkotler@xxxxxxxxxxx> écrivait
> news:MMudnQUH6__prEneRVn-gg@xxxxxxxxxxx:
>
> > Assembly is generally considered not portable - and we *can't* do
> > non-x86...
>
> Wrong. There is nothing making it impossible, for an
> Assembler, to have as many Encoders inside as you want,
> and to _translate_ the x86 OpCodes, into replacements
> (when not equivalent) substitutes.

That would, IMHO, be the wrong way. x86 is a very complex processor
with a CISC face. Many other processors like SPARC, M68000 don't have
many of the features that x86 has. So translating x86 opcodes would be,
I assume, most confusing and error prone, both for the assembler and
for the user, if at all it is fully possible.

The better way is to have a set of front and back ends, each for a CPU
family. In that way, each front and back end would accept and parse the
native assembly syntax of it's target CPU and generate it's opcodes.
The appropriate front and back ends can be automatically called by the
driver program, either via a command-line switch or a 'syntax' or 'cpu
type' directive at the beginning of the source file.

Of course, practically speaking, this is equivalent to writing several
assemblers, each for a CPU family. When coding even _one_ assembler
properly is so much work, who would be vain enough/competent enough to
undertake this project?

Better use GNU as (GAS). It is exactly designed for this purpose, if
you can live with a twisted syntax.

:)

.



Relevant Pages

  • The never ending assembly vs. HLL war
    ... > branch instruction excluded is not particularly effective optimization. ... > CPU, chances are pretty good it *won't* be optimal on a different CPU. ... > discussing the futility of optimizing it in *assembler* when the ... careful and consider the code the compiler is emitting (and adjust your ...
    (comp.lang.asm.x86)
  • Re: Can this loop be made faster ?
    ... > rather fast a HLL-like language might suit better than macros... ... are all different internally - the "shader assembly language" that DirectX ... they can have their own assembler and compilers and graphics-specific HLLs ... CPU" in the hardware... ...
    (alt.lang.asm)
  • Re: Is PSHUFW instruction MMX or SSE or SSE2? Is NASM manual correct?
    ... The CPU is a dead thing, ... remember all the most in used instructions. ... Scripting is not related to coding. ... Sure, if Windows or Word would be coded in assembler, it would be extremely ...
    (alt.lang.asm)
  • Re: assembly language and reverse engineering
    ... registers when you use a CPU mode with 16 bit default size. ... there is no other difference to 32 bit Windows programming? ... mass of hand-written assembler doing who-knows-what, ... trap #$80 ...
    (alt.lang.asm)
  • Re: Two Click disassembly/reassembly
    ... > The better way is to have a set of front and back ends, each for a CPU ... You are in some way right, but you are confusing Assembler ... writing an Encoder is a matter of Months. ... nothing but what the HLL do. ...
    (alt.lang.asm)