flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
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 ![]() |
|||
![]() |
|
Tomasz Grysztar
Except for the "mov eax, 3.14159265". which is pretty valid with fasm.
|
|||
![]() |
|
f14t
I posted it here because it's an idea.
![]() Thanks alot to you that i am absolutely woken up. ![]() ![]() ![]() |
|||
![]() |
|
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. |
|||
![]() |
|
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.
|
|||
![]() |
|
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. |
|||
![]() |
|
vid
in FASM, you use invoke MessageBox, 0, <"string1",13,10,"string2">, "", 0
|
|||
![]() |
|
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 ; ; ... ; |
|||
![]() |
|
vid
this work? i am not sure about structure of flotaing point numbers, but i wouldn't count on this
|
|||
![]() |
|
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 |
|||
![]() |
|
vid
Quote: Yeah, it works. 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? ![]() |
|||
![]() |
|
f14t
Hey Buddy !
Please watch my code carefully before commenting on it. Have you mistaken ebx for eax ? |
|||
![]() |
|
vid
no - explain
|
|||
![]() |
|
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.... |
|||
![]() |
|
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).
|
|||
![]() |
|
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. |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
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. |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.