I ran one of my VB programs through dumppe -dissasm and I found the following:

004027BA loc_004027BA:
004027BA 0000 add ,al
.
.
.
00402990 78204000 dd offset off_00402078
00402994 3200 xor al,
00402996 0000 add ,al

There was a total of 234 add ,al before dd offset off_00402078!!!! Now I may be a newbie here but I see no purpose of all those add's! Could there be a purpose or was MS lazy when they made the VB compiler? This is why I am trying to learn Assembly. :grin: What could it possibly do?
Posted on 2002-06-16 21:15:28 by Gunner
I bet you a beer that it isn't code. :rolleyes:
Posted on 2002-06-16 22:02:39 by bitRAKE

I bet you a beer that it isn't code. :rolleyes:


Sorry, I am enjoying my beer right now and none is leaving my fridge unless it's for me :tongue:

I know it is not any code I wrote... I write my code as clean and tight as I can. But what does it do? Why would it be there? I know..... the infamous VB BLOAT!!!! :grin:
Posted on 2002-06-16 22:11:30 by Gunner
string allocation? alignment for some future processor? =D

of course, the simplest answer is usually the right one. so, probably as you said, bloat :grin:
Posted on 2002-06-16 22:20:49 by jademtech
I bet(but I won't give you a beer :grin: ) it's doing a multiplication since you said there's a repetition of the add instruction ...

3 * 3 => 9 (slower)
3 + 3 + 3 => 9 (faster)

but my questions is:: VB doing optimizations??? (...Then the earth shattered into pieces ...) Oh well, if not then it must be the BLOAT FACTOR :grin:
Posted on 2002-06-16 23:09:13 by stryker
Since these wise guys won't give you a straight answer... :grin:

Take a look at the first byte of the instruction, it's 00. This happens to be the opcode for the add ,al instruction. Chances are this is a buffer or some other data, and not valid instructions. The disassembler doesn't know this and doesn't care, it just looks at the first byte, assumes it's an opcode, figures the instruction length, and moves on to the next "instruction".

bitRAKE just said it in fewer words. :)
Posted on 2002-06-17 02:49:24 by S/390
Are you disassembling the data section? :). Also, lots of VB programs
are compiled to bytecode, which you can't really run through normal
disassemblers. And btw, vb6, iirc, builds to the same internal format
as VC6 before emitting native or bytecode, and also runs the VC6
optimizer on this internal format... too bad you're still stuck with all
those runtime calls so you don't get "really fast" code.
Posted on 2002-06-17 08:05:56 by f0dder

too bad you're still stuck with all
those runtime calls so you don't get "really fast" code.


Still use VB5. Have my copy of VB4 around here somewhere. It is a great RAD tool but it is time for me to move on to something else, this is why I am here. My program, My Code.... I want it to be small and as fast as I can write it and know everything that is going on.
Posted on 2002-06-17 08:54:15 by Gunner