flat assembler
Message board for the users of flat assembler.

Index > Main > instruction available or not

Author
Thread Post new topic Reply to topic
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 10 Dec 2007, 12:10
well fasm does not have any directive to specify the processor type.
and honestly i don't even know my processor type.
so how do i make sure that a particular instruction is available or not?

a nice idea would be that fasm would set some data/flag in my executable file
based on the instructions i have used. it will set a minimum processor needed.
and also link in some code at the start up routine that will check that flag/data to
see if the cpu on which my program is about to be run is the minimum needed
to run my code. it will check the pre stored flag/data and check the cpu for compatibility.

May Santa fulfill my wish this Dec 25 Smile

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 10 Dec 2007, 12:10
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 10 Dec 2007, 12:21
Something on this theme: Macros to choose target CPU Very Happy
Post 10 Dec 2007, 12:21
View user's profile Send private message Visit poster's website Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 10 Dec 2007, 12:26
thanks MHajduk!
I think while using these macros i will have to specify the required cpu type.
which will be based on the latest instruction i use, right? but the problem is i think it is
too much trouble to remember the instruction and where it is supported. would not
it be nice if fasm would guess the minimum cpu needed. and would add a code to
check for it as well.

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 10 Dec 2007, 12:26
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 10 Dec 2007, 12:31
You could use CPUID instruction for determinig CPU type (for Pentiums and higher, if I remember correctly) and simulation of this instruction for older processors CPUID (not really) 80286 | Tomasz's code. Very Happy
Post 10 Dec 2007, 12:31
View user's profile Send private message Visit poster's website Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 10 Dec 2007, 12:35
wow! that's a bit too much! Sad
similar to hand coding instructions instead of using fasm IMHO Smile

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 10 Dec 2007, 12:35
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 10 Dec 2007, 13:45
Quote:
would not
it be nice if fasm would guess the minimum cpu needed. and would add a code to
check for it as well.

no, it wouldn't.
- extra unwanted code
- if you want, you can add it yourself
- what to do if check fails? system-dependent code needed
- not every instruction is meant to be executed on current CPU
etc...
Post 10 Dec 2007, 13:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
mattst88



Joined: 12 May 2006
Posts: 260
Location: South Carolina
mattst88 11 Dec 2007, 23:03
0.1 wrote:
it be nice if fasm would guess the minimum cpu needed. and would add a code to check for it as well.


That would kind of go against the idea of it being the flat assembler.

_________________
My x86 Instruction Reference -- includes SSE, SSE2, SSE3, SSSE3, SSE4 instructions.
Assembly Programmer's Journal
Post 11 Dec 2007, 23:03
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 12 Dec 2007, 00:48
Just use ONLY8086.INC, and your code will run anywhere. Laughing
Post 12 Dec 2007, 00:48
View user's profile Send private message Visit poster's website Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 12 Dec 2007, 05:20
why my request violates the flat part
of the flatassembler? please explain.

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 12 Dec 2007, 05:20
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 12 Dec 2007, 11:06
It doesn't violate "flat" part (IMO), but it violates idea of flat assembler (and idea of any assembler...)
Post 12 Dec 2007, 11:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.