The MASM Forum

Miscellaneous => The Orphanage => Topic started by: Raistlin on February 18, 2019, 05:35:16 AM

Title: Real APPS real fast with MASM
Post by: Raistlin on February 18, 2019, 05:35:16 AM
So I did ask the hutch-ism and I believe,
this might be the place for it. Writing
absolutely PURE assembler always for
things others say are impossible or very
implausible. Thus always assembler from
start to finish. The idea is to encourage
style, best practice, anal retentiveness
and obviously the spectacular results. 😈 
I will endeavour to lead by example but
will most probably be overtaken by more
supposedly insane people like me....... 
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 18, 2019, 05:57:19 AM
Yeah, sounds good :P

Just for curiosity: Are there people out there who have major sources (>10,000 lines) written entirely in assembly?
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 18, 2019, 06:12:48 AM
LOL. jj2007 - dude, obviously me and you and hutch and siekmanski and daydreamer and aw and sinsi and most of the old school guys, the list is thankfully still long; changing  their avatars and names are not going to change coding style. To them: You guys do know your code and personality are one  But anyhow let's see where this leads. REAL code and real results. The moto.
CRAP: jj2007 I hate you (not truely) right now, soooooo
And to continue..for people that have written more than 10k... biterider, NAN, rrr, fhilpe, vortex, bogadan-something, raymond... eish need alcohol now. Dude really ?
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 18, 2019, 06:44:44 AM
Yes, the list is still long; the usual suspects. DednDave, MichaelW, FORTRANS, Guga come to my mind. I wonder if anybody who has a major source did not become a member here. Maybe in the NASM & FASM communities, but I doubt it.
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 18, 2019, 06:49:53 AM
But that all does present an interesting idea. Major apps in less than 10k lines anyone?  :icon_rolleyes: Just had to ask. 
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 18, 2019, 08:02:55 AM
Check this one: http://masm32.com/board/index.php?topic=6953.msg74716#msg74716
Title: Re: Real APPS real fast with MASM
Post by: guga on February 18, 2019, 08:16:05 AM
Raistlin, what do you mean with "Major apps" ?

There are several apps made with assembly that you may consider "major' written with less then 10 k lines such as some examples on the old fellows of demoscene who writes amazing demos with less then 10 kb. https://www.assembly.org/summer18/demoscene .


I don´t know exactly how many "lines" of actual code (not counting the comments) we did in RosAsm the past decade, but...it contains something around 36322 code labels, 9176 data labels, source size = 5163423 bytes, total amount of code instructions = 153420. RosAsm was written completelly in assembly language since the early beginning when it was called SpAsm where the original author (René Tournois) made it also in pure assembly.

14 years ago, Martin, a former RosAsm user made an very good app called "Nessie", a Nintendo - NES Emulator entirely with RosAsm with something around 3000 lines of code without using one single embedded library as well. GGes also has made pretty good games (Arcade stylish) with few lines of code and the list goes on.

And there are the guys who also writes video plugins using assembly for VirtualDub or even Sony Vegas, for example.

JJ made an amazing work with his MasmBasic and RichMasm as well. Hutch also has made a increadible work with masm etc etc. As JJ said, there are still the people on Fasm and Nasm community, not to mention Jeremy Gordon with GoAsm, Bondgan Ontanu the author of SunOS and Hostile Encounters (In 2002), dedndave, the guys at Test Department and even Iczelion as well who pushed the asm community almost 20 years ago.

Siekmanski also do a wonderfull work on code optimizations (A master on that field, IMHO).

I believe this encouragement you said is what we all here are doing since a loooong time :icon_mrgreen: We are old dogs, you know :icon_mrgreen: :icon_mrgreen:
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 18, 2019, 08:35:41 AM
Hi Guga, is René still around? On the net you can find this: https://news.ycombinator.com/item?id=14932935
Title: Re: Real APPS real fast with MASM
Post by: guga on February 18, 2019, 08:44:41 AM
WOW. Nice finding JJ :t :t :t

René has retired a long time ago. The last time i talked to him was in 2008/2009 if i remember well, then i continued with RosAsm trying to updated it from time to time.

I wonder how is he doing today. Just hope he is fine. He was a good friend.
Title: Re: Real APPS real fast with MASM
Post by: HSE on February 18, 2019, 12:51:49 PM
But that all does present an interesting idea. Major apps in less than 10k lines anyone?  :icon_rolleyes: Just had to ask.
1- Have you a counter?
2 - If you have a library used in different projects: how you count that?
3 - If you have an extremely conditional code: what do you do?
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 18, 2019, 05:19:01 PM
Sorry for the delayed response - GMT+2 over here (needed sleep)  ;)

@HSE+guga: Ok, a bit of explaining. Going on to the major informative forums (Quora, scribd, tutorialspoint, wiki etc.)
you'll find assembler is discouraged for any "serious" work. It's all so much easier, faster (development time) and maintainable
in a high-level language. Then also why put yourself through hell - when the compiler does such a "brilliant" job at optimizing
your code. The same holds true from the IT academia I regularly rub shoulders with - never to mind they haven't written a
line of code in years. "We all know assembly language, is the programming language of last resort and only in special
circumstance, mostly only good for inline optimization, if anything" <--- This all gets my noodle  :icon_confused:

I might not have expressed myself well. jj2007 introduced the 10K lines concept, to his auspicious mind, I suspect (ca'nt speak for the man)
the benchmark of large ASM projects. I got pulled in and well... apologies for the misdirection. Now to try and salvage the questions posed.
Although this was never the intention, I must have contracted foot in proverbial mouth syndrome. :icon_rolleyes:
1) Have you a counter ?: Lines of source code can be calculated using COCOMO or Function Points. Only non-automated code,
thus source lines of code (SLOC) should be counted when planning/scheduling/costing a software development. The rule of thumb is to use
thousands of lines of source code (KLOC) as input into the various algorithms.
2) If you have a library used in different projects: how you count that?: they do count, but are normally seen as value-added
code, that promotes re-usability. If you wrote it yourself that is. Calling system/utility type libs only counts the actual effort to write the API interaction.
3) If you have an extremely conditional code: what do you do? : Not sure I understand the question, sorry, could you rephrase ?

PPS: Thanks for the demo-scene links reminder, it's what got me into asm in the first place (1986). I can spend hours watching these over and over again.
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 18, 2019, 07:36:47 PM
jj2007 introduced the 10K lines concept, to his auspicious mind, I suspect (ca'nt speak for the man) the benchmark of large ASM projects.

Any measure of "large" or "serious" projects is at best a proxy. Counting the lines of a source that you've written yourself (i.e. not counting the lines of the include files of the Masm32 SDK, for example) is very easy, your editor displays it for you. And in the case of assembly: one line = one instruction, so it's a reasonable proxy for the volume, complexity, whatever of the executable.

Now the question arises of course, where does "large" or "serious" start? Let's have a look at "big" \Masm32\Examples:
Code: [Select]
1,100 \Masm32\examples\exampl04\jacts\jacts.asm
  945 \Masm32\examples\exampl04\listview\listview.asm
  630 \Masm32\examples\exampl01\qikpad\qikpad.asm

But these are still "examples", not months or years of coding efforts to produce a major application.

What's your opinion on this? Where does a "major", where does a "serious" assembly application start?
Title: Re: Real APPS real fast with MASM
Post by: daydreamer on February 19, 2019, 03:35:11 AM
Raistlin, I am trying my best to make a great app,why do you think my tiny programs are mostly 3k+?
one of my goal is 1k or 4k or 64k demo one day

suggestions are welcome howto use the remaining 1k+,from less than 3072bytes to 4096bytes
Title: Re: Real APPS real fast with MASM
Post by: HSE on February 19, 2019, 04:14:20 AM
No problem Raistlin. I think you was pondering some stats to take the world  :biggrin:

I used Cocomo almost 20 years ago. It's usefull in self evaluation of a project (asm or not). Specifically in asm, comparing different projects and programmers is misleading, I think. To make that kind of thing you need a more complex method.

Thanks.
Title: Re: Real APPS real fast with MASM
Post by: AW on February 19, 2019, 07:36:23 PM
Real programmersTM can do up to 250 keystrokes per minute.
Assuming an average 40 characters per line, to allow for line breaks and white space lines to count as full lines, Real programmersTM can produce 10000 lines of code in a couple of days maximum (yes, they need to sleep well, have relaxed meals and have some time for fun. After all Real programmersTM are also humans).
PS: Of course, Real programmersTM don't produce bugs, so no need to reserve more time.

Title: Re: Real APPS real fast with MASM
Post by: hutch-- on February 19, 2019, 09:13:53 PM
I remember long ago an application called QMODEM that was a reasonable app written in C then after a couple of years they released a pure ASM version that was a lot smaller, a lot faster and had a better feature set. I do see the wisdom of show casing high quality assembler applications but it is not without its problems. As I explained to Rudi, make it an open forum and it will end up full of chyte, make it a closed forum and anyone who cannot post their latest whatever will be nose out of joint.

Also long ago in the 1990s, I went out of my way to rub the noses of the then "superior" C brigade in their own garbage with what was then the 6k text editor called "TheGun" and at the time it did the job. To realise a similar task means producing application of a similar ratio of size to conventional apps that have the power, speed and size that has advantages in all of the categories.

I have no doubt that such apps can be done but I don't know of a non problematic way of showcasing such examples and to showcase them, they would have to be very good.
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 20, 2019, 05:50:13 AM
Oh lordy lord, I really did think that prod/joke was old by now AW27. My own opinion about REAL not so tm... was actual thinking processes applied, plus modularity and repeat-ability for the next project in code generation. ASM to my own fract-up opinion (copyright BattleStar series) might need some of it for the new upcoming generation OR there won't be any. Your ideas appreciated dude.
Title: Re: Real APPS real fast with MASM
Post by: TimoVJL on February 20, 2019, 07:12:14 AM
And if only line counts are important, a not so real programmer can make a program to generate useless code lines.
And then only a harddisk is a limit for that.
Even M$ made a some wizards to generate a not so important code :P
Also using some static libraries and useless bitmaps can help to make application bigger, as many C++ users already knows :P
As we know, bigger is better just in p.. films :P
Title: Re: Real APPS real fast with MASM
Post by: AW on February 20, 2019, 08:09:26 AM
The 21 Foolproof Ways To Look Busy At Work (https://www.buzzfeed.com/matwhitehead/helen-is-all-of-us) and telling everyone that is doing another 10000 lines of ASM code when he just copied it from the MASM32 forum always guarantees a promotion.
Title: Re: Real APPS real fast with MASM
Post by: LiaoMi on February 20, 2019, 10:23:38 AM
The 21 Foolproof Ways To Look Busy At Work (https://www.buzzfeed.com/matwhitehead/helen-is-all-of-us) and telling everyone that is doing another 10000 lines of ASM code when he just copied it from the MASM32 forum always guarantees a promotion.

18. Always poop at work.  :bgrin:
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 20, 2019, 04:07:04 PM
@hutch--:
Code: [Select]
As I explained to Rudi, make it an open forum and it will end up full of chyteI should have listened  :icon_redface: A number of idioms come to mind.....
All the best laid plans of mice and men. Don't count your chickens before they hatch.
All intentions but the devil's intentions are good. Listen to your elders, betters and all that.
And then finally: There comes a time to choose to turn the page or close the book.
Title: Re: Real APPS real fast with MASM
Post by: hutch-- on February 20, 2019, 05:47:17 PM
 :biggrin:

Damn, and I just posted my entry into the hall of infamy.  :P
Title: Re: Real APPS real fast with MASM
Post by: K_F on February 22, 2019, 06:08:51 AM
Just for curiosity: Are there people out there who have major sources (>10,000 lines) written entirely in assembly?
Yup... I'm around 15K and counting. I'm only about halfway... I think ;)
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 22, 2019, 06:14:39 AM
15k is quite big, what kind of program is that?
Title: Re: Real APPS real fast with MASM
Post by: nidud on February 22, 2019, 06:40:34 AM
 :biggrin:

strtok (https://github.com/nidud/asmc/blob/master/source/test/strtok/strtok.asm) -r \Asmc\*.asm
Code: [Select]
File(s):   *.asm
Directory: D:\Asmc

Total 5292 file(s), 563227 line(s)

 58326 mov
 18807 db
 18077 equ
 11770 .if
 11290 add
 11269 .endif
  8920 proto
  8541 movaps
  7623 typedef
  7379 ret
  6845 call
  6690 include
  5923 lea
  5496 dd
  5261 xor
  5138 proc
  5036 movdqa
  4814 and
  4693 endp
  4554 or
  4222 push
  3879 sub
  3666 .code
  3634 .case
  3572 cmp
  3493 label
  3344 end
  3337 invoke
  3273 dq
  3222 inc
  3213 jmp
  3169 nop
  3154 pop
  3139 local
  2939 dw
  2767 .break
  2663 test
  2086 dec
  2049 .endc
  1991 .else
  1826 jz
  1758 .data
  1663 not
  1628 endif
  1512 .repeat
  1459 je
  1458 option
  1371 jnz
  1347 shl
  1339 .while
  1333 .endw
  1326 movzx
  1286 in
  1218 if
  1147 shr
  1063 extern
  1053 public
  1048 .until
   980 adc
   936 ends
   935 ifdef
   864 for
   788 jne
   726 imul
   726 .elseif
   723 externdef
   698 .endsw
   681 jb
   677 movss
   659 .switch
   654 macro
   646 endm
   ...

strtok (https://github.com/nidud/asmc/blob/master/source/test/strtok/strtok.asm) \Asmc\include\*.inc
Code: [Select]
File(s):   *.inc
Directory: D:\Asmc\include

Total 326 file(s), 234071 line(s)

 51820 equ
 16332 proc
 12280 proto
  8438 endif
  7998 typedef
  5361 dd
  4055 ifndef
  3964 macro
  3963 endm
  2818 externdef
  1988 if
  1957 else
  1926 ifdef
  1382 .ends
  1367 .comdef
  1108 dw
   818 include
   792 db
   402 .pragma
   364 or
   340 mov
   225 and
   192 for
   148 shl
   145 name
   137 not
   133 dq
   116 ends
   101 in
    98 int
    94 .err
    59 union
    56 option
    55 shr
    50 struct
    48 assume
    47 undef
    45 add
    44 push
    42 pop
    41 xor
    37 .if
    35 includelib
    35 .endif
    32 ifnb
    31 exitm
    30 lock
    29 movq
    26 inc
    23 page
    22 ifdif
    22 movaps
    21 elseif
    19 elseifidn
    18 local
    18 movd
    16 label
    15 .else
    14 sub
    14 struc
    14 lea
    13 elseifdef
    13 .classdef
    13 .case
    13 movzx
    12 ucomiss
    12 cmp
    11 cvtpi2ps
    10 align
    10 movapd
    10 dec
     9 .code
     9 pxor
     8 .data
     8 ucomisd
     8 ifidn
     8 movss
   ...
Title: Re: Real APPS real fast with MASM
Post by: Raistlin on February 23, 2019, 06:10:07 AM
This mouse is checking out per uber (great) advise.
Don't count your chickens before they hutch.
I really had good intentions about this topic,
but the devil in the detail got to me. Perhaps
this chapter of the thought is better served by
tearing the proverbial page from memory ?
Thanks for your input all,
Raistlin 
Title: Re: Real APPS real fast with MASM
Post by: K_F on February 23, 2019, 06:24:39 AM
15k is quite big, what kind of program is that?
Top secret you know  :icon_mrgreen:
It's the Mother of all Number Crunchers where you cook up your own functions..etc - whatever 'tickles your fancy'.
So far it works only on the FPU, but will be extended to the other numerical processes as well as GPU, once I have everything in place.
 ;)

The funny thing about the code.. is that it's 'blitz-vinnig'.. lightning fast, even with the data file loads, saves..etc.
Title: Re: Real APPS real fast with MASM
Post by: daydreamer on February 23, 2019, 11:53:48 PM
15k is quite big, what kind of program is that?
Top secret you know  :icon_mrgreen:
It's the Mother of all Number Crunchers where you cook up your own functions..etc - whatever 'tickles your fancy'.
So far it works only on the FPU, but will be extended to the other numerical processes as well as GPU, once I have everything in place.
 ;)

The funny thing about the code.. is that it's 'blitz-vinnig'.. lightning fast, even with the data file loads, saves..etc.
aha the program that solves the question of life,everything =42 like in Hitchhikers Guide to galaxy :greenclp:
Title: Re: Real APPS real fast with MASM
Post by: K_F on February 24, 2019, 05:34:01 AM
aha the program that solves the question of life,everything =42 like in Hitchhikers Guide to galaxy :greenclp:
Silly me, Forgot to add that.. :icon_mrgreen:
Actually... Yes, it does solve the question of life  :badgrin:
Title: Re: Real APPS real fast with MASM
Post by: jj2007 on February 24, 2019, 09:30:29 AM
It's the Mother of all Number Crunchers where you cook up your own functions..etc - whatever 'tickles your fancy'.
:t
Title: Re: Real APPS real fast with MASM
Post by: HSE on February 24, 2019, 12:37:42 PM
I builded nidud's strtok in 32 bit, but without commandline and don't show instructions (I don't know why not).

Without libraries the count (files and lines) in IntegAsm app (a tool for modelling and simulation) is:
        asm    37      3692
        inc     74     26922
and my common libraries:
        asm   21        5463
        inc    107     40570

Because the strong conditional assembling, it's not possible to say with this tool how many files and lines are used in an specific building, for sure not even a half.