flat assembler
Message board for the users of flat assembler.

Index > Main > SMX instructions and their assembler syntax

Author
Thread Post new topic Reply to topic
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 17 Mar 2009, 10:33
Intel's SMX extensions instructions use weird mnemonics:
Quote:
GETSEC[CAPABILITIES]
GETSEC[ENTERACCS]
GETSEC[EXITAC]
GETSEC[SENTER]
GETSEC[SEXIT]
GETSEC[PARAMETERS]
GETSEC[SMCRTL]
GETSEC[WAKEUP]

I don't like having brackets as a part of the mnemonic. And something like "GETSEC[CAPABILITIES]" is too long.

How should we implement these in an assembler? Should we use only the part inside brackets?

BTW, is there any example of assembler code which uses these instructions?
Post 17 Mar 2009, 10:33
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 17 Mar 2009, 10:44
Quote:
How should we implement these in an assembler? Should we use only the part inside brackets?

when writing about these instructions, people usually use just "senter" etc. so yeah.

Quote:
BTW, is there any example of assembler code which uses these instructions?

BluePill2 source. But I am not sure whether s/he DB-ed opcodes or used assembler syntax.
Post 17 Mar 2009, 10:44
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista 17 Mar 2009, 11:26
vid wrote:
But I am not sure whether s/he ....
LOFL!!
Post 17 Mar 2009, 11:26
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 17 Mar 2009, 11:55
Couldn't find them in the sources.

Now I wonder what is Tomasz's prefered syntax Smile
Post 17 Mar 2009, 11:55
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 17 Mar 2009, 12:51
This instructions have the same opcode OF 37 ,
change only the EAX value( plus EBX ECX parameters) ,like CPUID
my favorite way is this:
Code:
xor  eax,eax       ; Get Capabilities
xor  ebx,ebx       ; Index 0
Getsec             ; 0F37

mov  eax,2                        ; ENTERACCS
mov  ebx,Physical_Address
mov  ecx,Code_Size
Getsec                               ; 0F37


; and so on    

I like number ,but i think that many people prefer mnemonic Rolling Eyes

_________________
Nil Volentibus Arduum Razz
Post 17 Mar 2009, 12:51
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 17 Mar 2009, 13:45
Did a woman design this syntax?

Image
Post 17 Mar 2009, 13:45
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 17 Mar 2009, 13:49
My bad, it's not in bluepill, I have mistaken what SMX is Embarassed
Post 17 Mar 2009, 13:49
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8360
Location: Kraków, Poland
Tomasz Grysztar 17 Mar 2009, 19:26
MazeGen wrote:
Now I wonder what is Tomasz's prefered syntax Smile
DJ Mauretto has already shown the syntax that fasm uses. Smile

And that weird syntax clearly calls for macro: Wink
Code:
macro getsec op
{
  match [=capabilities],op \{ xor eax,eax \}
  match [=enteraccs],op \{ mov eax,2 \}
  match [=exitac],op \{ mov eax,3 \}
  match [=senter],op \{ mov eax,4 \}
  match [=sexit],op \{ mov eax,5 \}
  match [=parameters],op \{ mov eax,6 \}
  match [=smcrtl],op \{ mov eax,7 \}
  match [=wakeup],op \{ mov eax,8 \}
  getsec
}

getsec[capabilities]    
Post 17 Mar 2009, 19:26
View user's profile Send private message Visit poster's website Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista 17 Mar 2009, 22:08
vid wrote:
My bad, it's not in bluepill, I have mistaken what SMX is

It's easy to mistake VMX for SMX (only 0x03 difference between the two) Smile
Post 17 Mar 2009, 22:08
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 18 Mar 2009, 07:44
Tomasz Grysztar wrote:
DJ Mauretto has already shown the syntax that fasm uses. Smile

Doh, didn't realized that fasm supports GETSEC already.

And looking into NASM manual, it supports only GETSEC as well.
Post 18 Mar 2009, 07:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.