flat assembler
Message board for the users of flat assembler.

Index > Main > Should FASM Support High-Level Constructs?

Goto page 1, 2, 3  Next

Fasm Support for High-Level Constructs?
Yes
40%
 40%  [ 8 ]
No
60%
 60%  [ 12 ]
Total Votes : 20

Author
Thread Post new topic Reply to topic
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands 28 Nov 2003, 13:04
Should FASM support high level constructs like if..else..endif, for...next, while...endwhile, etc.. I would say yes, but let's take a poll.

There are several reasons to do so. Some of them here:
1. Easier migration for beginners.
2. Less errors in code and makes coding a lot easier.
3. Easier to read and understand (self-commenting).

I've been to some other boards and this is the thing I heard most:

"Give me a single line of assembly and I will tell you what it means. Give me a hundred or so, and I'll quit."

Vote and specify your reasons below.

You can also submit specifications of each high-level construct (how you'd like them to be) below:

I'd generally prefer:

1. If statements
a. with endif
Code:
If condition1 [Then]
... ; statements
[Elseif condition2]
... ; statements
[Else]
... ; statements
Endif
    


b. single-line
Code:
If condition Then statement
    


2. Switch
Code:
switch value
    case case_value1:
    ...
    break
    [case case_value2:]
    ...
    break
    [default:]
    ...
    break
endswitch
    


etc..

Regards,
Art
Post 28 Nov 2003, 13:04
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 28 Nov 2003, 13:52
art_sands wrote:
Should FASM support high level constructs like if..else..endif, for...next, while...endwhile, etc.. I would say yes, but let's take a poll.

There are several reasons to do so. Some of them here:
1. Easier migration for beginners.
2. Less errors in code and makes coding a lot easier.
3. Easier to read and understand (self-commenting).

I've been to some other boards and this is the thing I heard most:

"Give me a single line of assembly and I will tell you what it means. Give me a hundred or so, and I'll quit."

sort of "tell show me a Kanji and I'll tell you it's meaning, ask me to translate a novel and I'll quit".

There are macros theat do the things you ask for, but IMO these HLL structs are a bit too much abstraction, well commented plain assembly code is better - it's better to learn how things work before hiding them behind "if"s, to me it's like, you should first learn how to walk before you learn how to tie a shoe and go for a run in the park.

I vote no, as there are macros that works.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 28 Nov 2003, 13:52
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 28 Nov 2003, 13:52
art_sands wrote:
1. Easier migration for beginners.

Maybe yes, but they gains bad habits. Wink Moreover, for beginers is better to learn less, not more.

Quote:
2. Less errors in code and makes coding a lot easier.

I am not agree at all. There is no connection between HLL constructions and the count of the errors, neither coding speed.

Quote:
3. Easier to read and understand (self-commenting).

Readability of the program depends from programmer wish to write it readable, not from syntax construction. Or maybe you never see C program that is ugly mess of brackets and double-plus signs? Wink

BTW: It is easy to implement all these HLL constructions by macroses. If you like them simply use them. Why to embed them in the compiler core and to make compiler biger, slower and buggyer?
Moreover, many of FASM users (me too) like FASM namely because of it's simplicity combined with macro power.

Regards.
Post 28 Nov 2003, 13:52
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 28 Nov 2003, 14:11
Yes, I think fasm should support high level control structures Smile. I like the c style:

Code:
 

if  ( eax == 0 && edx == 1 )  
{
     ;do something 
}
else 
{
} 
    

This would be nice. It should include the while loops and for loops too Smile
I've had a peek at the fasm source code and from that I can tell privalov wouldn't like this idea much Smile and a lot of more experienced asm coders feel the same way also. But I think these HLL control structures are useful for windows programming. I think maybe Privalov could take fasm in two directions. The console version could retain its low level flavour but HLL contructs could be built into fasmw or an extended version of fasm. Maybe it can be called fasmex Smile. This I think would win over many beginners to fasm. As we speak a revolution in asm programming is happening. The newcomers to asm programming are programming with the High Level Assembly style. This I think is the way to go, this is the future. Smile So I urge the beginners to asm on this board, vote for hll control structures. Maybe if enough of us want it Privalov would implement these features Smile

_________________
silkodyssey
Post 28 Nov 2003, 14:11
View user's profile Send private message MSN Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 28 Nov 2003, 14:47
This was already discussed several times.
http://board.win32asmcommunity.net/showthread.php?s=&threadid=6855

http://board.win32asmcommunity.net/showthread.php?s=&threadid=6857&perpage=10&pagenumber=2

There are macros that do this constructions.

Believe me, this HLL constructs will slow the learning for a beginner, not the contrary. I said this out of my own experience.
If you stick with Privalov's coding style, you will be doing more readable/reusable/efficient code rather than the mix of HLL vain things.

A few instructions to do every other constructions.
Post 28 Nov 2003, 14:47
View user's profile Send private message Yahoo Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 28 Nov 2003, 15:06
silkodyssey wrote:
a lot of more experienced asm coders feel the same way also.

There is a reason: experience. Experience shows them that there is more proficient way to code in assembly, so why not take their word?
I'm a newbee too and I have had the same difficulties, until I start to study the fasm source and get convinced. You have an advantage over me, the fasm is already here Wink It wasn't when I started.

silkodyssey wrote:
The newcomers to asm programming are programming with the High Level Assembly style. This I think is the way to go, this is the future.

This is maybe the future of other languages.

And the past if you get started with fasm Smile And then you won't go to turn back, for sure!
Post 28 Nov 2003, 15:06
View user's profile Send private message Yahoo Messenger Reply with quote
Betov



Joined: 17 Jun 2003
Posts: 98
Betov 28 Nov 2003, 15:35
Too bad: I can't click twenty times on [No]. Too bad.


Betov.
Post 28 Nov 2003, 15:35
View user's profile Send private message Visit poster's website Reply with quote
LiuJunfeng



Joined: 28 Nov 2003
Posts: 48
Location: China
LiuJunfeng 28 Nov 2003, 16:15
I think assembly language should be pure and directly matches the actions of CPU.

If you prefer high level constructs, you should use a high level language.
For example, Euphoria.
Post 28 Nov 2003, 16:15
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 28 Nov 2003, 18:00
LiuJunfeng wrote:

If you prefer high level constructs, you should use a high level language.
For example, Euphoria.


What if the HLL doesn't give me access to machine instructions or register? Very Happy.I think coders should be free to code as they like. The best thing about HLL control structures in an assembler is that it doesn't prevent you from writing pure asm code if you so desire. So that way everyone benefits. The programmer would just choose the level at which s/he wants to program. Smile

pelaillo wrote:

There is a reason: experience. Experience shows them that there is more proficient way to code in assembly, so why not take their word?
I'm a newbee too and I have had the same difficulties, until I start to study the fasm source and get convinced. You have an advantage over me, the fasm is already here It wasn't when I started.


Well I guess the reason some of are fond of HLL control structures is because we grew up with them in our HLL programmng days. I guess we just have to learn to think in assembly.Smile HLL control structures are close to how people think so that makes it easier to read and understand for most of us. When we can think like the machine then I guess the low level control structures would be easy to understand too.

_________________
silkodyssey
Post 28 Nov 2003, 18:00
View user's profile Send private message MSN Messenger Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 28 Nov 2003, 18:10
It does not matter to me. Even if there exist high level constructs, I will still not use them.

Quote:
HLL control structures are close to how people think so that makes it easier to read and understand for most of us. When we can think like the machine then I guess the low level control structures would be easy to understand too.

Does not make much of a difference to me. I can code in both assembler and HLL.

Quote:
Too bad: I can't click twenty times on [No]. Too bad.

Somehow I agree with betov. Very Happy
Post 28 Nov 2003, 18:10
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Varchilde



Joined: 28 Nov 2003
Posts: 5
Varchilde 28 Nov 2003, 18:14
I think if you want HLL constructs build into the assembler, you should go with a compiler that already has them. I hear HLA is pretty powerful that way.

In my opinion, as a beginner. HLL constructs complicate the learning process. FASM already has macro features that can simulate HLL, no need for more.
Post 28 Nov 2003, 18:14
View user's profile Send private message Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 28 Nov 2003, 18:28
roticv wrote:

It does not matter to me. Even if there exist high level constructs, I will still not use them.

My Point exactly Very Happy

Varchilde wrote:

I think if you want HLL constructs build into the assembler, you should go with a compiler that already has them. I hear HLA is pretty powerful that way.


Good point Very Happy

Varchilde wrote:

In my opinion, as a beginner. HLL constructs complicate the learning process. FASM already has macro features that can simulate HLL, no need for more.


Complicate the learning process in what way? If the person is learning asm as a first language then maybe HLL control structures would complicate the learning process but I don't agree with you because HLL control structures is closer to how people think. If on the other hand the person already knows an HLL I don't see how it will complicate anything because they are already familiar with it whereas with the person learning asm for the first time they have to learn the HLL control structures too.

What does fasm have to lose by adding support for HLL control structures? How many of you will stop using fasm if this is done? On the other hand fasm has a lot to gain by adding support for these structures like the many beginners to asm who like to program with the high level asm style.
Nothing to lose, everything to gain Smile

_________________
silkodyssey
Post 28 Nov 2003, 18:28
View user's profile Send private message MSN Messenger Reply with quote
Varchilde



Joined: 28 Nov 2003
Posts: 5
Varchilde 28 Nov 2003, 18:59
Quote:

Complicate the learning process in what way? If the person is learning asm as a first language then maybe HLL control structures would complicate the learning process but I don't agree with you because HLL control structures is closer to how people think.


I am somewhat familiar with HLL from learning C many years ago. It would complicate the learning process in assembly because to use it, I would not learn what happens at the machine level upcodes and how the flags register operates.

On the other hand, if someone knows already all the upcodes involved, they might want to use HLL for some reason, in that case, FASM already has macros that do the job nicely. Is there something missing that you can't already do with the macros?

Quote:

What does fasm have to lose by adding support for HLL control structures?


That's just it, I don't understand. I think there is already support in macros. But I could be speaking from ignorance. Are there HLLs that the macros won't allow you to duplicate?

I think once I know enough to write my own HLL macros, I will do so and I will not need them in FASM itself.
Post 28 Nov 2003, 18:59
View user's profile Send private message Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands 28 Nov 2003, 19:04
Betov:

I understand your emotions, and in many ways you're right. But by not supporting them YOU are dictating the user, and limiting him from his freedom. He should be allowed to do what he wants to, not what you want him to. I personally don't like high level structures very much, but i think they should be supported. Additionally, if developers were to develop in a team, and every other guy uses his own version of constructs and code, this will only help add bloat to code, instead of slimming it down. This is exactly why libraries are standardized. Don't think about only yourselves people.

Microsoft may be bad players regarding their various monopolies, but the software engineers that work there at their various laboratories and at Intel Corporation are codegods. We cannot possibly compare to them because these are the pioneers who actually invented what we end up using. What do you think got Microsoft such success? They listened.

If you think the assembly revolution is going at the speed it should, then you're probably wrong. It's painfully slow. Many programmers who turn to assembly are already experienced in some other language. The shorter the time it takes them to migrate to assembly, the faster things start building. Without added features, you can't expect the programming world to shift from C/C++ or other languages to assembly.

Supporting High-level constructs doesn't mean you enforce them upon the user. The user is then free to choose. Frankly, extremism never got anybody anywhere. You have to listen to even the smallest kid, if you want respect. People have always preferred freedom over slavery or restrictions--that applies to you too Betov. The disadvantage to implementing these constructs using macros is that there will be a zillion versions and bugs aplenty. Instead of bringing order to the world that would create only chaos.

I think they should be supported. Consider things practically and get out of the box. If people do not want to use them, they can choose not to. But not supporting these will guarantee only lesser migration. MASM has reigned for long. Now it's time for FASM. People stick to MASM because of it's so called "features". Imagine, if FASM supported most of what MASM can do, people will automatically shift to using FASM.

You have to understand one thing: People don't like change. And you're changing things for them big time. They will surely be annoyed.

Also remember, the computer was invented to solve your problems not to create them for you.

For once, go to the beach, keep a cool head, think 'rationally', and then decide. I posted this only to know the response, and not to force Privalov to include the constructs. It's up to the people--not just accomplished assembly programmers but wannabes too.

And if you are getting too cozy with using the terms "pure asm", then I'm sorry to say, FASM should not support MACRO definition directives, structure definition directives, and other such stuff because they are not "pure" assembly. You can as well try coding in binary if that is your inclination. Or if you're of the more adventurous types, go straight to semiconductor electronics and program things in hardware. Heck, why are you developing an assembler for programmers? I hope you're doing that to make things easier for them.

The aim here is to make things as simple as possible. I'm not saying this, Sir Albert Einstein did. And you directly contradict that.

Regards,
Art


Last edited by art_sands on 28 Nov 2003, 20:21; edited 3 times in total
Post 28 Nov 2003, 19:04
View user's profile Send private message Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9 28 Nov 2003, 19:38
Glad,

instead, How about make to try implement compiler written in FASM?

OR

C# 2 ASM written in FASM Wink


--
Post 28 Nov 2003, 19:38
View user's profile Send private message Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 28 Nov 2003, 19:51
Seems to be a good idea... Wink
Post 28 Nov 2003, 19:51
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8361
Location: Kraków, Poland
Tomasz Grysztar 28 Nov 2003, 20:22
When you like such high-level construct, why not use HLA? I can generate fasm code. Or you can try the PureBASIC compiler, it supports inline fasm code. When I was designing flat assembler, I thought of it rather as a kind of nice back-end for high level language compilers than the high level capable compiler itself. High level processing should be done first, and then it's time for fasm with its multi-pass code optimization algorithms.
Post 28 Nov 2003, 20:22
View user's profile Send private message Visit poster's website Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands 28 Nov 2003, 20:34
Privalov, the point cannot be overstated--I'm not forcing anybody and it's not me who likes high-level constructs. The world does, that's why even though there are many assembly programmers (perhaps a thousand or more) at the boards, they are only the size of peanuts compared to those using C/C++ or other languages. If you want to increase your user base, add more features. The concern here is not using several things to accomplish one thing. You can compare the number of people using FASM, MASM, GoAsm, TASM, and RosAsm. HLA may be called an assembler, but I see it more as a preprocessor.

Take a break today and check the statistics yourself. That will do the talking.

And on a more clever note, one of the laws of good business and marketing says that:

Give the people what THEY want, and not what YOU want them to have.

Regards,
Art
Post 28 Nov 2003, 20:34
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 28 Nov 2003, 21:53
To art_sands:

Actually, I don't understand what you need? Did you look at the fasmw include directory? There is a file "include\macro\if.inc'
In this file are declaration of following HLL style constructs: if, else elseif endif, repeat and until.
Simply include this file in your program and use it if you like HLL so much.
What more than this you need?
Post 28 Nov 2003, 21:53
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
art_sands



Joined: 23 Oct 2003
Posts: 55
art_sands 28 Nov 2003, 21:57
when did i say i like HLL? Well, you need to be practical to understand what I have posted above. Read it very carefully.

I only asked for flexibility for migrators so that our community exceeds that of C/C++ or other langs. Anyway, thanks for answering.

Regards,
Art
Post 28 Nov 2003, 21:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.