Where could I get the PowerBASIC compiler, tools, IDE, manual, documentation/tutorials?
Best regards. :wink
https://www.powerbasic.com/shop/
:wink
There would be of no other way to obtain the compiler? I was thinking it would be free. :boohoo:
Nah, you have to buy this one, its written by hand by an experienced programmer who runs a small company and they have to be able to pay the bills to keep going.
Quote from: hutch-- on December 05, 2009, 12:02:48 AM
Nah, you have to buy this one, its written by hand by an experienced programmer who runs a small company and they have to be able to pay the bills to keep going.
See a photo of an experienced programmer (http://www.powerbasic.com/aboutpb.asp)
:bg
Thats find JJ, I never knew Bob had ever posted a photo. He has been around for a long time designing and writing compilers in assemblerand has a decent user base of people who still like to write code in basic.
WTF jj, is his appearance not to your liking or what? Bob Zale is an experienced programmer, and a damned good assembler programmer too. PowerBASIC is worth every penny if you ask me.
Although, I will be reluctant to spend any more money on it unless they offer a compiler that targets x64. They have always come through before though.
Quote from: Greg Lyon on December 06, 2009, 12:34:12 AM
WTF jj, is his appearance not to your liking or what? Bob Zale is an experienced programmer, and a damned good assembler programmer too. PowerBASIC is worth every penny if you ask me.
Greg, I admire Bob for what is doing, that's why I posted the link to the photo. I even bought a license years ago (although I never used it seriously).
Be careful JJ, we may lead you astray. :bg
Quote from: hutch-- on December 06, 2009, 12:30:51 PM
Be careful JJ, we may lead you astray. :bg
No such risk, Hutch, I stick to Masm32, and rich PowerMasmBasic (http://www.masm32.com/board/index.php?topic=12460) :bg
Does PoweBASIC support static libraries?
Quote from: Vortex on December 06, 2009, 03:26:01 PM
Does PoweBASIC support static libraries?
No. It doesn't even know what a linker is. This isn't that bad as it seems at first glance, though, because, as you probably know, BASIC is an acronym for
Beginner's
All-purpose
Symbolic bla-bla-bla, and it's a quite good strategy to not confuse noobies with too advanced stuff...
Static libraries too advanced stuff? What a joke! The compiler for the DOS platform did support them, many, many years ago. That was before we could use DLLs.
Quote from: José Roca on December 06, 2009, 10:15:24 PM
Static libraries too advanced stuff? What a joke!
Hutch, we really need an "attention irony" icon here. Japheth's German humour is too advanced for ordinary human beings :wink
Thats one of the things on the wish list or if you are an old timer at the PB forum, the "whisch list" but its not a big deal if you know your way around the language. The current two versions solved the last performance problem they has in assembler cde, alignment from 2 to 64 in normal powers of 2.
While MASM as an assembler has far less restrictions in terms of architecture, the great performance item in the 2 compilers is its dynamic string engine and while it can be wasted on sloppy legacy basic code, you can do interesting things with it, hash table of massive size where the unused slots only take up 4 bytes and every item can be changed to the limit of memory is just one of them. It routinely pulls apart string arrays and puts them back together again later and has a very extensive collection of string functions ranging from the old legacy versions to many new ones.
For doing hacky string stuff you can code it that fast that they are viable for write once, run once code and you have the job finished before your competitor has found his/her include files.
The conditional compile directives are reliable and very useful, its macro engine eats C/C++ alive and its DECLARE notation is very well suited for repackaging external function calls in many interesting ways, I have just been wading through the now "known DLL" the old MSVCRT repackaging its function calls into something useful.
There are two things I would like to see in the language, static libraries with a linker and access to module level scope so you can access labels with global visibility and create the bare bones of a procedure, a start label followed after your code with a RETN.
None the less, I have never had any problem writing anything I ever needed with it and it still delivers small code without side by side DLLs, bloat etc ....
I second your wish regarding static libraries.
I too have been using PowerBASIC since it originally appeared on the scene for DOS after Bob bought out the rights from Borland. I find myself much more experienced now and would really like to see both a 64-bit version of his compiler and the inclusion of a linker so I can use static libraries. In terms of a 64-bit version, Bob must be working on one because 64-bit is the future and with so many other languages having gone 64-bit, I don't see how Bob can possibly not be addressing this.
One thing about PowerBASIC even though it is pricy the first time you buy it (updates cost much less), it is fast, powerful, and commercially viable in that it shouldn't disappear like so many "indie" basics out there. Besides, PowerBASIC comes from my home state.
Logman
Can someone post a simple example exe, so I can take a look at it ?
How simple, GUI, CONSOLE, source code and exe etc .... ?
Just console , plz :toothy
:bg
Easy,
This example is written like MASM code and steals a number of no stack frame procedures from the MASM32 library. Its a trick to get around the exclusion of module level code by setting up a SUB with assembler procedures in it, getting the start addresses and writing them to global scope DWORD variables then calling those addresses with normal push/call notation.
#IF 0 ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
No stack frame procedures in PowerBASIC
#ENDIF ' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
GLOBAL slnth as DWORD
GLOBAL lower as DWORD
GLOBAL upper as DWORD
GLOBAL monos as DWORD
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
FUNCTION PBmain as LONG
#REGISTER NONE
LOCAL pstr as DWORD
LOCAL lstr as DWORD
LOCAL szText as ASCIIZ * 96
WriteProcAddresses ' get the address of each procedure
szText = " THIS IS A STRING TO TEST THE STRING LENGTH ALGO "
StdOut szText
pstr = VarPtr(szText)
! push pstr
! call slnth ' get string length
! mov lstr, eax
StdOut "Length ="+str$(lstr)
! push pstr
! call lower ' convert it to lower case
StdOut szText
! push pstr
! call upper ' convert it to upper case
StdOut szText
! push pstr
! call monos ' clean up the spacing and other junk
StdOut szText
! push pstr
! call slnth ' get string length
! mov lstr, eax
StdOut "Length ="+str$(lstr)
StdOut "Press any key to say Bye Bye ...."
Do
Sleep 10
Loop while inkey$ = ""
FUNCTION = 0
End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
SUB WriteProcAddresses()
#REGISTER NONE
slnth = CodePtr(proc1)
lower = CodePtr(proc2)
upper = CodePtr(proc3)
monos = CodePtr(proc4)
Exit SUB
' --------------------------------------------------------
' string length
' --------------------------------------------------------
#align 16
proc1:
! mov eax, [esp+4]
! sub eax, 4
lbl0:
! add eax, 4
! cmp BYTE PTR [eax], 0
! je lb1
! cmp BYTE PTR [eax+1], 0
! je lb2
! cmp BYTE PTR [eax+2], 0
! je lb3
! cmp BYTE PTR [eax+3], 0
! jne lbl0
! sub eax, [esp+4]
! add eax, 3
! ret 4
lb3:
! sub eax, [esp+4]
! add eax, 2
! ret 4
lb2:
! sub eax, [esp+4]
! add eax, 1
! ret 4
lb1:
! sub eax, [esp+4]
! ret 4
' --------------------------------------------------------
' lower case
' --------------------------------------------------------
#align 16
proc2:
! mov eax, [esp+4]
! dec eax
lbl4:
! add eax, 1
! cmp BYTE PTR [eax], 0
! je lbl5
! cmp BYTE PTR [eax], "A"
! jb lbl4
! cmp BYTE PTR [eax], "Z"
! ja lbl4
! add BYTE PTR [eax], 32
! jmp lbl4
lbl5:
! mov eax, [esp+4]
! ret 4
' --------------------------------------------------------
' upper case
' --------------------------------------------------------
#align 16
proc3:
! mov eax, [esp+4]
! dec eax
lbl6:
! add eax, 1
! cmp BYTE PTR [eax], 0
! je lbl7
! cmp BYTE PTR [eax], "a"
! jb lbl6
! cmp BYTE PTR [eax], "z"
! ja lbl6
! sub BYTE PTR [eax], 32
! jmp lbl6
lbl7:
! mov eax, [esp+4]
! ret 4
' --------------------------------------------------------
' monospace and clean up text
' --------------------------------------------------------
#align 16
proc4:
! push ebx
! push esi
! push edi
! push ebp
! mov esi, 1
! mov edi, 32
! mov bl, 32
! mov ebp, 9
! mov ecx, [esp+20]
! xor eax, eax
! sub ecx, esi
! mov edx, [esp+20]
! jmp ftrim ; trim the start of the string
wspace:
! mov BYTE PTR [edx], bl ; always write a space
! add edx, esi
ftrim:
! add ecx, esi
! movzx eax, BYTE PTR [ecx]
! cmp eax, edi ; throw away space
! je ftrim
! cmp eax, ebp ; throw away tab
! je ftrim
! sub ecx, esi
stlp:
! add ecx, esi
! movzx eax, BYTE PTR [ecx]
! cmp eax, edi ; loop back on space
! je wspace
! cmp eax, ebp ; loop back on tab
! je wspace
! mov [edx], al ; write the non space character
! add edx, esi
! test eax, eax ; if its not zero, loop back
! jne stlp
! cmp BYTE PTR [edx-2], bl ; test for a single trailing space
! jne quit
! mov BYTE PTR [edx-2], 0 ; overwrite it with zero if it is
quit:
! mov eax, [esp+20]
! pop ebp
! pop edi
! pop esi
! pop ebx
! ret 4
' --------------------------------------------------------
END SUB
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Logman,
One of the PowerBASIC guys, I think it was Steve Rossell, said they were working on a 64-bit version of PB. That post seems to have disappeared now. Anyway, that's good news.