News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Sol_Asm version 0.33.02

Started by BogdanOntanu, October 24, 2009, 04:26:51 PM

Previous topic - Next topic

BogdanOntanu

Quote from: Vortex on October 25, 2009, 04:54:05 PM
Physicist Richard Feynman's quote :
"What I cannot create, I do not understand."

SO very true ... I completely agree.

With one addition of course  :toothy :  Create as much as possible from scratch ;).

Again a "side note" :
===============
For example you will learn something but not really much about computer design by using prefabricated kits and components in building your own computer. Or you can create your car from spare parts and kits but unless you create your own engine and/or parts you will not learn seriously about mechanics.

In the same way the "reuse of code" and "learning by copy and paste" is much less usefully than a full creation from scratch.

Of course some primitives must be learned by small simple examples and this is where teaching has it's glory ... but as soon as you are capable to fly on your own... spread your wings and "re-invent the wheel" for as many times as it takes. Invent small simple tests in level with your expertise in order to understand and learn new concepts. Always seek concepts first and implementations later.

Then compare your creation it with other prefabricated or available "wheels/code"... Test and compare in a "loop" and improve your design/implementation.

This way you will learn a lot more than by simply accepting the predefined "library of wheels designs". Your neuronal paths will improve and in time you will become able to design and improve almost anything and you will not even "know" how you did it ;)

Keep accepting code re-usability myths and use or copy paste in order to reach your target faster and easier and in time you will not evolve at all or become just another good "robot worker" but nothing more ...

You are truly "over" something only once you have created it from scratch... Now ... where did I put that FPGA kit for creating my own CPU before I die ?  :cheekygreen:
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

BogdanOntanu

BTW, a new version of Sol_Asm is avaialble here:
http://www.oby.ro/sol_asm/files/sol_asm_2009_10_25_v33_04.zip

It fixes a critical bug found by Vortex in structure initializations code and a minor bug in #store directive.
The manual for version 0.33.02 is still valid
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

mitchi

I completely agree with you Bogdan.

I'll add that the best thing you can do to improve your programming projects is to work hard on your skills as a programmer. All the development methodologies in the world (Agile programming and the rest) cannot give you the confidence and the experience you get by learning things from scratch.

I am personally not at the level I want to be yet but I'm taking the work-hard no-surprises path and it's giving results.

hutch--

 :bg

Its probably a language/humour difference, the "monster" here is not the image of evil but a capacity so powerful that it puts the fear of God into lessor competitors. The idea of a "Vlad Tepes" version is an image of an all powerful conqurering version that leaves the opposition in awe of its power.

I must confess though, I have been a fan of good vampire movies all my life. Some are very poor but the good ones have a good feel to them. Parts of Romania have very interesting torrain which I find very interesting. My favourite version of Dracula is the Francis Ford Cupola version made in the early 1990s with Gary Oldman.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

japheth

Quote from: hutch-- on October 25, 2009, 11:33:07 PM
... but a capacity so powerful that it puts the fear of God into lessor competitors. The idea of a "Vlad Tepes" version is an image of an all powerful conqurering version that leaves the opposition in awe of its power.

Yes, may be ... in 2020.  :bg

I downloaded the recent version and tried one or two things:


; minimal test file

section "code" class_code

.entry _start

_start:
.if eax != 1 || ( ecx == 2 && ebx == 4 ) || ( esi > 1 && edi < 2 )
mov edx,3
.endif

nop
ret


The good thing is: it works.  :U

The bad thing is hidden and requires a disassembly:

_start:
  00000000: 83 F8 01           cmp         eax,1
  00000003: 0F 85 24 00 00 00  jne         0000002D
  00000009: 83 F9 02           cmp         ecx,2
  0000000C: 0F 85 09 00 00 00  jne         0000001B
  00000012: 83 FB 04           cmp         ebx,4
  00000015: 0F 84 12 00 00 00  je          0000002D
  0000001B: 83 FE 01           cmp         esi,1
  0000001E: 0F 86 0E 00 00 00  jbe         00000032
  00000024: 83 FF 02           cmp         edi,2
  00000027: 0F 83 05 00 00 00  jae         00000032
  0000002D: BA 03 00 00 00     mov         edx,3
  00000032: 90                 nop
  00000033: C3                 ret


This code generation probably isn't something which deserves "fear" or "awe" ...  :eek


Ficko

Quote from: japheth on October 26, 2009, 12:30:26 PM
... This code generation probably isn't something which deserves "fear" or "awe" ...  :eek
I tried "-size" switch to defeat Japheth "sarcasm" :P but I got this:


00401027  |.  83F8 01       CMP EAX,1
0040102A  |.  75 28         JNE SHORT 00401054
0040102C  |.  90            NOP
0040102D  |.  90            NOP
0040102E  |.  90            NOP
0040102F  |.  90            NOP
00401030  |.  83F9 02       CMP ECX,2
00401033  |.  75 0D         JNE SHORT 00401042
00401035  |.  90            NOP
00401036  |.  90            NOP
00401037  |.  90            NOP
00401038  |.  90            NOP
00401039  |.  83FB 04       CMP EBX,4
0040103C  |.  74 16         JE SHORT 00401054
0040103E  |.  90            NOP
0040103F  |.  90            NOP
00401040  |.  90            NOP
00401041  |.  90            NOP
00401042  |>  83FE 01       CMP ESI,1
00401045  |.  76 12         JBE SHORT 00401059
00401047  |.  90            NOP
00401048  |.  90            NOP
00401049  |.  90            NOP
0040104A  |.  90            NOP
0040104B  |.  83FF 02       CMP EDI,2
0040104E  |.  73 09         JNB SHORT 00401059
00401050  |.  90            NOP
00401051  |.  90            NOP
00401052  |.  90            NOP
00401053  |.  90            NOP
00401054  |>  BA 03000000   MOV EDX,3
00401059  |>  6A 00         PUSH 0


Which optimized the jumps but didn't take out the nops. :'(

BogdanOntanu

#21
Yes guys I am aware of this code size optimization issue and when the time comes I will remove the NOP's and improve HLL code generation. Currently it helps me debug the HLL primitives as it is.

And BTW contrary to popular belief many times the LONGER instructions encoding are faster (even if bloated) on Intel CPU's ;)

Japeth's sarcasm if welcomed, I do not mind it.... if he tests and finds some real problems / bugs in Sol_Asm the he helps even if he is ironic.

This "problem" is well known to me. Try without HLL .IF's (aka "pure" jumps) and you will see that Sol_ASM does remove the bloat when the -size command is given. The fact that HLL generated code is not yet shown in listing is documented in the manual. Again this will be fixed in future releases.

To save Japeth another known to me found: Sol_Asm does make some extra probably not needed passes (again not yet optimized) in this case.

As I have said before: "early optimizations are the root of all evil" and I do respect this concept.

I will optimize this issue near the "end of development" ie when all features are added, module relations are established and algorithms optimized (in the beta phase). Anyway it is pretty fast even without those optimizations ;)

Thanks for testing and reporting this Japeth...
Ficko do not worry, the NOP's will vanish in future releases.

BTW "fear" or "awe" is not what I seek. You should be in awe about your own creations and not about my own ;)

I think Hutch was referring to the fact that Sol_Asm has many improvements and new things when compared to "standard" assemblers like MASM/TASM.

FOR example the fact that it auto generates the PROTO from the PROC definitions later in source files, huge line sizes, "_" in numbers, multiple instructions on the same line, mini resource compiler/parser, the fact that it generates binary for OS development and PE32/64 without a linker ...etc ... stuff like this.

It should be clear that Sol_Asm is still under development and not all parts are finished or optimized yet.

Bug reports are welcomed...sarcastic or not  :cheekygreen:

Hence if you find any other things that you do not like in Sol_Asm or new features that you would like to see implemented please feel free to express yourself.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Ficko


hutch--

 :bg

I would not want Japheth to feel left out of it after the resurrection of WASM from the dead into a decent assembler again but I am not all that well versed in germanic history to pick an appropriate folk hero to model after. Now with his exensive knowledge of DE folk heros, a personality should not be all that hard to find, how about Bismarke (the polititian not the ship), Charlemaine, Attilla the Hun, we will leave out "Mein Feuhrer". You could even go with Martin Luther for having shaken the European world way back then.

Just be warned though, Vlad Tepes was very skillful and truly ruthless so just as you start to feel comfortable and relaxed in the late evening, he may appear and suck the life out of you.  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

japheth

Quote from: hutch-- on October 27, 2009, 01:55:15 AM
I am not all that well versed in germanic history to pick an appropriate folk hero to model after. Now with his exensive knowledge of DE folk heros, a personality should not be all that hard to find, how about  (the polititian not

Bismarke - yes
Charlemaine - yes
Attilla the Hun - no, isn't regarded as "German" in Germany
Martin Luther - yes
"Mein Feuhrer" - yes  :toothy ( it's "Fuehrer"!)

Missing:
Arminius ( "Battle of Teutoburg...")
Siegfried :toothy
Theodoric the Great
Otto the Great
Frederick Barbarossa
Frederick II



hutch--

 :bg

This is the one I forgot, Metternich. I did some modern European history at high school and Metternich was a very interesting and talented character. I left out both the "Fuehrer" and the "Kaiser" as they both flopped in the long haul.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php