News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Question about the first directive

Started by Rever7eR, January 22, 2019, 07:33:39 AM

Previous topic - Next topic

Rever7eR

hello friends,

1st tutorial of iczelion series is interesting , "the basics" , everthing is clear for me and understood except one thing .
we all know that intel has so many processor models , and we have to tell the assembler which instuction set to use ! that's why we use the directive ".386" (someone correct me if am wrong)
i tried to build a simple hello world using assembly with ".386" directive , then i've built another one with the directive ".586" .
so i tried to figure out what is the differences between the two , and i didn't found anything except (TimeDateStamp) which is date of linking the software and (checksum) ... in the File Header and the Optional Header , also i know that ".586" doesn't disable any other models instruction set ...
the theoretical side is understood for me now ,i need just some example about the differences between these types (the practical side)
(80186 , 80286 , 80287) am not talking about them they are 16bit models , am talking about (80386 , 80387, 80486,80586, 80686)
i need to understand every single word i type in the IDE  :bgrin:
PS : am using RadASM IDE
thank you in advance for helping me , i became assembly addicted including this forum  8)

felipe

well i can tell you something really practical: you can use all those directives (80386 and above) to assemble 32 bit code. Now, something practical too (from the standpoint of being brief and not taking in account hardware details): all those directives are for very similar processors, very compatible.  :idea:

Lastly, if you want to know the differences of this processors in more detail, you will need to read old intel manuals... :idea:

felipe

Here its a practical example for you too  :idea::


.386
.model  flat,stdcall
option  casemap:none

.code
start:
        cpuid

        end   start

Quoteerror A2085: instruction or register not accepted in current CPU mode


.486
.model  flat,stdcall
option  casemap:none

.code
start:
        cpuid

        end   start

Quoteerror A2085: instruction or register not accepted in current CPU mode


.586
.model  flat,stdcall
option  casemap:none

.code
start:
        cpuid

        end   start


:bgrin: i'm a little short of words today, but you can do your questions here safely  :icon14:

hutch--

Unless you are using very old hardware, PIII and earlier you can bypass the restricted instruction usage by using the highest option available.

.686p
.mmx
.xmm

Abdel Hamid

Quote from: felipe on January 22, 2019, 11:26:19 AM
:bgrin: i'm a little short of words today, but you can do your questions here safely  :icon14:

thank you so much , that's what i was looking for + i'll try to read old intel manuals as you mentioned .
don't worry as the saying goes , Good brevity makes sense  :t 
once again thank you for you time  :biggrin:

Abdel Hamid

Quote from: hutch-- on January 22, 2019, 11:50:02 AM
Unless you are using very old hardware, PIII and earlier you can bypass the restricted instruction usage by using the highest option available.

.686p
.mmx
.xmm

Mr Hutch , thank you so so much for your cooperation
i have read about MMX and XMM , to be honest , i don't know the job of each one of them but i know the following
mmx is rarely used nowadays
MMX is a ( single instruction , multiple data ) according to wikipedia
XMM are registers !
am not a native speaker so it's hard for me to understand each line written there ,
i'll be glad if you want to provide me some informations about them

Regards
AH

hutch--

Simple,

My suggestion enables everything. Without them you are restriction your code to older instructions.

Abdel Hamid

understood , that's a new information for me
i will always use this in my future sofware
i don't want to restrict my code of course  :bgrin:
once again , thank you  :t