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
Quote from: 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.
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
Quote from: Raistlin on February 18, 2019, 05:19:01 PMjj2007 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:
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: aw27 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: aw27 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
Quote from: 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.

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--:As I explained to Rudi, make it an open forum and it will end up full of chyte
I 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
Quote from: jj2007 on February 18, 2019, 05:57:19 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
deleted
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
Quote from: jj2007 on February 22, 2019, 06:14: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
Quote from: K_F on February 23, 2019, 06:24:39 AM
Quote from: jj2007 on February 22, 2019, 06:14: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.
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
Quote from: daydreamer on February 23, 2019, 11:53:48 PM
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
Quote from: K_F on February 23, 2019, 06:24:39 AMIt'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.