At the top of different assembly source I see one of these.
I just want to know what the different is in using one or the other, and/or their advantages? Also, what's the "p" in .586p?
Posted on 2001-08-21 05:21:37 by vcv
the diffrence is that U inform your assembler which set of instructions u'll be using for example, pentium processor (.586) had some new instructions and some old that were optimezed by Intel and they take less tickcounts (they are litel bit faster) see Intel Hex Opcodes And Mnemonix help, U can download this from hutch's site http://www.hutch.ukshells.co.uk/download/opcodes2.zip

As the "p" it means that the procesor is in protrcted mode.
Posted on 2001-08-21 05:47:17 by NEMO
You will normally write programs to operate within the 32-bit Windows protected mode with a "flat" memory model, whereby all code, data and stack is in a single 32-bit segment and where all addresses are 32-bit relocatable offsets (relative addresses) with a range of up to 4GB. Addresses and pointers passed to system services are always 32-bit near addresses and pointers. This means (thankfully) that you are not interested in the old DOS segment:offset, segments or interrupts anymore - instead, you let Windows manage all address fixups, loading and running your program, and you work through the API (Applications Programming Interface) rather than using interupts.

To write a flat memory model program you include the assembler directive:

.model flat, stdcall

...at the start of your source file. This is an assembler directive, not a processor instruction, meaning that it tells the assembler (ML.EXE) how to assemble your source file - what memory model to assemble for. However, to use the flat memory model you must have at least a 80386 processor. But since the default processor under ML.EXE is the old 8086, you first have to issue another assembler directive telling ML.EXE that you have at least an 80386. This is the .386, .486 and .586 etc.

So, your source file must have, as it's first two lines:

.586 ; or use .386 or .486 as appropriate for your processor
.model flat, stdcall

The .286P, .386P, and .486P assembler directives enable the use of privilege level instructions as well as the normal instruction set for the given processor. You won?t need these unless you are writing your own operating-system or device drivers. So just stick with .586 etc.


Hope this helps
Posted on 2001-08-21 06:04:54 by Hamper
If I remember right you can also use
.586
.MMX

This enables MMX instruction.
Posted on 2001-08-21 06:53:53 by Test Department