Re: assembly language and reverse engineering
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Fri, 07 Dec 2007 10:12:55 +0100
cr88192 wrote:
"Herbert Kleebauer" <klee@xxxxxxxxx> wrote in message
Why does this myth never die? Please explain what you can learn
in Windows assembly programming what you can't learn when doing
assembly programming in DOS (and we are not speaking about the
Windows API but about assembly programming).
the point is not what you can't learn, but what you have to learn in the
process.
And you have far less to learn to get your first working DOS program than
windows program. You can even use a hex editor, insert a single byte 0xc3
and save it as demo.com and you have made your first program.
dos would force you to learn more than windows or linux (for example, one
has to learn about segment registers, ...).
Why do you need something to know about segment registers when programming
in DOS. There is a flat binary executable format call com format. The only
restriction is the limit of 64 kbyte, but that's surely no problem for
"learning" assembly programming.
learning real mode programming, would take longer, and teach things that,
unless one is doing OS coding, are not terribly useful...
This is nothing but a myth, the opposite is true. Please show my any proof
of your claim.
Assembly programming
means to generate an instruction stream for the CPU and not for
the OS. And the CPU is the very same whether you use Windows, Linux
or DOS as an OS.
but, real mode is real mode, and pmode is pmode.
the way we use the CPU is different,
There is no difference in the add, mov, jmp and all the other user
mode instructions. The only difference is, that in real mode you
can use also instructions (including the ones which switch to
protected mode) which a non privileged user (which an assembly programming
beginner should be) isn't allowed to use.
and so is the mod/rm structure.
The mod/rm structure has nothing to do with DOS or Windows, it has also
nothing to with the CPU being in Real or Protected Mode. There are always
both forms (16 and 32 bit) available and it's completely up to the
programmer which one he chooses (but in 32 bit Protected Mode you better
don't choose the 16 bit addressing modes).
learning RM first could leave one thinking they can use only SI, DI, BX, or
BP in memory references...
Why? There are exactly the same addressing modes in Real as in Protected
Mode available.
or, at least until they come to understand things like:
mov eax, [ecx+edx*4]
Why do you think the above instruction is extracted from a 32 bit
Protected Mode program written for Windows and not from a source code
for a 16 bit Real Mode com program executed in DOS.
It's nothing but a CPU instruction which is neither specific to
Windows or DOS nor for Protected or Real Mode.
.
- Follow-Ups:
- Re: assembly language and reverse engineering
- From: cr88192
- Re: assembly language and reverse engineering
- References:
- assembly language and reverse engineering
- From: travisjg
- Re: assembly language and reverse engineering
- From: cr88192
- Re: assembly language and reverse engineering
- From: Herbert Kleebauer
- Re: assembly language and reverse engineering
- From: cr88192
- assembly language and reverse engineering
- Prev by Date: Re: unix to dos eol conv.
- Next by Date: Re: simple read char app return wrong value?
- Previous by thread: Re: assembly language and reverse engineering
- Next by thread: Re: assembly language and reverse engineering
- Index(es):
Relevant Pages
|