Rocket Science

From: The Half A Wannabee ("The)
Date: 01/31/04


Date: Sat, 31 Jan 2004 06:42:20 +0100

Below is an extract from The Jedi Master PDF.
http://www.masmforum.com/viewtopic.php?t=1873

He exposes his ignorance, without it beeing a typo, in such manner that even
his devotees should be able to pick it up. To lead the blind, I
have marked key topics with **.

>From Randalls post.
"
This is with 50,000 symbols. **Every time** I run a test like this, it
**completely blows me away** how fast MASM does the job. MASM has some very
good symbol table management routines.

**At some point**, it **would be interesting** to **find out** **exactly**
**what it is** in MASM that results in its (1) less than blinding(2) speed
for
complex source files.

Cheers,
Randy Hyde
"
(1) I guess Randy ment to have the word "no" inserted here ?
(2) Blinding is the right word for it Randall. Lol.

Again :
**Every time** (he runs the test)
**completely blows me away** (he is completly lost)
**At some point** (he dream of the day)
**would be interesting** (he has no clue yet)
**find out** (and then he...)
**exactly** (..admits it)
**what it is ** (That he has not a clue)

To me it looks like this man, who (by his own words) could debug Mindoms,
an OS, dont have a clue how MASM can beat his own compiler by 50/1.( MASM is
50 times faster than HLA on theese _demented_ tests.

"On my 2GHz machine at work, HLA v1.x **cranks** out this <<code>> in about
7.6
seconds. MASM burns down the barn at 0.15 seconds."

- Actually Randall, its not the barn. This is a illusion, maybe a
hallusination. I thought you stopped smoking fish after christmas :-) Its
HLA, and NOT the barn.
And Randall seems to be totally lost on this one. Start using an illegal
drug I say :-)

Dr. Bee recommend : Study the RosAsm manual. All of it, but espesially
"Strategy Optimization ."

You can find it here : < http://betov.free.fr/RosAsm.html > in
RosAsmFull.zip

I'll offer to give you a hint Randal. And by God, I know _nothing_ of
compiler technology. (So for this it might indeed be that I am the one
without a clue). I could have overlooked something, in my tiredness, after
all. Cause this one seems just _too_ easy. But I take the chance anyhow.
LOSSFYTGBAM.

Do as B.e.t.h (tm) suggested.

Each time your IDE see the user typing in an equate or a symbol, parse it
and include it in the table. Dont include any equate thats not been typed.
Etc. You'll have the table ready, before the user can start typing the next
equ. If he paste them, parse them at this time. For external files, have the
tables saved with them. Save the table _per_ project, include precompiled
tables for predefined symbols, link, when written. If he deletes a page,
offset in the table. When he presses compile, your sorted table include ONLY
needed symbols and you can "parse" it in O(damnfast). Okey. I dont know for
sure, I mean, I have never read anything about it, and have not studied any
compiler source code yet.

Another clue Randall. Do _NOT_ generate _any_ symbols, when there is _NO_
code using those symbols. If I understood you post correctly, I am frankly
shocked at you level of incompetence. You "code" doesnt carry any code at
all ? Why would you think a descent assemler would start parsing symbols for
a file which contains no code ?

Generate CODE to use ALL of the symbols, from 2 - 10, and sometimes more
times, randomly spread across the code. And report new findings.

"On my 2GHz machine at work, HLA v1.x **cranks** out this **"code"** in
about 7.6
seconds. MASM burns down the barn at 0.15 seconds.". Thats 150 ms Randall.
The time it takes to execute a program in Windows.?

Original Post from Randall at Masm forum :

"
I have written (and attached) a variant of Donkey's assembler benchmarking
program.

This one generates 50,000 equates using random names and random values,
followed by 50,000 dword data declarations, each of which uses three of the
equates. Here's what a typical output file looks like for MASM
(with only 32 equates rather than 50,000):

      Code:

      .386
      .model flat, syscall
      option noscoped
      _fk_73n equ 1443525641
      _14udcdksnb00 equ 0710C1E0Bh
      w_ equ 2864601021
      u_t393h equ 744872292
      cxfra_p10bp03vs equ 0C5019000h
      up6t5c3ulxtc6_ equ 04A10C20Ch
      j_g4hrh8 equ 01C379435h
      ahi_f_e equ 2640028760
      ld7iy_3sq equ 2567429123
      kq2yxn_ equ 1135678892
      t8_g equ 091324C28h
      _qo7ruhltxsa9 equ 0614FAB48h
      pi_70kbvf3_ equ 0C895C68Ah
      e__q1iqdisefv5ks equ 3969935745
      s4m_ equ 403988474
      tiwk3iep_urbt equ 03CE1CEC0h
      r7jly_01sf_n6 equ 06C8C2A68h
      _i equ 0982610FBh
      fc1_p8zpf_3 equ 05B0260BCh
      fw5cs0j3hc8_1 equ 3734479896
      isulfwi_fyfddfc equ 09ABE0243h
      wn3__o equ 486729813
      lls6x7_sz equ 0C97036CBh
      o_tx4rzckkbcls6 equ 04683B77Ah
      n_dxahu03z0 equ 3252646726
      eix25euy_hwr equ 08CFE9053h
      uh3_rs0uh equ 060033CC6h
      ddzrwbqzk_wbqdp equ 3170338836
      _b_b9j equ 055BF196Fh
      p_26_1ma0 equ 03910B276h
      bg8pg6_tuzp5 equ 0762A640Ah
      wvkontt4x_wf2 equ 428793474

      .data
      dword _fk_73n-0560A7409h+wvkontt4x_wf2-0198EDE82h+fc1_p8zpf_3
      dword _14udcdksnb00-1896619531+bg8pg6_tuzp5-1982489610+p_26_1ma0
      dword w_-0AABE57BDh+p_26_1ma0-957395574+bg8pg6_tuzp5
      dword u_t393h-02C65D964h+_b_b9j-1438587247+w_
      dword
cxfra_p10bp03vs-3305213952+ddzrwbqzk_wbqdp-0BCF78814h+o_tx4rzckkbcls6
      dword up6t5c3ulxtc6_-1242612236+uh3_rs0uh-1610824902+kq2yxn_
      dword j_g4hrh8-473404469+eix25euy_hwr-2365493331+tiwk3iep_urbt
      dword ahi_f_e-09D5BA458h+n_dxahu03z0-0C1DF7346h+uh3_rs0uh
      dword ld7iy_3sq-09907DC03h+o_tx4rzckkbcls6-1183037306+r7jly_01sf_n6
      dword kq2yxn_-043B115ACh+lls6x7_sz-3379574475+r7jly_01sf_n6
      dword t8_g-2435992616+wn3__o-01D02E855h+tiwk3iep_urbt
      dword
_qo7ruhltxsa9-1632611144+isulfwi_fyfddfc-2596143683+ddzrwbqzk_wbqdp
      dword pi_70kbvf3_-3365258890+fw5cs0j3hc8_1-0DE97A418h+u_t393h
      dword e__q1iqdisefv5ks-0ECA06981h+fc1_p8zpf_3-1526882492+r7jly_01sf_n6
      dword s4m_-018145FFAh+_i-2552631547+pi_70kbvf3_
      dword tiwk3iep_urbt-1021431488+r7jly_01sf_n6-1821125224+u_t393h
      dword
r7jly_01sf_n6-1821125224+tiwk3iep_urbt-1021431488+ddzrwbqzk_wbqdp
      dword _i-2552631547+s4m_-018145FFAh+e__q1iqdisefv5ks
      dword fc1_p8zpf_3-1526882492+e__q1iqdisefv5ks-0ECA06981h+_qo7ruhltxsa9
      dword fw5cs0j3hc8_1-0DE97A418h+pi_70kbvf3_-3365258890+j_g4hrh8
      dword isulfwi_fyfddfc-2596143683+_qo7ruhltxsa9-1632611144+_i
      dword wn3__o-01D02E855h+t8_g-2435992616+_b_b9j
      dword lls6x7_sz-3379574475+kq2yxn_-043B115ACh+_i
      dword o_tx4rzckkbcls6-1183037306+ld7iy_3sq-09907DC03h+ddzrwbqzk_wbqdp
      dword n_dxahu03z0-0C1DF7346h+ahi_f_e-09D5BA458h+cxfra_p10bp03vs
      dword eix25euy_hwr-2365493331+j_g4hrh8-473404469+o_tx4rzckkbcls6
      dword uh3_rs0uh-1610824902+up6t5c3ulxtc6_-1242612236+fw5cs0j3hc8_1
      dword ddzrwbqzk_wbqdp-0BCF78814h+cxfra_p10bp03vs-3305213952+_b_b9j
      dword _b_b9j-1438587247+u_t393h-02C65D964h+eix25euy_hwr
      dword p_26_1ma0-957395574+w_-0AABE57BDh+tiwk3iep_urbt
      dword
bg8pg6_tuzp5-1982489610+_14udcdksnb00-1896619531+e__q1iqdisefv5ks
      dword wvkontt4x_wf2-0198EDE82h+_fk_73n-0560A7409h+isulfwi_fyfddfc
      end

The HLA test file is similar (thus far, I've only modified the program to
generate MASM and HLA outputs; modification to other assemblers *should* be
trivial as I've gone to a fair amount of pain to generalize the output
procedure -- new assemblers should only require a single procedure call).

There are a couple of things to note about this output file:

1. All labels generated are unique (I use the HLA tables facility to ensure
this).
2. There are never any reserved word conflicts (that I am aware of) because
I always inject at least one underscore at a random location in the
identifier (I don't know of any assemblers that have reserved words
containing underscores, this could be a problem if such assemblers exist).
3. I randomly select hexadecimal or decimal numbering bases.
4. For the data declarations, I always emit three labels per declaration.
For the ith declaration (given a total of n symbols/declarations), I always
reference symbol i, symbol (n-i-1), and a random symbol. The calculations
are such that the result of the expression is always the value of the
randomly selected label (that is, I explicitly subtract the value of the
first two symbols in the expression).

On my 2GHz machine at work, HLA v1.x cranks out this code in about 7.6
seconds. MASM burns down the barn at 0.15 seconds. With the hash table size
set to 200,000 symbols, TASM32 v5.3 does the job in 1.1 seconds. This is
with 50,000 symbols. Every time I run a test like this, it completely blows
me away how fast MASM does the job. MASM has some *very* good symbol table
management routines. At some point, it would be interesting to find out
exactly what it is in MASM that results in its less than blinding speed for
complex source files.

Cheers,
Randy Hyde
"



Relevant Pages

  • Re: Warning on copies of Iczelions tutorials
    ... When i built and collected the equates for the former Spasm, ... About masm 32 package, i didn´t needed to use any equate inside the ... For now we will finish a important work related to the Libraries (.lib ... for the assembler, but also for the disassembler, for the ApiViewer, ...
    (alt.lang.asm)
  • ///Re: Explanation of a swindling
    ... When RosAsm ... Set aside 1.5 MB of storage for the equates ... He had no real life Applications written with MASM ... limited to using RosAsm's feature set for those other assemblers; ...
    (alt.lang.asm)
  • Re: HLA v2.x and / or LASM suggestion: Win32 Resources
    ... process in _seconds_ and then assembled it with MASM. ... Clearly the equates.equ file is processed specially by RosAsm. ... it requires special syntax to handle those equates and I wouldn't ... MASM *doesn't* require more than a few seconds to assemble most files. ...
    (alt.lang.asm)
  • Re: RosAsm is a broken pile of crap
    ... > Note that MASM requires a Declaration. ... also do Equates Declarations with RosAsm: ... Just don't try and take the RosAsm win32 equate file and try to ... Advanced programmers can't take the risk. ...
    (alt.lang.asm)
  • Re: HLA v2.x and / or LASM suggestion: Win32 Resources
    ... you so powerfull tool with more than 53,000 Win32 Equates included ... called cannot do the big stuff that MASM routinely does, ... list and I will make you a MASM DLL that will handle equate enquiries ... at somewhere over 120 meg a second throughput. ...
    (alt.lang.asm)