This means I can write tiny silly stuff like the 1kb hello.


f0dder,

O.K, a 1kb hello doesn't demand any special coding skill. :) My example was ony a small demo. :)

In asm, the proto stuff can be done also with the wsprintf function similar to sprintf.
Posted on 2004-03-27 05:13:36 by Vortex
Vortex,

The posted code is part of the L2EXTIA code in the current version which I don't really need to change at the moment. I also have another version written back then that puts the INVOKE within the equate to the function name and it worked OK but I was not willing to implement the scale of change necessary to use it when it would have broken a mountain of exiting code.

f0dder,

The "proto$" concantenation was the simple stuff, what you did not emulate was the preceding nested function that is common native basic code.


cnt = atoi(strrchr(p, '@') + 1) / 4;

not equal

cnt$ = ltrim$(str$(val(right$(p$,len(p$)-instr(p$,"@")))\4))

It has 6 functions in a single line of code.


ltrim$ left trim dynamic string
str$ convert number to string
val convert string to number
right$ right side string truncation
len string length
instr find substring in string

Basic is designed to be used in this manner and this is by no means complex code. It works just as well with binary data as basic dynamic string can embed zeros normally.

Now before you respond to a members question by telling him the compiler he is using is a pile of sh*t, dilute your own ignorance of the technical considerations of a language that you clearly don't understand and cannot write code with.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-27 07:22:56 by hutch--

The "proto$" concantenation was the simple stuff, what you did not emulate was the preceding nested function that is common native basic code.

Which code is easiest to read, and wanna bet which code runs fastest? ;)
The code I pasted is standard C code (strrchr is nonstandard and only available with some implementations, but it doesn't take long to come up with your own). The "<<" stuff would be done with a std::ostringstream or std::ostream (output to string or to a file).

If you want to use the 6 function call braindamaged code you posted, that could be done with C++ as well, with the same syntax. A few additional functions would have to be written, but it can be done. Somewhat braindamaged, when a smaller, simpler and faster way is available.


Basic is designed to be used in this manner and this is by no means complex code. It works just as well with binary data as basic dynamic string can embed zeros normally.

It's slow & overcomplex code for what it does. Custom C++ string classes have no problems with embedded zero data either. And the wonderful thing is you have full control of the performance of the code - if it doesn't perform well enough, fix the code... I doubt you have access to the string code generation of your crappy powerbasic :tongue:
Posted on 2004-03-27 09:06:57 by f0dder
When you criticise one members work and tell another member that the compiler he is using is a pile of sh*t, all you have done is display your own ignorance of a language that you don't even vaguely understand.

Where the member who asked the question needed some assistance with his enquiry, he in fact did not need to be the target of the 2004 f0dder redefinition of the 1989 ANSI C standard on the basis of the personal prejudice of f0dder.

No one has tried to leverage you to try and write in a language that is probably too advanced for you but having to listen to the abuse and insults that you point at its author, its user base and members of this forum becomes an irritant to the ear after a while.

Further pontifications based on you own limited experience doing cross comparisons to other languages with what you understand of Intel optimisation technical data falls on deaf ears when you simply don't have the experience in any of the languages to a level of doing so.

The criticism you receive here is a rod across your own back of your own making from shooting your mouth off at the expense of members of this forum. If you cannot be useful as in the original enquiry that the member made, you could at least hide your ignorance by not putting your foot in your mouth in public.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-27 18:43:40 by hutch--
Hutch,

I really dont understand why f0dder shouldnt be able to tell us his opinion about (power)basic.
And if he thinks this stuff sucks so its ok to tell us. Maybe its insults the author, but it is legal critics.

BTW: I havent dealt ever with powerbasic, but know something about C and C++ and cannot agree with
your "C/C++" remarks. Modern C++ dialects (with templates) are very powerful, you can easily achieve very small code sizes (if you know your tools) and speed is as fast as ASM (with very few exceptions). So as far as C/C++ is concerned I can only confirm f0dder's opinion.

Japheth
Posted on 2004-03-28 01:44:51 by japheth

Hutch,

I really dont understand why f0dder shouldnt be able to tell us his opinion about (power)basic.
And if he thinks this stuff sucks so its ok to tell us. Maybe its insults the author, but it is legal critics.


I agree 100%. His opinion is just that, an opinion. If somebody says Java is hell, nobody questions his opinion even if they disagree, the same should apply to any language. If the author is a member of the board, all the better, he has the option of asking specifically what f0dder found unsuitable and trying to correct it. That is how good languages are developped, not by praise and "OH this is the best thing since sliced bread" but by criticism and pointing out deficiencies.

For myself I am doubtful that it can be better than an optimizing C compiler, maybe equal but not better. Like f0dder I find that code size is a legacy of the old days when memory and harddrive space was limited and as a programming consideration is no longer relevant and should not be used as a measurement of the quality of a language. There are ofcourse limits to that rule, a 1MB Hello World would still be stupid, but when you're talking about a few K who cares anymore. It still makes me smile when I see the effort put into making 1K Hello World applications, a useless waste of time and talent that has no bearing on modern reality.

Finally, I still think the opinion part of this thread should be split and moved to the Crusades as it has nothing at all to do with programming anymore and certainly nothing to do with assembler.

Just as a side note :
Bob Zale
Date Registered: June 21st, 2002
Status: Code Warrior
Total Posts: 0 (0.00 posts per day) / % of total posts
Last Post: Never


Not exactly going out of his way to help anyone. I would be more inclined to defend f0dder's right, as an active contributing member of the board, not to be insulted than someone who probably only visited once and doesn't seem interested in asm at all.
Posted on 2004-03-28 02:59:34 by donkey
I don't like basic as a language, I find it limited for what I do, and I don't agree with some of the language features, like pulling variables out of the blu sky, and having implicit type conversions. Features like that are okay in a scripting language, but not a "real" language. And if I wanted a scripting language, I'd choose something decent like Python.

That said, PowerBasic is probably okay for some stuff, like hacking together some tools quickly or whatever. But I stand by my statement: it's code generation sucks, majorly. You would have expected better from somebody that boasts he wrote the language in OMFG TEH LEET 100% ASSEMBLER! And no static library support? Come on.

And as for the rest of the BS... you can make C++ do whatever basic can, but you can't make basic do all what C++ can. This is evident by looking at language features, not even specific implementations. If you compare specific implementations, like Intel C++ or Microsoft C++ to PowerBasic, it's also quite clear which platforms do the best code generation.

If it wasn't for the attitude of the developers, I probably wouldn't have used such derogatory words, but come on... even GCC generates better code than PowerBasic, and they have statements like the following on their site:

machine code generated by PowerBASIC is among the most efficient in the industry, both in terms of size and speed. It compares most favorably with leading compilers of any dialect, Pascal, C++, Fortran, and others.

:rolleyes:


Finally, I still think the opinion part of this thread should be split and moved to the Crusades as it has nothing at all to do with programming anymore and certainly nothing to do with assembler.

Sorry ;-)
Btw, Bob Zale joined just to spew some propaganda about PowerBasic after it was "spoken unkindly of" :tongue: in another thread. Wouldn't be surprised if it's hutch the brought him here. While I'm not going to claim I've ever-helpful and contributing, Zale never contributed anything here afaik :)

Have fun.
Posted on 2004-03-28 05:01:30 by f0dder
Well,

These things cut both ways, if f0dder has special priveleges at criticising anyone he like with any language he likes then he is the identical target who can be criticised in any way that his adversary likes in any language they like.

When f0dder tells a member, the original poster in this instance that the compiler he uses is a heap of sh*t yet offers him no useful information at all, he is just being an arrogant little sh*t pontificating about something that he is ignorant about.

As a matter of fact PowerBASIC cannot be modified in any reasonable way because of the way its structured and cross internally optimised so under the current technology it uses, an external library cannot be used.

When it comes to matching opinions between someone like f0dder and the author of a highly successful compiler that has a very large user base, f0dder needs to go blow his nose with his opinion.

While anyone can write anything they like in any language format they like, this is still finally an assembler language forum so the assumption that all code should be written in C is not a commonly held one among many people who do write assembler.

Neither is the assumed dominance of technical superiority that is assumed along with it and many people from many different language backgrounds differ from this view with good reason.

I have picked f0dder up for the patronising bullshit that has been coming out of him when he is clearly an illiterate in the area he is trying to criticise.

To the specifics,

And as for the rest of the BS... you can make C++ do whatever basic can, but you can't make basic do all what C++ can. This is evident by looking at language features, not even specific implementations.

As it seems f0dder misses thing like "writing native assembler", just so no-one else misses it, the dialect of basic has its own inline assembler which comforms to the historical INTEL format and can write ANYTHING that you can write in assembler. As far as I remember it has not had the SSE2 instructions added last I knew.

The ONLY language I know that can do anything is assembler and while it may rub people like f0dder the wrong way the someone would write in "OMFG TEH LEET 100% ASSEMBLER!", in fact many people do write assembler in PowerBASIC and don't give a flying PHUK about people like f0dder.

While writing assembler code may be too difficult for f0dder at an application level, many don't suffer that limitation and happily write whatever they like so even if f0dder suffers an inferiority complex with his coding style, its no reason to inflict it on anyone else.

I wonder why these pearls of wisdom are not being pontificated at a C forum, is it because f0dder is off the pace there and has to big note himself in another language forum where C is not the most important language ?

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-28 09:47:39 by hutch--
VC++ and Intel C++ have full inline assembly support, and as far as I know all the way up to SSE2. If that's not good enough, that static library support allows to link assembly (or, for that matter, any other language outputting COFF or OMF objects with x86 code) directly into the output executable.

Next, the C++ language is very powerful, and through the use of classes and templates, you can define your own data structures - I wonder if PowerBasic lets you do this :rolleyes:. Do I want to work directly and intuitively with strings? Or "big numbers"? Or dynamic arrays? Math vectors? No sweat, the language is flexible enough that it allows this... use pre-existing code, or write up your own (possible throwing a lot of optimized assembly for things like bignums), and woop - off you go. What's your option with powerbasic? Inline assembly or a DLL, and having to use a lot of function calls like bignum_add, bignum_mul etc, while C++ allows "result = bignum1 * bignum2;" ... yay.


As a matter of fact PowerBASIC cannot be modified in any reasonable way because of the way its structured and cross internally optimised so under the current technology it uses, an external library cannot be used.

Inferior technology, then. C and other reasonable languages have had module linking since the beginning of time, and all reasonable compilers today have per-function linking (and the best compilers have "global optimizations", which you probably wouldn't understand if I tried to explain, so I won't). It's true that the granularity of the standard C library is somewhat course, but at 28k I don't really care. And for anything else, you can get as small granularity as you want.


While anyone can write anything they like in any language format they like, this is still finally an assembler language forum so the assumption that all code should be written in C is not a commonly held one among many people who do write assembler.

I'm not saying everybody should write in C - I'm just saying PowerBasic sucks, and that I don't like the basic language :). I picked C++ as a comparison because it's my language of choice, and because the two leading compilers for x86 quite obviously produces code that is far superior to PB.

You amuse me :tongue:, but now please have me excused, I'm in the middle of tweaking my kernel bootloader (asm code, btw). Have fun with your toy ^_^
Posted on 2004-03-28 10:10:21 by f0dder
Nothing like some native PowerBASIC to make the point.


szCopy:
! push ebp
! mov ebp, esp
! push edi

! mov edx, [ebp+8]
! mov edi, [ebp+12]
! xor ecx, ecx

lpst:
! mov al, [edx+ecx]
! mov [edi+ecx], al
! add ecx, 1
! test al, al
! jne lpst

! pop edi
! mov esp, ebp
! pop ebp
! retn

Tel us all which compiler switches you flick on your leading edge bloat buckets to optimise this native PowerBASIC code. Its a small component for working with hash tables. Perhaps you could add some OOP(S) to it to make it go faster or do you need the 28k of crap on a default C exe file to get it up to speed.

Perhaps you could search for an Intel C compiler library module to do this for you if your current bloat bucket can't do the job. :tongue:

What you need is a new compiler switch for your C++ bloat bucket,


/hand_write_algo_in_PowerBASIC


Some pure PowerBASIC for your pleasure.

Regards,

http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-28 10:31:04 by hutch--
*giggle*. And I couldn't do something similar with the use of inline assembly in any C++ compiler of choice? Of course I could. Fun thing is, I wouldn't need to for such simple code, because my compilers of choice actually have decent optimizers. So, I could rely on native code instead of inline assembly. And sorry to break your illusions, but that is not "native PowerBASIC", it's "inline assembly in PowerBASIC". If you need to resort to inline assembly for something that simple, I think it's fair to say the optimizer is broken.


Perhaps you could add some OOP(S) to it to make it go faster or do you need the 28k of crap on a default C exe file to get it up to speed.

Silly... first of all, those 28kb of runtimes isn't crap if you actually use it - which I tend to do for anything but silly "hello, world" examples. Second of course I wouldn't wrap up a silly little thing like your example with OOP code, as there is no benefit. Third, I wouldn't need to handcode such a trivial thing in assembly, as the compiler would do rather well (and of course still allowing me to handcode it). And fourth, if I'm dissatisfied with anything, I can choose to leave it out, and plug in my own static libraries, classes, templates, assembly code, pascal code, whatever. This sounds like flexibility & control to me.

I think it's fun that you're so protective of PB, while you're flaming spasm/rosasm/whateverit'scalledthismonth for it's lack of static library capability - http://masmforum.com/viewtopic.php?t=1108&postdays=0&postorder=asc&start=9 . Do we sense a slight amount of hypocrisy? But I guess it's because you are always right, and everything you do is righteous? ^_^

If you had the ability to be just a tiny bit objective, you'd realize that modern C++ compilers offers more flexibility than PB: control of what to include, ability to leave out any runtimes completely, can link dynamically or statically with arbitrary other languages. You'd also find that the language itself is more powerful - you don't have to depend on any built-in function, as the language itself, regardless of compiler vendor, is powreful enough that you can implement complex datatypes like strings, dynamic arrays, trees, ... and have full control of the implementation, of course. You'd also realize that especially VC++ and Intel C++ produces much better code (yeah, both microsoft and intel ;) have studied the intel manuals).
Posted on 2004-03-28 10:53:28 by f0dder
NaN,

I have always had a reasonable respect for you apart from differences in the past so as a moderator, I would expect that you are at least aware of the dynamics of what has happened here.

I have picked f0dder up on a matter of bad manners where he responded to a member asking a question by telling him his compiler was a "pile of sh*t".

i am like many other who come to this forum in that I primarily write assembler language and I don't see that any particular person has any God given right to endlessly inflict their own view over other people about the primacy of one particular compiler over another.

In case you have forgotten, the founding members of this forum built it as an assembler forum, not as an accessory to any C++ compiler and neither did they build in the assumption that the forum was going to be used as a vehicle for abuse and insults to members who are asking for assistance.

In contrast to the patronising bullsh*t that has come out of f0dder here about the primacy of his C compiler over assembler, basic, Pascal and any other form of programming, there is in fact a wide number of people who are your members who don't hold the view and don't need to keep having it inflicted on them at a nuisance level.

I have sold the view that bad manners work against constructive assistance to members who make a technical enquiry and it does not matter if its about Visual Basic, Delphi, or any other language form. As long as f0dder is endulged in this conduct, the original purpose of the forum to assist assembler programmers will continue to be damaged.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-28 18:11:42 by hutch--
All this, and I still dont see any constuctive matter towards the topic at hand "Static library formats".


Oh well, :rolleyes: , off to the crusaded this reply shall go as well.

Please be usefull in your replies, getting the last word has no merrit IMO.

Regards,
:NaN:
Posted on 2004-03-28 20:13:36 by NaN
Will this so-called "native PowerBASIC" (inline-assembly) code work on any platform other than IA32? No.
Can this code be understood (even at language level) by 99% of PowerBASIC users? No.
Would you need to write this piece of code in assembly when programming C/C++? Not likely.
Can this code be written in (non-standard - thus emphasizing the consequences) C/C++ using inline-assembly? Yes.

Hutch, mind separating a language from its compiler implementation? Of course you do, because, AFAIK, PowerBASIC has only one implementation. C/C++ have many. And there are even more C/C++ standard library implementations. Some of them are tuned towards speed, some towards size. You can write your own. You don't even have to use one. I don't think you can do that with PowerBASIC, can you? (well, maybe write a new PowerBASIC-compatible compiler?...).

The fact is, PowerBASIC is merely a toy. It doesn't give you portability, it doesn't give you speed, it doesn't give you flexibility, it doesn't give you choice, and many other things I can think of. Maybe you're not aware of it, but BASIC stands for Beginner's All-Purpose Symbolic Instruction Code.

I'd tell you to stop talking bullshit, but it's all so hilarious, so please go on.
Posted on 2004-03-28 23:10:54 by death

In contrast to the patronising bullsh*t that has come out of f0dder here about the primacy of his C compiler over assembler, basic, Pascal and any other form of programming


Blah blah blah. Let me quote myself:

It may be an okay tool to "get things done", but so are delphi, borland c++ builder, visual basic, perl, python, ... - however, the PB guys claim their code is "very fast, very tight", but use some pretty suboptimal constructs. Their claim of "no runtimes" is a lie (well, depends on your definition of 'runtimes'), et cetera.


So no, I'm not against "any other language than C++", I'm merely calling PB a piece of crap, because (in the context of their sales arguments), it is. If you're comfortable with your BASIC compiler that's fine, but there's nothing that makes it holy and uncriticizable.

But I guess you haven't had much exposure to any real programming or scripting languages, so your ignorance can perhaps be excused. At least I bothered to have a look at Power:grin:BASIC...

If you want the last word, feel free to post. I'll read it and have a laugh, but I don't see a point in continuing this any further.
Posted on 2004-03-29 03:31:26 by f0dder

Opinions are welcome, critical or not. But out right attacks are not warrented or welcome. Especially from someone who was once a MOD for this board, you know the rules yet you still think your above them somehow. Hutch, if you want to continue this crap, do it on *your board*.

As the moderator has chosen to delete my response to his comments, I invite the moderator to nominate neutral ground where I am more than willing to respond to his comments.

Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Posted on 2004-03-29 05:19:52 by hutch--
Well, hello Mr. President!
Posted on 2004-03-29 06:38:15 by f0dder

Well, hello Mr. President!


You gotta stop smoking crack f0dder... you are starting to post to yourself :grin:
Posted on 2004-03-29 09:53:12 by SpooK
If I was into drugs, I wouldn't do something as impure as crack. I wonder where that post of yours went? :rolleyes:
Posted on 2004-03-29 11:52:54 by f0dder
Hutch goto the cursades and finish your Holy war there. :rolleyes:

(I deleted nothing ~ i moved your reply since it had nothing to do with 'Static library format' and everything to do with your views of other people)
PS: Please do not reply this this thread with anything that is not useful to the topic at hand.

:NaN:
Posted on 2004-03-29 16:48:18 by NaN