PowerBASIC have recently announced on their web site that they will start shipping their two new compilers in a reasonably short time. As soon as it is released I will try and get the technical data for the new capacities so that everyone interested can have a look at it.
Quote from: hutch-- on January 22, 2011, 11:57:47 PM
PowerBASIC have recently announced on their web site that they will start shipping their two new compilers in a reasonably short time. As soon as it is released I will try and get the technical data for the new capacities so that everyone interested can have a look at it.
Many thanks for this decent advertisement!
I always was a big admirer of the
Beginner's All-purpose thingy.
:toothy
! nop
versus
__asm{
nop
}
Yo ho ho etc ....
:bg
INTRODUCTION TO BASIC
I inflated the disk size so it did not come in at 6144 bytes. Don't want to make the C runtime libraries look as bloated as they are. :P
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
MACRO WILLKOMMEN_BEI_BASIC = FUNCTION PBmain as LONG
MACRO ANKUNDIGUNG = MSGBOX
MACRO AUFBLASEN_ME_LIKE_C = #BLOAT
MACRO AUF_WIEDERSEHEN = End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
AUFBLASEN_ME_LIKE_C 1024 * 28 ' ADD 28K TO MATCH C RUNTIME SIZE
WILLKOMMEN_BEI_BASIC
0000:ANKUNDIGUNG "ONE ZWEI DREI VIER FUNF SECHS SIEBEN ACHT NEUN ZEHN",0,"JAPHETH ERA BASIC"
AUF_WIEDERSEHEN
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
i'm having trouble, too, Hutch...
Yo ho ho eax,ebx
Quoteerror A2008: syntax error : ho
no ho, here
oddly enough, it didn't seem to mind Yo - lol
Quote from: hutch-- on January 29, 2011, 12:33:47 AM
:bg
INTRODUCTION TO BASIC
I inflated the disk size so it did not come in at 6144 bytes. Don't want to make the C runtime libraries look as bloated as they are. :P
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
MACRO WILLKOMMEN_BEI_BASIC = FUNCTION PBmain as LONG
MACRO ANKUNDIGUNG = MSGBOX
MACRO AUFBLASEN_ME_LIKE_C = #BLOAT
MACRO AUF_WIEDERSEHEN = End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
AUFBLASEN_ME_LIKE_C 1024 * 28 ' ADD 28K TO MATCH C RUNTIME SIZE
WILLKOMMEN_BEI_BASIC
0000:ANKUNDIGUNG "ONE ZWEI DREI VIER FUNF SECHS SIEBEN ACHT NEUN ZEHN",0,"JAPHETH ERA BASIC"
AUF_WIEDERSEHEN
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
#BLOAT (http://www.powerbasic.com/support/help/pbcc/_bloat_metastatement.htm) is cute... how to do that in MASM?
:toothy
Easy,
\masm32\examples\example09\bloat\hllemu.asm
Quote from: dedndave on January 29, 2011, 01:37:50 AM
oddly enough, it didn't seem to mind Yo - lol
JWasm is more strict:
Yo ho ho eax,ebx
CODE317.ASM(5) : Error A2211: Syntax error: Yo
CODE317.ASM: 9 lines, 1 passes, 0 ms, 0 warnings, 1 errors
:bg
i am surprised at the level of social deprevation when persons are unaware of the origin of the expression "yo ho ho".
Robert Lewis Stevenson
Treasure Island 1901
Fifteen men on a dead man's chest
Yo ho ho and a bottle of rum
Drink and the devil had done for the rest
Yo ho ho and a bottle of rum.
Since you guys clearly don't have the parser for it, here is another bloated pig in PB at 6656 bytes.
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
FUNCTION PBmain as LONG
msgbox chr$( _
"Fifteen men on a dead man's chest",13,10,_
"Yo ho ho and a bottle of rum",13,10,_
"Drink and the devil had done for the rest",13,10,_
"Yo ho ho and a bottle of rum.",13,10),0,"Yo ho ho"
End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Quote from: hutch-- on January 29, 2011, 11:28:54 PM
Since you guys clearly don't have the parser for it, here is another bloated pig in PB at 6656 bytes.
Hutch,
Your code gave me a few syntax errors, but now it works, at 1024 bytes :bg
include \masm32\include\masm32rt.inc
.code
start:
MsgBox 0, chr$(\
"Fifteen men on a dead man's chest",13,10,\
"Yo ho ho and a bottle of rum",13,10,\
"Drink and the devil had done for the rest",13,10,\
"Yo ho ho and a bottle of rum.",13,10),"Yo ho ho", MB_OK
exit
end start
:bg
I can do it in MASM too. :U
Quote from: hutch-- on January 30, 2011, 12:00:02 AM
I can do it in MASM too. :U
Masm, Basic, where is the difference ::)
> Masm, Basic, where is the difference
Thats why I said i can do it in MASM too.
Take the compliment on your language interface design though, it appears to work well.
With PB you pick up the overhead of a dynamic string engine and a number of other capacities for the 6k startup but then it is a compiler, not an assembler and it has a built in run time library that has a massive capacity s you use and include more of it.
Now try this in C++, genuine 80 bit floating point, not the normal C runtime limit of 64 bit. 7680 bytes in basic with its default runtime library. All I have to do is force you to use any C runtime function and your size explodes.
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
FUNCTION PBmain as LONG
LOCAL fvar as EXTENDED ' 80 bit FP
LOCAL azTxt as ASCIIZ * 32
fvar = 1234.567890123456
azTxt = format$(fvar * (9876.54321098765 / 1029.564738291092))
msgbox azTxt,0,"80 bit FP"
End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Alex,
All I need to do is look at the Microsoft PE specifications and the minimum size for a valid PE file is 2 x 512 byte sections, 1024 bytes. I have seen hand coded hex PE files under 200 bytes but they are not valid 32 bit PE files, they are just non-functional oddities that may not crash all Windows versions.
Reference Microsoft PECOFF.DOCX
Here is some REAL LINE NUMBERED BASIC.
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
FUNCTION PBmain as LONG
0007:DIM VAR AS LONG
0006:VAR = 0
0005:VAR = VAR + 1
0004:IF VAR < 10 GOTO 0005
0003:? FORMAT$(VAR)
0002:VAR = VAR - 1
0001:IF VAR > 0 GOTO 0002
0000:? FORMAT$(VAR)
End FUNCTION
' ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Still blows out to 7680 bytes. :bg
Quote
The true issues with PB are:
- no support for an object format. You're stuck in the little PB world.
- you have to buy 2 compilers to get the full functionality.
The first was a valid complaint but for no longer with the two coming compilers. They use a format called
SLL (static link library) but it is not the same as OMF or COFF as neither of them could handle the internals of a basic compiler and other compilers could not handle the content. There is a reason for a separate console compiler as it is tuned to perform that task with functionality that the GUI version does not contain or use. I regularly design algos in the console compiler and use the results in either. It just happens to be that development and testing from the console is faster than building a user interface just to test out results.
The other very low level capacity that the pre-release info states is the optional removal of unused text based source code which reduces the output size down to containing only code that is called and used in the application. There is an option to create procedures with no stack frame called FASTPROC which will solve on of the few problems the compilers had with very short leaf procedures.
When they are released I will get my hands on them at some stage and post some results here.
Quote
- you have to buy 2 compilers to get the full functionality.
You don't. Using the Windows API, you can develop console applications with the GUI compiler and GUI applications with the console compiler. But the console compiler makes the dirty work for you and, as hutch, I use it for developing and testing non GUI related code.
Regarding atatic libs, the new compilers are so fast that I prefer to use include files: they have some advantages, such allowing conditional compilation. I guess that static libraries will be mainly used by third party programmers wanting to hide his code.
Quote from: José Roca on February 02, 2011, 06:37:10 AM
You don't. Using the Windows API, you can develop console applications with the GUI compiler and GUI applications with the console compiler.
I'm aware of the Win32 API and AllocConsole() or CreateWindowEx(), and if needed you can also patch the flag in the PE header. The problem is not on the technical side.
Quote
Regarding atatic libs, the new compilers are so fast that I prefer to use include files: they have some advantages, such allowing conditional compilation. I guess that static libraries will be mainly used by third party programmers wanting to hide his code.
IMO you guess wrong.
Quote
IMO you guess wrong
I did mean among PB users. With other languages they are also used to get shorter compile times.
Quote from: José Roca on February 02, 2011, 08:34:19 AM
I did mean among PB users. With other languages they are also used to get shorter compile times.
Ok, I see. However, IMO there are more advantages than just "shorter compile times" when a compiler does support an object format. The generic question in this regard is: What are linkers good for? But since this discussion probably has been led a few thousands times already, I'll stop here.
Its a case of market targetting, there is a demand for a console specific basic compiler where you can write code from LINE NUMBERED BASIC to pure API code and assembler and most flavours inbetween. Now while its no big deal to write console specific API code or call functions from MSVCRT, not everyone wants to write that type of code and this is what the console compiler caters for. It cannot build a DLL, that is the situation where you use the wider capacity GUI compiler. It just happes to be that the GUI version does not contain the console specific runtime functions.
Libraries are a matter of taste, I have been writing and using them for over 20 years so I will probably build a library of PB functions but the dead code removal method removes the necessity of having to do that when you have large collections of related code. Where with the earlier versions you copied out the code you wanted which can be a pain with nested dependencies, the dead code removal technique allows you to bundle large numbers of functions in a single source file which you can then include as a complete file as the compiler will not insert code from unused functions.
With about the same coding effort as including libraries, you do something like this,
#include "myio.bas"
#include "mymathsfunctions.bas"
#include "myMSVCRT.bas"
With this any code you call from the include files is added to the final binary and the rest in those files is extracted out of the final build. A version or so ago PowerBASIC no longer requires a prototype for its local functions so you don't have to add matching include files to source files. Prototypes are required for external functions like API calls and these can be tuned to how you want to call the API. PB has multiple techniques for passing arguments to functions, the normal by value, it will pass arguments by reference and has yet another trick where you can pass a dynamic string by copy when the API prototype may be written for another data type. You can also specify an over-ride of passing the argument by value.
Just one favour requested, I have just had to waste the time cleaning up this mess of postings not related to this topic. I have just moved the C/C++ code to the C/C++ subforum. Please keep this mess out of here as it just makes more work for me to keep the forum readable. I will delete any further off topic postings.