Re: assembly language and reverse engineering



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.
.



Relevant Pages

  • Re: Iczelions tutorials revisited.
    ... I said that I don't call it assembly "programming" ... Please show us for example the Win32 source code ... a 16 bit DOS solution. ... instruction set of the CPU (= learning assembly programming), ...
    (alt.lang.asm)
  • Re: [SLE] Developing a Real Time Data System
    ... The KBasic License is valid for both operating systems: Windows and Linux. ... Modern BASIC language ... chapters learning about the programming language. ...
    (SuSE)
  • Re: Confusing stack effects
    ... And DOS ... is the best way to start assembly programming. ... To learn todo 16-bit dos programming, for programming in windows later is the worst kind of advice. ... Learning to program for a Click&Go GUI is a tedious incredible complex job, compared to doing a dos app, where all you need to do is set up a loop, to take input that in all cases _you_ made the rules for. ...
    (alt.lang.asm)
  • Re: checking processes
    ... Can any one kindly guide me a working sample that can do it using dos ... programming. ... The program is written to run under Windows XP. ... Since there does not appear to be an MS-sponsored batch newsgroup, ...
    (microsoft.public.scripting.wsh)
  • Re: Reverse engineering != piracy (was Re: RosAsm disassembler output vs. IDA Pro)
    ... OOPL or fancy "class" keywords to be programming "OOP"...that stuff is ... Rene...one of your RosAsm newbies has just ... under the BASIC language, typing "?" ... surface that works within Windows...but then all "child" windows can ...
    (alt.lang.asm)