News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

I really hate when....

Started by LordAdef, October 29, 2018, 05:03:51 PM

Previous topic - Next topic

aw27

Because very few people code in ASM these days, most of them are in this forum, in my opinion the best advantage of being proficient in ASM is having the full arsenal to be able to debug a program produced in a high-level language. Many bugs are simply impossible to be spotted otherwise.

daydreamer

Quote from: LordAdef on October 30, 2018, 06:03:35 AM
Quote from: felipe on October 30, 2018, 05:13:24 AM
Quote from: LordAdef on October 30, 2018, 03:57:12 AM

There is no reason to code in asm if you don't target for speed, right?

Actually that's not right... ;)


Well, you are right! Asm is a beautiful language apart from what I meant.
The combination of make it faster and smaller you can enjoy make old-school 1k,4k,64k demo,I mean before pixelshaders took over demoscene
Maybe some employer or teacher force you to code in another language,thinking in asm+using for example C low-level stuff you have advantage of how to make faster and better code
I think if you endup programming embedded with slower hardware it's good to know assembly,I think there was one great asm coder that made a 3d game on a very slow 180mhz risc cpu on a handheld device
TI calculator Scroll the screen was only possible with my Asm skill

@Steve,how did you do x30 speed? Unrolled loop 30 times?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

FORTRANS

Hi,

Quote from: daydreamer on October 31, 2018, 05:50:18 AM
@Steve,how did you do x30 speed? Unrolled loop 30 times?

   No, it looks like I did as many things as I could think of.  I did
unroll a loop, but only two (or four?) times.  The LOOP instruction
only allows a jump of about 120 some bytes and the code in
the loop was not short.

   Here are the results from the majority of the testing computers.

200LX, 80186 16MHz, MS-DOS 5.0, ~2.2x
+1.96816912E+000 Iterations per second.  PSEUDO5T, mains, A.O.T. battery
+4.35200000E+000 Iterations per second.  PSEUDO7

Pentium 90, WD 90C33, DOS, ~5.0x
+2.49228395E+001 Iterations per second.  PSEUDO5T
+1.24106907E+002 Iterations per second.  PSEUDO7

Pentium III 800, Matrox G400, OS/2 VDM, ~17.2
+3.87951807E+001 Iterations per second.  PSEUDO5T
+6.68239356E+002 Iterations per second.  PSEUDO7

Pentium III 800, Matrox G400, W2k
+2.34104046E+001 Iterations per second.  PSEUDO5T
+3.79800853E+001 Iterations per second.  PSEUDO5T
+4.43276284E+002 Iterations per second.  PSEUDO7
+6.39156627E+002 Iterations per second.  PSEUDO7

AMD 64 @ 2 GHz, WinXP, ~31.5x
+4.21271764E+001 Iterations per second.  PSEUDO5T
+1.32561728E+003 Iterations per second.  PSEUDO7


   PSEUDO5 (the fifth version of the program) was modified
to show timing statistics, PSEUDO5T.  PSEUDO7 was the
version I was trying to optimize.

   A big thing for all but the 80186 was to move the working
buffers out of video memory to main memory.  Here are the
comments made at the time.

PSEUDO7 30 March 2006, test an idea prompted by Abrash
book on optimization.
3 April 2006, timing tests show that not reading and writing to
video RAM can significantly speed things up on some machines.
(But not the 200LX.) What I did was change from four reads
from video RAM and one write to video RAM, to one read video
RAM, one write to video RAM, and four conventional memory
read and writes.
4 April 2006, the read from video RAM can be avoided if I swap
work areas in conventional memory from one frame to the next.


   Changing from 8-bit memory reads and registers to more complex
16-bit code helped.  I aligned code entry points and data access to
word values.  I got rid of a PUSHF / POPF that saved the flags when
calculating something inside a loop.  INC, DEC, and LOOP do not
affect the carry flag.  I replaced some MOVs with XCHG.  And I
replaced discrete MOV, INC, LOOP code with a REP MOVSW in a
copy routine.  And probably some other stuff.  (Old code, bad
memory.)

Cheers,

Steve N.

daydreamer

Quote from: FORTRANS on October 31, 2018, 07:44:05 AM
Hi,

Quote from: daydreamer on October 31, 2018, 05:50:18 AM
@Steve,how did you do x30 speed? Unrolled loop 30 times?

   No, it looks like I did as many things as I could think of.  I did
unroll a loop, but only two (or four?) times.  The LOOP instruction
only allows a jump of about 120 some bytes and the code in
the loop was not short.

   Here are the results from the majority of the testing computers.

200LX, 80186 16MHz, MS-DOS 5.0, ~2.2x
+1.96816912E+000 Iterations per second.  PSEUDO5T, mains, A.O.T. battery
+4.35200000E+000 Iterations per second.  PSEUDO7

Pentium 90, WD 90C33, DOS, ~5.0x
+2.49228395E+001 Iterations per second.  PSEUDO5T
+1.24106907E+002 Iterations per second.  PSEUDO7

Pentium III 800, Matrox G400, OS/2 VDM, ~17.2
+3.87951807E+001 Iterations per second.  PSEUDO5T
+6.68239356E+002 Iterations per second.  PSEUDO7

Pentium III 800, Matrox G400, W2k
+2.34104046E+001 Iterations per second.  PSEUDO5T
+3.79800853E+001 Iterations per second.  PSEUDO5T
+4.43276284E+002 Iterations per second.  PSEUDO7
+6.39156627E+002 Iterations per second.  PSEUDO7

AMD 64 @ 2 GHz, WinXP, ~31.5x
+4.21271764E+001 Iterations per second.  PSEUDO5T
+1.32561728E+003 Iterations per second.  PSEUDO7


   PSEUDO5 (the fifth version of the program) was modified
to show timing statistics, PSEUDO5T.  PSEUDO7 was the
version I was trying to optimize.

   A big thing for all but the 80186 was to move the working
buffers out of video memory to main memory.  Here are the
comments made at the time.

PSEUDO7 30 March 2006, test an idea prompted by Abrash
book on optimization.
3 April 2006, timing tests show that not reading and writing to
video RAM can significantly speed things up on some machines.
(But not the 200LX.) What I did was change from four reads
from video RAM and one write to video RAM, to one read video
RAM, one write to video RAM, and four conventional memory
read and writes.
4 April 2006, the read from video RAM can be avoided if I swap
work areas in conventional memory from one frame to the next.


   Changing from 8-bit memory reads and registers to more complex
16-bit code helped.  I aligned code entry points and data access to
word values.  I got rid of a PUSHF / POPF that saved the flags when
calculating something inside a loop.  INC, DEC, and LOOP do not
affect the carry flag.  I replaced some MOVs with XCHG.  And I
replaced discrete MOV, INC, LOOP code with a REP MOVSW in a
copy routine.  And probably some other stuff.  (Old code, bad
memory.)

Cheers,

Steve N.
I think agp and pcie bridge to vram is optimised to be one way highway ram->vram,so cpu render graphics should be on system ram backbuffer,because reading vram can be 100 times slower,I think that's the reason you achieve 30x faster is your change from vram to system ram
The 186 is pre agp/pcie era, either built in or older pci card graphics maybe unrolling and moving from 8bit to 16bit MOVs make it faster
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

FORTRANS

Quote from: daydreamer on November 01, 2018, 04:12:33 AM
I think agp and pcie bridge to vram is optimised to be one way highway ram->vram,so cpu render graphics should be on system ram backbuffer,because reading vram can be 100 times slower,I think that's the reason you achieve 30x faster is your change from vram to system ram

   Yes, the majority of the speedup on that machine (and the
other non-80186 computers) was from moving the working
buffers out of the video memory.  That was from the Abrash
suggestion that started the whole process.  However which
changes caused how much improvement was not recorded
for anything except the target machine.  Well to a lessor degree
for the development systems.

QuoteThe 186 is pre agp/pcie era, either built in or older pci card graphics maybe unrolling and moving from 8bit to 16bit MOVs make it faster

   Yes the 200LX has built in CGA video.  And moving the working
buffers to main memory had a rather small positive effect.  Those
changes were kept mainly because they did no harm to the 200LX
and helped all of the other computers.

   Unrolling and the shift from 8-bit to 16-bit code helped, along
with alignment changes.  However the biggest gains were from
changing MOVs to their string equivalents, LODS, STOS, and
MOVS, and using REP to replace LOOP.

Regards,

Steve N.

P.S.  For laughs only!

22-05-03  12:17p                 1,164 PSEUDO5.COM
22-05-03  12:12p                 2,015 PSEUDO5T.COM
12-05-06  02:35p                34,694 PSEUDO7.COM


SRN

avcaballero

I want to join to the congrats for Bolsonaro's victory. :t

> The ideological bias of Nazism is based on what ideology? Fascism of Italy?

Nowadays it seems that nobody knows that Nazism was the National sozialismus party.


jj2007

Quote from: caballero on November 03, 2018, 05:44:47 AMNowadays it seems that nobody knows that Nazism was the National sozialismus party.

I am German, I know that very well. It was just a name; this "socialist" party killed numerous real socialists and communists, inter alia 96 members of parliament. Of course, negligible victim numbers compared to the roughly 6 Million jews killed, or the 20 Million Russians who died indirectly from Hitler's reign.

Btw it all started with hate speech, just as with Bolsonaro, Trump, Salvini, Le Pen, Wilders, Duterte and a few others. And just like 80 years ago, there are again many people, even intelligent persons, who shout hooray when these figures attack the weak, like immigrants, homosexuals, Sinti, women, etc. :icon13:

LordAdef

Funny enough...

...in his winning speech he used many times the expression "libertar" this, "libertar" that... (libertar = to free)

... In my mind I couldn't help but connect it  to "Arbeit macht Frei"....

... he probably doesn't even know the above line and its meaning, and probably meant something else... but I found this weird, and it should have been avoided.

Siekmanski

Maybe it's time for Anarchy in the real meaning of the word. ( old greek ἀναρχία (anarchia), - no authority/ruler )
Our rulers ( governments, banks, multinationals, monarchs and religious rulers ) create only chaos and steal our freedom and money.

Democracy is dead, only Johnny Rotten can save the world.  ;)
Creative coders use backward thinking techniques as a strategy.

hutch--

The political distinctions are interesting ones here, while Mussolini was a true fascist, nazism was a different phenomenon in that it was a nationalistic/jingoist version of corporate control of government, rigid control of the population and grand ambitions in terms of other country's assets. The atrocities against the European Jewish population began with Hitler's tome and was seriously fuelled by withdrawal of money in 1929 from Germany that left people starving in the streets.

The sanctions in 1936 onwards was again blamed on the American Jewish communities and was used by the nazis to justify the asset stripping and later genocide against any of the Jewish community in any country that they occupied.

The sad fact is that history does repeat itself, corporate control of governments in the western countries, military "adventures" to gain control of assets in the middle east and direct abuse of corporate media to flog propaganda in a way that would have made Doctor Goebbels proud.

Don McLean : Everybody Loves Me, Baby
https://www.youtube.com/watch?v=XG6SCDUiFZs

aw27

The word fascist worn out and has become weak to insult, so communists and other marxist variations are exploring the word nazi to its limits. Trump is nazi, Le Pen is nazi, Bolsonaro is nazi, that's it.

Gee, these guys dislike gays, gypsies and muslims because they said this and that, this is so bad! Everybody is expected to like gays, gypsies and muslims. It is so normal to love those minorities!
It would be much better to live in a country with extreme unemployment, hunger and 200 murders a day governed by corrupts like Brazil has been lately than tolerate guys that dislike gays, gypsies and muslims.  :icon_rolleyes:

jj2007

So I've been promoted to the "communists and other marxist variations" category now. Years ago, in a conference, somebody called me a "neoliberal", and I was amused, too. Fortunately, I've learned not to feel insulted by such name calling :P

Quote from: hutch-- on November 03, 2018, 01:27:03 PMThe sad fact is that history does repeat itself, corporate control of governments in the western countries, military "adventures" to gain control of assets in the middle east and direct abuse of corporate media to flog propaganda in a way that would have made Doctor Goebbels proud.

Right. It's perfectly ok if Trump sells arms ("letters of intent for the Kingdom of Saudi Arabia to purchase arms from the United States totaling US$110 billion immediately, and $350 billion over 10 years") that are being used, inter alia, to kill Millions in Yemen, because yeah :t, that means jobs for "America first". But if a line of ragged poor people approach the U.S. border, they are "terrorists from the Middle East". We are living in interesting times, folks, and I wish Brazil luck with Bolsonaro. Some of you deserve him, but the great majority of Brazilians are just innocent victims of evil but clever propaganda.

daydreamer

me and a friend felt we must do the right thing when we where on a playground when I was on vacation when I was a kid,we must defend the tiny german kid that got harrassed because of what Nazi's did long Before he was borned

if it starts a war,would you really have what it takes to take the lives of your international friends,recognizing their faces or knowing they are i the trenches opposite side because your General order you to kill germans,dutch,ozzies,spanish,brazil,Russian etc people?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

avcaballero

Sad history, daydreamer

I think that the main problem is that live usually tends to be dominated by some faction of people that impose their criteria over the rest, that obligate to more and more people to search another positions that finally become the new dominating faction.

Being the biggest agreement on most things the optimal solution, what we can understand by democracy, is not the most usual.

Life is chaotic... maybe it would not be authentic life otherwise.

aw27

As an European I dislike Trump - he hates Europe even more than his predecessors.
However, I believe Trump is doing a good job for the Americans, at least much better than the Kenyan-born-with-a-forged-birth-certificate-from-Hawaii guy did.
- Trump was able to tame that fat wild guy of North Korea.
- He is doing a lot to improve relationship with Russia. This is a mammoth task given that the American people DNA is set to make them behave as if communists are still out there, so they are obliged to hate Russia forever.
- For the first time, a president in the US dared to defy China unfair trade practices.
- And I firmly believe that he will tame as well the Iranian regimen, let's give him time.

Now, talking about arms sales to Saudi Arabia - this has nothing to do with Trump. It has been since long the best US business outside their borders.
And the US has the right to protect their borders from more Latino people migration. There are already lots of poverty in the US which needs to be fixed first.