Re: from elsewhere, an assembler




Hello "cr88192",

[..]
How if you help it with formatting ?
ie: have comments at a defined TAB-stop and
use an ALT-";"-Key to tell it's a comment.

errm, I have no intent at this point for any kind of specialized editor.

I see, for plain text-source import this isn't usable,
so your decision for the alternative "|" is just fine.

[...about editor]
But if you think into future, you might once add an integrated
debugger and/or other diplaying help-tools, hotkeys, memus or whatsoever...
Then you'll need your very own GUI displays and controls anyway.

Be aware of cursing yourself for your first decisions later in
the game (talking from own experience yet) when you have to break
your nails just to merge in additional functionality.

So my advice here is:
have your final target in mind from the very start.


How many bytes are one "kloc" ?

Often things gotta change on users demand ... :)

note, I still intend this primarily for backend/autogenerated code,
reasoning mostly that assembler now exists in a state of great decline
anymore, ie, where everyone and their dog knows Java, many know C,
and only some know assembler...

You write an assembler? don't expect Java speaking dogs to use it :)

I hope you try to write an assembler!

I write it as I write it, with whatever seems to IMO make sense.
an assembler exists as an assembler, since it is the lowest reasonable
level for code generation (one moves up to the level of bytecode,
and is limited to whatever the JIT implements, and one moves lower
than assembler, well then they have an ugly mess...).

Yes, I know.
My short-fast-smart code isn't 'beautiful' in the eyes of HL-coders.

[...]
Yes, the CPU instructions are different for MOVZXb and MOVZXw/d/q
So it sounds logical to add these optional to the syntax.

yeah.
dunno what others have done here, I just noticed that, "oh crap",
the only distinction was a difference in the size of the right-hand
memory operand. my assembler can't handle this one, so I split it off...

I found two redundant (NOP) forms:
..use32
66 0f b7 .. MOVZXw ax,..
..use16
0f b7 .. MOVZXw ax,..


actually, as it is my assembler also can't handle 3-arg opcodes either (so
they have been generally ommitted).

??? I couldn't renounce of:

IMUL r,rm,imm
SHLD r,rm,imm
and all other 'dest,src,imm' instructions.

I have at times considered partly rewriting this part of my assembler
(both the listing-translation tool and the opcode matching),
so that each argument is fully qualified (size and type),
vs as it is where they are only partly qualified (a single 'size' field
is used for the whole opcode).
in this case, the current size field or similar would probably be reused
as an argument (allowing some 3-oprand forms and funky combinations of
fixed regs and sizes, as found in some opcodes).

I split the whole opcode list into 'one/two/three/block' operator parts
(the inherent CL on shift-double is also a third) and then grouped
it a second time into function-blocks
[ie: |add|..|xor|cmp|-group: 00..05,...,38..3d,80,81,83
|test|neg|not|inc|dec|...|: F6,F7,FE,FF
and so on]

This helps for detailed (value tracking) disassembling and for
immediate verbose comment/help as well.


btw:(64-bit mode)
[ZeroPage Addressing,...]
I am not sure, I am not familiar with this one...

Is just a detail on how many 64-bit instruction work.

[about libs...]

linking would still be needed in producing the lib.

Yes, if the libs contain OS-specific API calls.
My (lib)modules are just OS-extenders which add functions to it
without using other API functions.
But right, in the windoze world this may not work at all.

[about hash]

Can't tell anything as I work the other way around :)
(I type my code on an editable disassembler)

[about '67']

mixed 16/32 bit code should work, at least in theory (beat against this
recently, but I am unsure as to whether or not I will ever have much
reason to use this).

The reason can be 'boot-code' and 'BIOS-calls'.


past this, I am much less certain (mixing 64-bit long-mode code with 16 or
32 bit code, could be horrible, dunno what the hell the CPU does here).

As an Author of an assembler you don't need to care :)
this will be the (final user) programmers headache only.


or course, it is always possible to simply tell the assembler to use
a different size:

section .text
bits 32 (or .a32)

Don't mixup '.a32'(address override) with 'bits 32'

I'd keep it alive, just in case...
yeah. this prefix was borrowed from nasm anyways.

Ok, even the 67 came with 386 :)

__
wolfgang

I uploaded a new (not topmost) variant of HEXTUTOR

http://web.utanet.at/schw1285/KESYS/HEXTUTOR.zip



.



Relevant Pages

  • Dont be overawed by a C compiler.
    ... This is a classic x86 assembler newsgroup where assembler issues are ... a C compiler can do it better. ... measurably faster on current Intel and AMD hardware, there is no reason ... and while a lot of it is junk, a reasonable amount of the code ...
    (comp.lang.asm.x86)
  • Re: from elsewhere, an assembler
    ... compilation. ... reasoning mostly that assembler now exists in a state of great decline ... otherwise, from my POV, there is not much reason to use ... is used for the whole opcode). ...
    (alt.lang.asm)
  • Re: newbie about winAPI
    ... | Code quality is a silly reason to not learn a language. ... | programming using assembler, if for no other reason than *none* of the ... So I see the difference just in the used syntax and the compilers. ... warte nun auf der Muse Kuss, ...
    (comp.lang.asm.x86)
  • Re: Evolution
    ... That's a good reason. ... > and not the same HL constructs in your assembler program. ... structs in assembly language, either. ... > Now show me were OllyDbg uses the processor debug registers ...
    (alt.lang.asm)
  • The "New Lesson" to be learnt (was: LuxAsm 00.01.00)
    ... Randy wrote: ... >> What sense does it make to write an assembler in assembly language ... ones people would actually use...there's good reason if there is to be ... Finally, of course, with something like RosAsm (and, possibly, ...
    (alt.lang.asm)