flat assembler
Message board for the users of flat assembler.

Index > Main > comparison Tasm vs Masm vs Fasm vs Rasm

Author
Thread Post new topic Reply to topic
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 28 Mar 2009, 19:26
general discussion... fasm vs rasm (no... not rosasm!)


Last edited by Luc Van de Velde on 30 Mar 2009, 17:02; edited 2 times in total
Post 28 Mar 2009, 19:26
View user's profile Send private message Send e-mail Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 28 Mar 2009, 19:57
The following lists only messages shown by FASMW 1.67.36 that don't match what you have said:

mov ebx,ss:[eax+ebx+ecx] -> "Error: Extra characters on line."
mov ebx, [ss:eax+ebx+ecx] ->"Error: invalid expression." (the same as above but with syntax corrected)

mov ebx,[ss:2*ebp] -> No error now, you forgot to use FASM syntax at this one

mov ebx,[ss:eax+5*ebx] -> "Error: invalid address." (again I had to correct syntax)
mov ebx,[ss:eax+10*ebx] -> "Error: invalid address." (this is the last time I'll say that I've corrected syntax, everytime you say "ss:" somewhere then surely I've placed it in the correct place, i.e. inside the square brackets)
mov ebx,[ss:eax+ax] -> "Error: reserved word used as symbol."
mov ebx,[ss:eax-ebx] -> "Error: invalid address."
mov ebx,[ss:2*eax+2*ebx] -> "Error: invalid address."

[edit]BTW, where can I download RASM?
Post 28 Mar 2009, 19:57
View user's profile Send private message Reply with quote
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 28 Mar 2009, 20:28
youre right... sorry but i didnt know u had to put the segment inside
the memory brackets... so, i found no bugs in fasm

Here is the link to download RASM
http://www.filefactory.com/file/af8gah7/n/rsources.zip

Unzip to c:\
notes:
Rasm is open source and public domain
Rasm can assemble itself
In development since september 1997
Rasm can produce .sys/.com/dos .exe/win .exe(PE)
Additional functionallity for designing/testing/routing and producing chips
In cplayout directory u will find asm.exe... its the same as rasm.exe
If u run layout.bat to produce a chip layout u should increase the number of
layers to 16 to see a successfull routing result... just press '-' on a qwerty
keybourd (right next to 0 on an azerty)
pressing 'd' will start ASTEROIDS
pressing 'g' will start 4 in a row
just press 'h' (help) to see the fuction of all keys[url][/url][url][/url]


Last edited by Luc Van de Velde on 30 Mar 2009, 19:03; edited 2 times in total
Post 28 Mar 2009, 20:28
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 29 Mar 2009, 03:58
> [edit]BTW, where can I download RASM?

http://betov.free.fr/ Laughing

Luc Van de Velde wrote:
youre right... soryy but i didnt know u had to put the segment inside the memory brackets... so, i found no bugs in fasm


Laughing

Quote:
Here is the link to download RASMhttp://www.filefactory.com/file/af798f6/n/rsources_rar/


No project page ???

Quote:
Rasm is open source and public domain Rasm can assemble itself
In development since september 1997


Nice, but this doesn't give you the right to include RAR.EXE Sad Also, there is at least one faulty PIF file, and your buggy "comparison" test Sad so please delete or update the file, it's very unfair to claim "FASM is the most buggy" while in fact it was your BUG.

> Rasm can produce .sys/.com/dos .exe/win .exe(PE)

Nice ... if true.

> Additional functionallity for designing/testing/routing and producing chips

Forgot the pizza-feature ? Laughing

> pressing 'd' will start ASTEROIDS

falling on my head ? Laughing

>pressing 'g' will start 4 in a row

4 what ?

BTW, the "comparison" as-is is of course total invalid, nevertheless, it shows that error messages produced by FASM are indeed suboptimal (MOV AX, [DX] | LEA ECX, [EAX+EBX+ECX] ... compared to what RASM reportedly (and partially MASM and TASM) do produce.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 29 Mar 2009, 03:58
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 29 Mar 2009, 04:55
Yep, better explanation than "invalid address." could be a good thing to have and I think that something must be done with "reserved word used as symbol." (discussed already somewhere), it doesn't even say what symbol is (it is AX), and still it doesn't make clear that the real problem is that it is an invalid addressing.

Once you get used it doesn't matter anymore, but yet it could save some time in cases where the instruction is "mov reg, [some_macro_generated_equ]" where you don't have a clue for what reason it is wrong.
Post 29 Mar 2009, 04:55
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 29 Mar 2009, 15:57
INC.TXT wrote:
;[ebp+esp] ;Tasm: OK turns esp into base
;Masm: OK turns esp into base
;Fasm: OK turns esp into base
;Rasm: OK turns esp into base
A few years back I had to plead with the author to get this behaviour changed to what you show above. Else this would have turned up in your list as a bug. Strange how these things come up again and again. Wink
Post 29 Mar 2009, 15:57
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 29 Mar 2009, 16:10
INC.TXT wrote:
... and Fasm use algebra on registers)
Yes fasm does but you have to do it the right way else you will get an error:
Code:
mov eax,[eax+eax+eax]     ;okay
mov eax,[eax+ebx+eax]     ;okay
mov eax,[eax+ebx-ebx+ecx] ;okay
mov eax,[eax+ebx+ecx-ebx] ;<---- error: invalid expression.    
The last two are actually the same instruction, but the second form will error because the expression calculator cannot hold more than two registers at a time. So when evaluating it gets to the third register (ecx) and can't put it into the holding variable and gives an error. This also works fine ...
Code:
mov eax,[eax+ebx-eax+ebx+ecx-2*ebx+edx]    
... but the order of subtractions is important to ensure it will compile successfully.
Post 29 Mar 2009, 16:10
View user's profile Send private message Visit poster's website Reply with quote
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 29 Mar 2009, 22:44
a test file to see if your assembler optimizes branches perfectly


Description:
Download
Filename: BPUZZLE.ASM
Filesize: 1.83 KB
Downloaded: 2209 Time(s)

Post 29 Mar 2009, 22:44
View user's profile Send private message Send e-mail Reply with quote
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 30 Mar 2009, 00:29
look at how rasm deals with repeats... Smile

u="_"
i=0
j=1
testing:
lab&i&u&j:
sub eax,i
jns lab&i&u&j
i=i+1
if i lt 100000 goto testing ;any label can be jumped to by a compile-time goto, also forward jumps!

lab&i&u&j becomes sequentially:
lab0_1
lab1_1
lab2_1
lab3_1
....
lab99999_1 (loop exits)

if u want a generic goto: if 1 goto label
time to compile this (100000 loops):1.6 seconds... on a cheap laptop
Post 30 Mar 2009, 00:29
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 30 Mar 2009, 01:06
Are you trying to have face-off between Rasm and fasm? Or are you just unsure how to do the same in fasm?

Code:
use32
u equ "_"
j equ 1
rept 100000 i:0 {
  lab#i#u#j:
    sub eax,i
    jns lab#i#u#j
}    
Quote:
flat assembler version 1.67.32 (100000 kilobytes memory)
1 passes, 1.6 seconds, 699744 bytes.
On my 6 year old cheap laptop.
Post 30 Mar 2009, 01:06
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 30 Mar 2009, 01:18
Luc Van de Velde wrote:
look at how rasm deals with repeats


Before further advertising R[os]ASM here, there are 2 things you should do pretty urgently:

* Update or delete your comparison text in both forum attach and the package

* Fix the (C) violations in your package

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 30 Mar 2009, 01:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 30 Mar 2009, 01:45
Can Rasm solve this problem with minimal code (5 bytes)?
Code:
use32
a: mov eax,[edx+c-a-5]
   mov esi,[edx+c-a-7]
c:    
See here for some discussion.
Post 30 Mar 2009, 01:45
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Mar 2009, 02:42
Is this really RosASM? I've tried to confirm that yesterday but I was unable to find the sources at betov's site.
Post 30 Mar 2009, 02:42
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Mar 2009, 11:45
Quote:
Can Rasm solve this problem with minimal code (5 bytes)?

I remember correcting betov oversimplified ideas about code size optimization about 1-2 years ago, so my quess would be no Smile
Post 30 Mar 2009, 11:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 30 Mar 2009, 17:47
conditional GOTO's are very usefull
ex.
-for jumping out of a loop
-can simulate any type of loop

IF condition GOTO label is missing in all assemblers except rasm

note: the condition can be anything... not just for loop counter only!
Post 30 Mar 2009, 17:47
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20453
Location: In your JS exploiting you and your system
revolution 30 Mar 2009, 17:58
fasm has while/break/end, repeat/break/end and if/break/else/end but they are all assembly-stage block directives. But the pre-processor macros could definitely benefit from an exitm type directive. I miss that sometimes.


Last edited by revolution on 30 Mar 2009, 19:18; edited 1 time in total
Post 30 Mar 2009, 17:58
View user's profile Send private message Visit poster's website Reply with quote
Luc Van de Velde



Joined: 28 Mar 2009
Posts: 8
Luc Van de Velde 30 Mar 2009, 19:10
No Rasm has nothing to do with Betov's excellent Rosasm!
I dont use a preprocessor in rasm... u lose POWER that way
Each label also has a dword pointer to its source code address!
Take note of this Thomas!
that way u can easily implement 'IF cond GOTO label'
This is possible becouse rasm loads all source code into memory
Post 30 Mar 2009, 19:10
View user's profile Send private message Send e-mail Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 30 Mar 2009, 19:54
Luc Van de Velde wrote:
conditional GOTO's are very usefull

IF condition GOTO label is missing in all assemblers except rasm



Masm v6 has the GOTO directive. It works within macros only. It's hardly used, because the more structured loop directives usually are sufficient.
Post 30 Mar 2009, 19:54
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 30 Mar 2009, 23:04
LocoDelAssembly wrote:
Is this really RosASM?


NO. Sorry for the confusion Sad

Quote:
confirm that yesterday but I was unable to find the sources at betov's site.


Inside the EXEcutables ? I don't use RosASM, heh Wink

Luc Van de Velde wrote:

> Take note of this Thomas!

Of what ? And you take note of Tomasz's name!
Post 30 Mar 2009, 23:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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.