flat assembler
Message board for the users of flat assembler.

Index > Main > Fasm wishlist

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
My fasm code should look like this:

random snippets ...

Code:
(1)
printf, "\n\tTried %u times\n\n", 10000000

(2)
mov eax, 3.14159265

(3)
.if st0 ge balance
   printf, "\tOver draft\n"
.endif

(4)
eax = ebx+ecx*edx

(5)
if a function have been declared or prototyped it's signatures should be used to enable high-level function calling.

(6)
Duplicate string constants should be merges into one.

eg:
   scanf "%f", addr bal
   scanf "%f", addr rate   

(7)
If, While construct should be implemented in Fasm itself and should not be
just emulated by macros.

(8)
Same for high level function declarations, local variables, structures
etc. they too should be implemented in Fasm itself.

(9)
Signed and unsigned comparisons in Constructs (If, while etc) may be
distinguished by using Mneomnic look alikes.
eg:
    ; signed
    .if eax ge 5
    .end if

    ; unsigned
    .if eax ae 5
    .end if

(10)
Full support for structures at Fasm level. (non macro)

(11)
Buildin preprocessed and assembled listings are missing.

(12)
Finally i believe that this should be compilable under core Fasm i.e. no
macro preprocessor emulation:

void sort(dword *array, dword length)
{
    for (eax = 0; eax < length; eax++)
    {
       for (ebx = 0; ebx < length-eax; ebx++)
       {
           edx = ebx + 1
           if (array[ebx] > array[edx])
           {
              ecx = array[ebx];
              array[ebx] = array[edx];
              array[edx] = ecx; 
            }
       }
    }
}

    


Please comment on these features ...

Tomasz Please think about it really... seriously...

More to come soon ehough ...

Please do not wake me up ... Shocked

Quote:
Day Dreaming is Productive Too


Last edited by f14t on 31 Oct 2006, 07:58; edited 2 times in total
Post 26 Oct 2006, 13:11
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
- why WAS this posted in Projects/ideas?
- why store pi in EAX, which you can't use for floating point operations?
- how would you want code like this assembled (eg. what should be resulting instructions)?
eax=edx + (edx*eax) + (ecx*edx)

really, what you want is not assembly. sorry to wake you up Wink
Post 26 Oct 2006, 13:31
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Except for the "mov eax, 3.14159265". which is pretty valid with fasm.
Post 26 Oct 2006, 13:34
View user's profile Send private message Visit poster's website Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
I posted it here because it's an idea. Laughing

Thanks alot to you that i am absolutely woken up.

Wink Wink Wink
Post 26 Oct 2006, 13:36
View user's profile Send private message Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
Tomasz Grysztar wrote:
Except for the "mov eax, 3.14159265". which is pretty valid with fasm.


Hey vid now shoot me in head with a bulky-stone-age cannon.

Why do you think Tomasz's Fasm allows
Code:
mov eax, 3,14159265    



Quote:
Pity is Good.
Post 26 Oct 2006, 13:40
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
He allows it because floating point number can be represented by dword value. and dword value can be stored in EAX. But i was asking WHY to do it, not if it is possible.
Post 26 Oct 2006, 14:43
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body
the code like:
eax=eax*ecx-edx

is very hard to generate(optimized)

first, someone must do think like:
invoke MessageBox,0,"string1!\n!string2"," ",0
or db "\n",0 which is equal to db 13,10,0

and then all other.
Post 26 Oct 2006, 14:48
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
in FASM, you use invoke MessageBox, 0, <"string1",13,10,"string2">, "", 0
Post 26 Oct 2006, 16:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
vid wrote:
He allows it because floating point number can be represented by dword value. and dword value can be stored in EAX. But i was asking WHY to do it, not if it is possible.


Vid you seem to me like really curious. So here's WHY

Code:
         cmp ebx, 5
         jb .lesser
         mov eax, 5.5
         jmp .rate_set
.lesser:
         mov eax, 2.2
         jmp .rate_set
         ;
         ; ...
         ;
.rate_set:
        mov [interest_rate], eax
        jmp .do_prinitng
       ;
       ; ...
       ;
    
Post 27 Oct 2006, 11:21
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
this work? i am not sure about structure of flotaing point numbers, but i wouldn't count on this
Post 27 Oct 2006, 11:24
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
vid wrote:
this work? i am not sure about structure of flotaing point numbers, but i wouldn't count on this


Yeah, it works.

Count on me.

And everybody please see my additions to Fasm Wishlist regularly.


Last edited by f14t on 27 Oct 2006, 11:48; edited 1 time in total
Post 27 Oct 2006, 11:27
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Yeah, it works.
Count on me.

i won't: http://en.wikipedia.org/wiki/IEEE_floating-point_standard#Single-precision_32_bit

upper bit is sign. so this doesn't work:
Code:
mov eax, -1  ;10111111100000...
cmp eax, 1    ;00111111100000...
jb lesser ;doesn't jump    


neither does signed conditional jumps:
Code:
mov eax, 1  ;001111111000000...
cmp eax, 2  ;010000000000000...
jl lesser ;doesn't jump    


so? Razz
Post 27 Oct 2006, 11:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f14t



Joined: 27 Sep 2006
Posts: 36
f14t
Hey Buddy !

Please watch my code carefully before commenting on it.

Have you mistaken ebx for eax ?
Post 27 Oct 2006, 11:51
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
no - explain
Post 27 Oct 2006, 13:02
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Yeah, the multiplying stuff would need a huge optimizing library:
http://www.azillionmonkeys.com/qed/amult.html
http://www.azillionmonkeys.com/qed/adiv.html

Otherwise it wouldn't make it any better to write this way....
Post 27 Oct 2006, 13:32
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
vid: yes, his code is an excellent example of why I also thought of this feature as useful. Note that fp values are just stored temporarily in EAX, to be later put in some place in memory. You can then do FLD or any other FPU operation on that memory, but to move it into the right place you could use the general register aswell, what saves you defining additional variables (that would anyway have to be moved through some register to place the values where you want them, finally).
Post 27 Oct 2006, 15:01
View user's profile Send private message Visit poster's website Reply with quote
Plue



Joined: 15 Dec 2005
Posts: 151
Plue
vid wrote:
He allows it because floating point number can be represented by dword value. and dword value can be stored in EAX. But i was asking WHY to do it, not if it is possible.

Pseudo-code:
A := 5.5 = FLOAT
Because this:
Code:
MOV    ecx, [v_FLOAT]
XOR    edx, edx
CMP    ecx, 1084227584
SETE   dl
MOV    [v_A], edx
    


is faster than this:
Code:
FLD    dword [v_FLOAT]
FLD    dword [F0]
XOr    ecx, ecx
FCOMIP st1
FSTP st0
JZ     rq_L1
MOV    ecx, 1
rq_L1:
MOV    [v_A], ecx
..
F0 dd 1085276160    

_________________
Roses are red
Violets are blue
Some poems rhyme
And some don't.
Post 27 Oct 2006, 16:14
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
This maybe a bit off topic(sorry), but one thing on my wishlist has nothing to do with fasms internals, it a fasm server that you can assemble you code by typing it into a browser and ether coming back with a zip file with the code assembed or error messages.
Great for code at school or work or internet cafe etc Wink .
Post 27 Oct 2006, 16:52
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
Dex4u, that's a very secure idea for the server. Someone could send 40mb of gibberish and hang the server while it tries to compile it.

But the technology you are thinking of would be CGI with a few modifications to fasm's command line compiler.
Post 29 Oct 2006, 19:41
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
somebody already did it i think. search board for few words of "fasm online compilation service".

problem arises with include files, and as tomasz said, it's possible to list files on server with "load" directive Wink
Post 29 Oct 2006, 20:01
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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-2020, Tomasz Grysztar.

Powered by rwasa.