flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Non-x86 architectures > Will FasmArm ever run native on Arm ?

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 860
Location: Colombia

Quote:

huge worthless effort, without answering that question.


It depends on what the people here will consider good enough. I have an entire web server running even non trivial scripts, running interpreted node.js code, serving files and data from a headless raspberry-pi. The difference in performance between it and my x86 linux server is barely noticeable for most of the current uses it have.
For obvious reasons, I am not going to use it for compiling gnucash Wink on it and don't expect it to run your web apps while streaming video through HDMI.

And remember: we are talking about interpreted languages: php and javascript. The complete opposite end of the spectrum from assembly, so just imagine the performance in a truly native assembly small applications and libraries. Even assembled on-the-fly ala OctaOS.
Post 30 Jan 2013, 18:27
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6518
Location: Kraków, Poland

hopcode wrote:
because of the fact
instructions are just like words and terms,
they do not map 100% on different ISAs.

The fact that fasm by principle uses only the basic 80386 instruction set (without FPU) in its sources may be a bit helpful here, I think.
Post 30 Jan 2013, 19:34
View user's profile Send private message Visit poster's website Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany
perhaps you are right, i was just thinking about that again,
but i find it hard tough considering revolution's proof.
say, using mass regex on the first first versions of fasm, to make a test

_________________
⠓⠕⠏⠉⠕⠙⠑
Post 30 Jan 2013, 19:50
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web

revolution wrote:

Also, to short-circuit the whole thing a VM running the x86 code could solve the issue. Do any of the existing ARM setups have such a VM available?


There are VM for x86 that run on the Pi, most of the raspberry pi's only have 256 of ram (now they up graded to 512).
But its all about the user experience, i have not tried it, but i can see the experience not being good or easy for beginners.
The big down side to ASM has always been portability, if we can get round that it would be a big plus.
I think the revolution or macro ideas could work, i am going to study the source code for fasm, to get a better understanding of the problems.
Thanks for everyones input.
Post 30 Jan 2013, 20:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15096
Location: The Unicomplex

Dex4u wrote:
I think the revolution or macro ideas could work ...

Just to note here that I do not propose using macros. I propose native code, possibly a replacement for x86_64.inc. I think macros would be a poor solution, harder to code, longer to code, harder to understand, harder to debug.
Post 30 Jan 2013, 21:19
View user's profile Send private message Visit poster's website Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany

revolution wrote:
I propose native code, possibly a replacement for x86_64.inc.

exactly. good pointing it out. also how ? regular expression ?

_________________
⠓⠕⠏⠉⠕⠙⠑
Post 30 Jan 2013, 22:04
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: 15096
Location: The Unicomplex

hopcode wrote:
exactly. good pointing it out. also how ? regular expression ?

I think you misunderstand. Native x86 code to convert x86 source into ARM binaries. No macros involved. That way only one set of sources needs to be maintained.

Starting a new project from scratch would no longer be fasmarm. It would be something else with its own set of sources (and problems).
Post 30 Jan 2013, 22:18
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web

revolution wrote:

Dex4u wrote:
I think the revolution or macro ideas could work ...

Just to note here that I do not propose using macros. I propose native code, possibly a replacement for x86_64.inc. I think macros would be a poor solution, harder to code, longer to code, harder to understand, harder to debug.


I full understand your proposal, which i think it would the best way, easer to debug and read.
That why i put "or" macro, which was the other way proposed.
I also think your proposed (revolution), would be a good reference for coders who are learning Arm asm, that have already know x86 asm, as they can see the translation .
Post 30 Jan 2013, 23:09
View user's profile Send private message Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany

revolution wrote:
Native x86 code to convert x86 source into ARM binaries

eh! hallo ?! no macro ! are you there ?

Code:

 mov eax,ecx  
 mov r0,r1   ;easy!



use regular expression to substitute all that can be substituted.
you find the first line then substitute it with the second line in the source (suggested)
or you do it in the binary with the binary of it ! trivial, up to that line !
in both case fasm copyright must be there, because the original layout
is from Tomasz.

_________________
⠓⠕⠏⠉⠕⠙⠑
Post 31 Jan 2013, 00:27
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: 15096
Location: The Unicomplex
hopcode: What I was envisaging was like this in the x86_64.inc file:

Code:
;...
mov_instruction:
;...
      mov_reg_reg:
        lods    byte [esi]              ;read x86 reg1
        movzx   ebx,al
        shl     ebx,12
        lods    byte [esi]
        cmp     al,','
        jne     invalid_operand
        lods    byte [esi]              ;read x86 reg2
        movzx   eax,al
        lea     eax,[ebx+eax+0xe1a00000;make ARM instruction
        jmp     store_instruction
;...

Post 31 Jan 2013, 02:13
View user's profile Send private message Visit poster's website Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany
i see now, and still more difficoult this other way, because code
before and after final LEA must be aware of all the flags,IT,interworking etc
that are unknown on x86. what you get actually from that ?

1) you will throw away the work on fasmarm
2) we will get yet another x86 tool (continuing flashing stuff on board via USB)
3) this time huge effort, no doubt.

clue 1:
code density on ARM is high but constant.
on x86 is variable. this should be the clue to avoid that integration in the x86 code
(lea eax,[ebx+eax+0xe1a00000]).
all the variable density of x86 must converge to the constant density of ARM.

clue 2:
the 3 variants of the MOV on the ARM manual.
the MOV immediate has to consider the IT
the MOV register (as in your quote) should take in account registers + IT
the MOV shifted must consider shifting (and eventually canonicals), this time at preprocessing!

ARMv7.inc i like it, it is fine stuff, but it is the "hell" Smile when compared with
the linear complexity of x86_64.inc

Tomasz is right when he says that fasm code, being bound to the x86, may
offer some advantages. the question is the target. then, after those 2 clues
i reported above, i ask: advantageous yes, but how and for what target ?

now, after excluding already the macro solution one month ago in the other thread,
given an adaptation of the LIBC for an ARM dev-system -your related question is the most important, imho-
to alloc/dealloc memory etc,then considering the linearity of fasm surce,
it would be possible to do a tanslation of all fasm source code line by line to ARM.
and your role in the play would be simplified and limited to parse very few things in the ARMv7.inc. because fasm will be already ARM code there, already running on ARM.

ergo, regular expressions on the first first versions of fasm to execute a test.
till now, 4 different ways and no solution.
but i am personally for the 3x native one.
ARM runs on ARM and compiles ARM.

Cheers,

_________________
⠓⠕⠏⠉⠕⠙⠑
Post 31 Jan 2013, 03:57
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 860
Location: Colombia
I think that a full rewrite is going to be cheaper in terms of coding and debugging.

My proposal: to start a fundrising in order to have Tomasz to devote some time to finish a set of design lineguides for fasm2. Then we can proceed as a team with the implementation under Tomasz direction, supervision and control.
Our community is very small, but if we consider to widen the audience to all ARM related communities... raspberry-pi, replicant, arduino, even android developers could benefit from it.
Post 31 Jan 2013, 04:07
View user's profile Send private message Yahoo Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15096
Location: The Unicomplex
hopcode: The x86 code does not need to know about IT and the other stuff you mention. It only needs to make a functional ARM binary that is derived from the standard x86 fasm source code. In such a situation Tomasz and myself can continue to update the x86 versions of fasm and fasmarm and the converter app can automatically produce a new binary that runs on ARM. There would not be any ARM code in the source of fasm or fasmarm. We could stay with one version of sources.

pelaillo: A full rewrite from scratch would be more time consuming and has more potential for bugs. While it is appealing to have a native ARM source version it is also a lot more work. It would be a different project and it would not be fasmarm anymore, it would be something else. An automated re-targeting-assembler only needs to be debugged once for each class of instruction, and from then on can be reused over and over to re-convert newer ARM versions directly from x86 sources. If you want to start a new project then I do fully support that and I would be keen to use it, but it wouldn't be fasmarm.
Post 31 Jan 2013, 04:21
View user's profile Send private message Visit poster's website Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany

revolution wrote:
...and the converter app can automatically produce a new binary that runs on ARM. There would not be any ARM code in the source of fasm or fasmarm

yuhuu!!!!! Very Happy Twisted Evil you choosed point 2) we will get yet another x86 tool (continuing flashing stuff on board via USB)

it's plain now ok, thanks, yuhuu.
for the record, i just executed an analisys on the x86_64.inc resulting this quantities:

Code:

lines of code7012 (a dozen blanks)
duplicated4778



Tomasz was right, look here

encouraging imho.
good morning
Very Happy


Description: ouput unique lines in x86_64 : 2234
Download
Filename: outfile_x86_64.txt
Filesize: 47.11 KB
Downloaded: 214 Time(s)


_________________
⠓⠕⠏⠉⠕⠙⠑
Post 31 Jan 2013, 05:22
View user's profile Send private message Visit poster's website Reply with quote
hopcode



Joined: 04 Mar 2008
Posts: 563
Location: Germany

Dex4u wrote:
This is the ? "Will FasmArm ever run native on Arm ?" as at the moment you can not run fasmarm on device like the raspberry pi.


Dex4u wrote:
...that does not come into it, but i was asking if anyones porting it or planing on porting it, as if not i will port it.
But i have many projects on go.


hallo Dex4u, i hope you are there.
can you explain me please why would you like to run something like fasmarm, native on ARM.
from my point of view, i have several reasons pro, but one robust and simple contra.
thank you

p.s you can PM me if you like so.

Cheers,
Very Happy

_________________
⠓⠕⠏⠉⠕⠙⠑
Post 16 Feb 2013, 04:03
View user's profile Send private message Visit poster's website Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1171
Location: Unknown
Stupid post removed.


Last edited by HaHaAnonymous on 28 Feb 2015, 21:27; edited 1 time in total
Post 16 Feb 2013, 13:42
View user's profile Send private message Reply with quote
malpolud



Joined: 18 Jul 2011
Posts: 344
Location: Broken hippocampus

HaHaAnonymous wrote:

Quote:
can you explain me please why would you like to run something like fasmarm, native on ARM.


Because to run natively is always better. In my opinion.



Would you ever compile code on your tablet, smartphone or a special purpose machine like a CNC lathe? Even if you will develop it on such a device, compilation could be done remotely.

IMO running FASMARM on an ARMed device is totally useless so far.

BTW: Tell that thing to any embedded software engineer, you will be buried alive Wink

_________________
There's nothing special about it,
It's either there when you're born or not.
Post 16 Feb 2013, 16:36
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 789
Location: Jakarta, Indonesia

malpolud wrote:

Would you ever compile code on your tablet, smartphone or a special purpose machine like a CNC lathe?



Of course no.
But on the other hand, major OS e.g Linux and BSD also run on ARM.
Take Raspberry Pi, for example. It can be set up as a small ARM desktop.
I think it would be nice if we can run FASMARM on it

Smile
Post 16 Feb 2013, 17:48
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1171
Location: Unknown
Stupid post removed.


Last edited by HaHaAnonymous on 28 Feb 2015, 21:26; edited 1 time in total
Post 16 Feb 2013, 17:55
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15096
Location: The Unicomplex
I've been burned many times and I was alive while it happened. Mostly small things like touching the soldering iron etc., but I still have the scars to prove it. Does that mean I was burned alive?
Post 16 Feb 2013, 18:21
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.