Discussion:
PureBasic / PowerBASIC / FreeBasic Inline ASM comparison
(too old to reply)
Optimus Prime
2008-02-13 12:44:16 UTC
Permalink
For a viable alternative you might consider PureBasic. It's my
language of choice for right now. Small and really tight executables, Linux
and MAC versions, GUI designer, console progs and DLLs. Inline ASM, and a
library compiler rounds out the offerings. It really is a lot of
development tool for the money. The PureBasic commmunity is very
knowlegeable and very helpful, and AFAIK no one has been axed from the
forums. PureBasic has been around since 1998 and has a strong following.
Nothing is forever but it looks to remain for a while. Please don't
misunderstand, I'm not dissing PowerBASIC or the products thereof, the
reputation of these products speaks for itself, I am however advocating
PureBasic as a worthy alternative.
Does the PureBsic inline ASM support extended instructions such
as SSE3 and AMD64 / EM64T? How about PoweBasic? FreeBasic?
--
<html><head></head><body>
<center><table
cellpadding = "20"
border = "20" width = "50%">
<tr><td bgcolor = "#FF00FF"><table
cellpadding = "20"> <tr> <td bgcolor =
"#000000"> <font color = "#FFFFFF"> <font
size = "6"><font color = "#FFFF00" >
WHAT? </font> </font> <p> Are
<b>you</b><i> saying </i>
that <b>you </b> have <i>
something </i><font size
= "+1" > <font color =
"#ffff99"> <b> against </b>
</font><font size "+1" > <font
color = "#FF3333">H</font><font
color = "#99FF99">T </font><font
color = "#9999FF">M </font><font
color = "#FFFF99">L </font><b>
??? </b> </font></font> <p><blink>
<font aaa aaa color="#FF3333">Whatever for? </font >
</blink> <p> It is<i> such</i>a <font color = "#FF00FF" >
<blink aaa aaa aa> nice</b></blink> <i>language
</i> and <aa aaa aa> gives you such <a> <font color
=#00FFFF aaa aaa aa> fantastic</font aa> <font color
=#FF00FF aaa aaa aa> creative <blink aa> freedom
</blink> </font><b>! </b><p> <font aaa aaa color =
#FF55FF> <font size ="6">So what <aa aa> </font >
</font> If not <i><b><font aaa aaa color =
#999999 aaa aa> everybody <aa aaa aa> </font >
</b> </i> can <a> read it?<p> If <aa aa> those <b>
<i>losers <a> </i> </b> are too <i> <a> <font color
=CCCC00> <a> mean </font> <aa aa> </i>to<i> buy </i>
some<blink a> <a><b> <font aaa aaa color = "00FFFF">
decent </font></b> </blink><i>
equipment </i> then that is
<b><font color = "#9999FF">
their </font> </b> <i> problem,
</i>not <blink>mine! </blink><p>
They can always <b> <font
color = FF3333 >save</font>
</b>the<font size= "+1">
<blink> <i> source code
</i></blink> </font> to a
<b>file</b> and <i>open</i> it
in <i> <b> <font color = "00ff00">
Netscape!</font></b></i><b><font color =
"#ffff99">That </font></b> isn't so<i>
<font color = "#ff3333">difficult!
</font></i></td></tr></table>
</td> </tr></table>
</body></html>
H-Man
2008-02-13 21:36:22 UTC
Permalink
Post by Optimus Prime
For a viable alternative you might consider PureBasic. It's my
language of choice for right now. Small and really tight executables, Linux
and MAC versions, GUI designer, console progs and DLLs. Inline ASM, and a
library compiler rounds out the offerings. It really is a lot of
development tool for the money. The PureBasic commmunity is very
knowlegeable and very helpful, and AFAIK no one has been axed from the
forums. PureBasic has been around since 1998 and has a strong following.
Nothing is forever but it looks to remain for a while. Please don't
misunderstand, I'm not dissing PowerBASIC or the products thereof, the
reputation of these products speaks for itself, I am however advocating
PureBasic as a worthy alternative.
Does the PureBsic inline ASM support extended instructions such
as SSE3 and AMD64 / EM64T? How about PoweBasic? FreeBasic?
****************************
From the PureBasic docs:
PureBasic allows you to include any x86 assembler commands (including MMX
and FPU one) directly in the source code, as if it was a real assembler.
And it gives you even more: you can use directly any variables or pointers
in the assembler keywords, you can put any ASM commands on the same line,
... The syntax is the FAsm (http://flatassembler.net) one, so if you want
more informations about the ASM syntax, just read the FAsm guide.

There are serveral ways to activate the inline assembler:
- check the "inline assembler" compiler option via the IDE
- use the /INLINEASM command line compiler switch
- use the compiler directives EnableASM and DisableASM
****************************

It does support anything FAsm supports although I'm not sure how much good
it'll do you to include x86-64 instructions in a 32bit program. That is for
people way smarter than I am. I mostly cut and paste ASM when I need an
optimized routine for speed.
--
HK
unknown
2008-02-14 14:48:21 UTC
Permalink
Post by H-Man
For a viable alternative you might consider PureBasic. It's my
language of choice for right now. Small and really tight executables,
Linux and MAC versions, GUI designer, console progs and DLLs. Inline
ASM, and a >>>library compiler rounds out the offerings. It really is
a lot of >>>development tool for the money. The PureBasic community
is very knowledgeable and very helpful, and AFAIK no one has been
axed from the forums. PureBasic has been around since 1998 and has
a strong following. Nothing is forever but it looks to remain for
a while. Please don't misunderstand, I'm not dissing PowerBASIC or
the products thereof, the reputation of these products speaks for
itself, I am however advocating PureBasic as a worthy alternative.
Does the PureBasic inline ASM support extended instructions such
as SSE3 and AMD64 / EM64T?
PureBasic allows you to include any x86 assembler commands (including MMX
and FPU one) directly in the source code, as if it was a real assembler.
And it gives you even more: you can use directly any variables or pointers
in the assembler keywords, you can put any ASM commands on the same line,
... The syntax is the FAsm (http://flatassembler.net) one, so if you want
more informations about the ASM syntax, just read the FAsm guide.
- check the "inline assembler" compiler option via the IDE
- use the /INLINEASM command line compiler switch
- use the compiler directives EnableASM and DisableASM
It does support anything FAsm supports although I'm not sure how much good
it'll do you to include x86-64 instructions in a 32bit program. That is for
people way smarter than I am. I mostly cut and paste ASM when I need an
optimized routine for speed.
The Flat Assembler docs explain how to work with the
various extended instructions:

From [ http://flatassembler.net/docs.php?article=manual ]:

Chapter 2 - Instruction Set
2.1 The x86 architecture instructions
2.1.1 Data movement instructions
2.1.2 Type conversion instructions
2.1.3 Binary arithmetic instructions
2.1.4 Decimal arithmetic instructions
2.1.5 Logical instructions
2.1.6 Control transfer instructions
2.1.7 I/O instructions
2.1.8 Strings operations
2.1.9 Flag control instructions
2.1.10 Conditional operations
2.1.11 Miscellaneous instructions
2.1.12 System instructions
2.1.13 FPU instructions
2.1.14 MMX instructions
2.1.15 SSE instructions
2.1.16 SSE2 instructions
2.1.17 SSE3 instructions
2.1.18 AMD 3DNow! instructions
2.1.19 The x86-64 long mode instructions

I looked the above over, and it looks like it will do everything
you are looking for. An additional advantage is that you can
easily go from inline assembly to 100% assembly language without
having to re-learn everything.

I also noted that PureBasic has a console mode, which is an
important feature for the kinds of things I do, such as writing
a program that controls an automated assembly line with the only
user interface being a simple status screen.

There are some PureBasic limitations that may bother some folks;
http://www.purebasic.com/documentation/reference/variables.html
says that PureBasic supports the following data types:

Byte | 8 bit signed fixed | -128 to +127
Character | 8 bit | 65,535 different characters
Unicode Char. | 16 bit | 255 different characters
Word | 16 bit signed fixed | -32,768 to +32,767
Long | 32 bit signed fixed | -2,147,483,648 to +2,147,483,647
Quad | 64 bit signed fixed | -9.22x10^18 to +9.22x10^18
Float | 32 bit IEEE 754 float | 8.43x10^-37 to 3.40x10^38
Double | 64 bit IEEE 754 float | 4.19x10^-307 to 1.79x10^308
String |
Fixed String |

Unless the above URL is wrong, notably lacking are:

8 bit unsigned fixed | 0 to 255
16 bit unsigned fixed | 0 to 65,535
32 bit unsigned fixed | 0 to 4,294,967,295
80 bit IEEE 754 float | 3.4x10^-4932 to 1.2x10^4932
Currency | -9.22x10^14 to +9.22x10^14
Extended-currency | -9.22x10^16 to +9.22x10^16

All of which are available in PowerBASIC, along with more
exotic data types such as Variants and GIUDs.


PowerBASIC, on the other hand, is far more limited in what
you can do with inline assembly. As documented in
http://www.powerbasic.com/support/help/pbcc/asm_statement.htm
"PowerBASIC's Inline Assembler supports 8086/8088, 80286, 80386,
80486, Pentium, Floating-Point and MMX instructions." I don't
see any support for SSE of any kind.


FreeBASIC uses GAS/AS (the GCC assembler).

The newest version of the AS/GAS manual I could find (2002) says:

8.12.9 Intel's MMX and AMD's 3DNow! SIMD Operations
as' supports Intel's MMX instruction set (SIMD instructions
for integer data), available on Intel's Pentium MMX processors
and Pentium II processors, AMD's K6 and K6-2 processors, Cyrix'
M2 processor, and probably others. It also supports AMD's 3DNow!
instruction set (SIMD instructions for 32-bit floating point data)
available on AMD's K6-2 processor and possibly others in the
future. Currently, `as' does not support Intel's floating point
SIMD, Katmai (KNI). [Later renamed SSE].

So no SSE/SSE2/SSE3 for FreeBASIC users... :(

One really interesting feature of FreeBASIC is that it is written
in FreeBASIC. This means that a BASIC programmer can extend the
language. fix bugs, and in general participate in the Open Source
development process without having to use C.

My wish list includes a BASIC compiler that lets me enter x86
System Management Mode using inline assembly. <grin>






--
Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/>
Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/>
Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/>
Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/>
H-Man
2008-02-13 21:47:51 UTC
Permalink
Post by Optimus Prime
For a viable alternative you might consider PureBasic. It's my
language of choice for right now. Small and really tight executables, Linux
and MAC versions, GUI designer, console progs and DLLs. Inline ASM, and a
library compiler rounds out the offerings. It really is a lot of
development tool for the money. The PureBasic commmunity is very
knowlegeable and very helpful, and AFAIK no one has been axed from the
forums. PureBasic has been around since 1998 and has a strong following.
Nothing is forever but it looks to remain for a while. Please don't
misunderstand, I'm not dissing PowerBASIC or the products thereof, the
reputation of these products speaks for itself, I am however advocating
PureBasic as a worthy alternative.
Does the PureBsic inline ASM support extended instructions such
as SSE3 and AMD64 / EM64T? How about PoweBasic? FreeBasic?
AFAIK FreeBasic uses GAS as it's assembler. I could not find anything
concrete regarding actual x86 extensions I'd bet it'll support pretty much
everything as well.
--
HK
Loading...