News:

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

Main Menu

Subforum for Free Basic

Started by Vortex, January 14, 2020, 06:56:27 AM

Previous topic - Next topic

Vortex

Hello,

Could we consider a subforum for Free Basic? What are the opinions of the forum members?

jj2007

I've been following the FB forum for some time. The interest for assembly is limited, also because of their claim to cover Windows & Linux in 32- and 64-bit land. FB relies heavily on C++ compilers, and you can feel that. IMHO the language is drifting away from BASIC towards some variant of C++.

What would you expect from a FB subforum? Btw does anybody know what happened to MichaelW? He used to be very active at the FB forum.

Vortex

#2
Hi Jochen,

Sadly, no news from MichaelW since long time. I know, he was very active in the Free Basic ( FB ) forums.

As you said, the interest to assembly in the FB community is limited. The preprocessor of FB accepts the Gas macros, that looks interesting. I agree with you that FB is inclined now towards C++

Free Basic can use Masm and \ or Gas modules. Without those C++ features, FB is easy to learn and use. The language can be powered by assembly.

Another idea could be to combine Power Basic, Free Basic plus some other basic dialects like Rapid-Q Basic and Oxygen Basic under a subforum.

jj2007

Since at least October 2010, MasmBasic ships with an interface to VBA - you can add that to the list :bgrin:

daydreamer

Quote from: Vortex on January 14, 2020, 08:02:29 AM
Another idea could be to combine Power Basic, Free Basic plus some other basic dialects like Rapid-Q Basic and Oxygen Basic under a subforum.
That sounds like a good idea
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jcfuller

#5
I found this topic relevant for the MASM Forum
https://www.freebasic.net/forum/viewtopic.php?f=8&t=27478

Another focus might be a port of José Roca's FreeBasic  Framework  to MasmBasic + ObjAsm?

James

hutch--

The reason why there is a PowerBASIC subforum in this forum is mainly due to me using it as a location to post code for PB folks that is free from the DDT wrapper brigade at the PowerBASIC forum. I keep it well out of the way so it does not detract from the primary task of this forum which is MASM and some other related assemblers.

We can tolerate some C/C++ code as MASM and most other x86 assemblers interface with C/C++ directly and can be considered part of the tool chain. As various dialects of BASIC have their own forums, I don't see what advantage it would be for a dedicated assembler forum to cater for a mix of BASIC dialects, especially as at least some of them have very different licencing assumptions behind them.

aw27

Quote
FBIde - Classic IDE for FreeBASIC written in C++ using WxWidgets. (Windows)
Not a good advertising. :skrewy:

avcaballero

Quote from: Vortex on January 14, 2020, 08:02:29 AM
Another idea could be to combine Power Basic, Free Basic plus some other basic dialects like Rapid-Q Basic and Oxygen Basic under a subforum.
That would be nice, I'm a fan of basic  :thumbsup:

jj2007

Quote from: jcfuller on January 14, 2020, 09:13:14 AM
I found this topic relevant for the MASM Forum
https://www.freebasic.net/forum/viewtopic.php?f=8&t=27478

That thread looks familiar :mrgreen:

Re: Gas64 (no more use of gcc, only gas) :-)
Quote
QuoteSARG wrote:
I guess I'm not clear enough or maybe you should read more carefully.... :-)
[rant]Maybe it's not your fault, no idea. Every single FB "package" has its own quirks, needs specific settings, environment variables (set PATH? set INCLUDE?). Most of my FB stuff works now, but every time I see some interesting non-standard stuff, it needs a trial and error session to find out where exactly gccwhatever.exe has to sit, and where it might find its includes. I have never ever experienced a programming language that had so messy setup requirements. Even the Masm32 setup (note: utterly complicated ASSEMBLER, not Beginner's All-purpose Symbolic Instruction Code) is orders of magnitude simpler.[/rant]

SARG does interesting stuff, but FB really suffers from general confusion, and the fact that the FB "compiler" is more or less a frontend for some C++ backend. My impression is that two thirds of the FB forum threads deal with "how do I have to setup my includes, and which C++ compiler is the best to run my hello world proggie?"

daydreamer

Quote from: hutch-- on January 14, 2020, 10:43:54 AM
The reason why there is a PowerBASIC subforum in this forum is mainly due to me using it as a location to post code for PB folks that is free from the DDT wrapper brigade at the PowerBASIC forum. I keep it well out of the way so it does not detract from the primary task of this forum which is MASM and some other related assemblers.

We can tolerate some C/C++ code as MASM and most other x86 assemblers interface with C/C++ directly and can be considered part of the tool chain. As various dialects of BASIC have their own forums, I don't see what advantage it would be for a dedicated assembler forum to cater for a mix of BASIC dialects, especially as at least some of them have very different licencing assumptions behind them.
but as you tolerate little TinyC code,couldnt you tolerate little other BASIC dialect,its easy to work without annoying GDI memory leaks or too much GDI or need to d3d more complex vertices drawing when experimenting
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Vortex

Hi Jochen,

The 32-bit version of Free Basic depends on as.exe to compile source code. It's the 64-bit version using gcc.exe. The default setup of Free Basic is easy and it does not pose problems. Let's see how Sarg's work will continue, he's doing a nice job.


Vortex

Here is a quick Free Basic example built without the run-time library. Without objdump removing the unnecessary sections from the object module, the size of the compiled executable is 4Kb. objdump helps to reduce the size to 3Kb.

\FreeBASIC\fbc -nodeflibs -c Wnd.bas
IF EXIST \MinGW\bin\objcopy.exe ( \MinGW\bin\objcopy --remove-section .fbctinf --remove-section .ctors Wnd.o )
\FreeBASIC\bin\win32\ld -e _WinMainCRTStartup -subsystem windows -o Wnd.exe Wnd.o -L\FreeBASIC\lib\win32 -lkernel32 -luser32 -lgdi32 -s


' Source code based on : https://www.freebasic.net/wiki/wikka.php?wakka=TutMessageIntro

#include once "windows.bi"

Declare Function WinMain ( hInstance As HINSTANCE,hPrevInstance As HINSTANCE, _
                           szCmdLine As LPSTR,iCmdShow As Integer ) As Integer
                                 
Function WinMainCRTStartup Naked Cdecl alias "WinMainCRTStartup"() as Uint

ExitProcess(WinMain( GetModuleHandle( null ), null,GetCommandLine(), SW_NORMAL ))

End Function


Function WndProc ( hWnd As HWND,message As UINT, _
                   wParam As WPARAM,lParam As LPARAM ) As LRESULT
   
    Function = 0
   
    Select Case( message )
       
        Case WM_PAINT

            Dim rct As RECT
            Dim pnt As PAINTSTRUCT
            Dim hDC As HDC
         
            hDC = BeginPaint( hWnd, @pnt )
            GetClientRect( hWnd, @rct )
           
            DrawText( hDC,"Hello Windows from FreeBasic!",-1,@rct,_
                      DT_SINGLELINE Or DT_CENTER Or DT_VCENTER )
           
            EndPaint( hWnd, @pnt )
           
            Exit Function           
       
        Case WM_DESTROY

            PostQuitMessage( 0 )
            Exit Function

    End Select

    Function = DefWindowProc( hWnd, message, wParam, lParam )   
   
End Function


Function WinMain (hInstance As HINSTANCE,hPrevInstance As HINSTANCE, _
                  szCmdLine As Zstring Ptr,iCmdShow As Integer ) As Integer   
     
    Dim wMsg As MSG
    Dim wcls As WNDCLASS     
    Dim hWnd As HWND
     
    Function = 0
     
    Dim As LPSTR szAppName = @"HelloWindows"
     
    With wcls
        .style         = CS_HREDRAW Or CS_VREDRAW
        .lpfnWndProc   = @WndProc
        .cbClsExtra    = 0
        .cbWndExtra    = 0
        .hInstance     = hInstance
        .hIcon         = LoadIcon( NULL, IDI_APPLICATION )
        .hCursor       = LoadCursor( NULL, IDC_ARROW )
        .hbrBackground = GetStockObject( WHITE_BRUSH )
        .lpszMenuName  = NULL
        .lpszClassName = szAppName
    End With
         
 
    If( RegisterClass( @wcls ) = FALSE ) Then
       MessageBox( null, "Failed to register wcls!", szAppName, MB_ICONERROR )
       Exit Function
    End If
     

    hWnd = CreateWindowEx( 0, _
                           szAppName, _
                           "The Hello FreeBasic Program", _
                           WS_OVERLAPPEDWINDOW, _
                           CW_USEDEFAULT, _
                           CW_USEDEFAULT, _
                           CW_USEDEFAULT, _
                           CW_USEDEFAULT, _
                           NULL, _
                           NULL, _
                           hInstance, _
                           NULL )

    ShowWindow( hWnd, iCmdShow )
    UpdateWindow( hWnd )


    While( GetMessage( @wMsg, NULL, 0, 0 ) <> FALSE )   
        TranslateMessage( @wMsg )
        DispatchMessage( @wMsg )
    Wend
   
    Function = wMsg.wParam

End Function

jimg

Hey guys-

I tried to register with the freebasic forum but failed.   

the question to answer is-
What is the name of the programming language this site is about? Append four exclamation marks and one "period" to the end of your answer:

I answered  freebasic!!!!.

but apparently that's not correct.  Two other trys and I exceeded my attempts.

any guesses?

Vortex

Hi jimg,

Maybe I am wrong but the forum can expect a case-sensitive reply : could you try FreeBASIC instead of freebasic ?