flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > Will FasmArm ever run native on Arm ? Goto page 1, 2, 3 Next |
Author |
|
HaHaAnonymous 27 Jan 2013, 22:02
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 21:50; edited 1 time in total |
|||
27 Jan 2013, 22:02 |
|
ManOfSteel 27 Jan 2013, 23:35
HaHaAnonymous wrote: If ARM will replace x86 this is going to take a lot of time (It's hard to replace an OS, imagine an entire hardware) and they must to invade the desktop market (at Intel and AMD level) for that. Think outside of the box. Dex4u is talking about the RPi and (I guess) has the mobile industry in mind. Guess what? More and more people are getting mobile devices (95% of which are ARM-based) to communicate and play games (which is what most people have ever done with their PCs). You can't imagine how many people are using mobile devices exclusively to browse the Internet nowadays. Just wait a few years and the phablet or something like it will have replaced pretty much all notebooks and a significant part of home desktops. |
|||
27 Jan 2013, 23:35 |
|
HaHaAnonymous 28 Jan 2013, 00:19
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 21:50; edited 1 time in total |
|||
28 Jan 2013, 00:19 |
|
Dex4u 28 Jan 2013, 02:31
HaHaAnonymous wrote:
lazy , 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. @HaHaAnonymous, And if the x86 desktop does die, it would be such a shame to lose coders like you . |
|||
28 Jan 2013, 02:31 |
|
TmX 28 Jan 2013, 07:59
Dex4u wrote: but i was asking if anyones porting it or planing on porting it, as if not i will port it. AFAIK revolution hasn't announce the plan to rewrite FASMARM in ARM assembly yet. But if you send him a nick check, probably he will change his mind? He he... |
|||
28 Jan 2013, 07:59 |
|
ManOfSteel 28 Jan 2013, 09:28
HaHaAnonymous wrote: Sorry, but if someone said ARM will replace x86 then said person affirmed that with the desktop industry in mind as it is the main market of x86 (not sure if it is its biggest market). You're still not thinking outside of the box. What I'm saying is that the desktop/PC is in decline. People (most of them at least) never used it because they needed that product precisely, they used it because they needed something that did what it did. Most of what they used to do on a desktop (browsing the Internet, chatting, playing, reading, etc.) can now be done on mobile devices. A few years from now only professionals in the publishing industry, multimedia industry, etc. will be using desktops. HaHaAnonymous wrote: Many people... Excluding me, of course. I dislike mobiles. Maybe not as much as I do. I can't use small devices comfortably so I can't even stand laptops. As for phones, I was always allergic to them. Most of them (including the latest smartphones) have very bad sound systems and I can't hear the person well. Besides I think body language is very important in conversations. |
|||
28 Jan 2013, 09:28 |
|
revolution 29 Jan 2013, 06:17
TmX wrote: AFAIK revolution hasn't announce the plan to rewrite FASMARM in ARM assembly yet. But the real problem is not the porting as such, it is more about the execution environment (the OS and the input methods). A touch-screen tablet running a closed Apple or MS OS would be an awful system to try and get something like an assembler running. As of today I don't see any suitable dev system that is ARM based. If I am wrong about that then please point to a good ARM dev system. TmX wrote: But if you send him a nick check, probably he will change his mind? |
|||
29 Jan 2013, 06:17 |
|
TmX 29 Jan 2013, 15:32
revolution wrote: If I am wrong about that then please point to a good ARM dev system. What about ARM Linux? Raspberry Pi is a good example for that. Plug it to a monitor and keyboard. Now you have a nice tiny ARM desktop. gcc and the related tools (gdb,objdump, etc) also supports ARM. I think this is good enough, at least for hobyist. On the other hand, I think most profesional/commercial ARM tools are X86-based only, though. |
|||
29 Jan 2013, 15:32 |
|
pelaillo 29 Jan 2013, 18:55
I'm in for a team that wants to port fasmarm to the raspberry pi. I'm playing a lot with it and I see it as a suitable development platform. Actually, I have one running 24/7 as a home web server (my personal cloud / git repository) and another one for experimenting purposes.
The most recurring idea is to have a simple fasm styled autoassembler for a native assembly OS, similar to OctaOS but for the raspberry pi. It is such a lot of work for my limited resources and my illimited laziness, but will gladly participate in any team with similar goals (Hello Dex, I have seen your excellent tutorial for the R-Pi) I truly believe that the way to go is the way that JohnFound is showing us with FreshLib, but I have lost interest in x86. p.s. I will make it soon available the gzipped image of my raspbian+nginx+node.js+php+redis+git home server for the rasp.pi -> a lot of fun! |
|||
29 Jan 2013, 18:55 |
|
Dex4u 29 Jan 2013, 20:35
TmX wrote:
Thanks for the reply, i agree with others the raspberry pi is a great platform for ARM dev (it as many linux distro's), theres over 1000000 out theres and with a cheaper ver coming out soon, there will be many more. I have coded both bare metal and under linux for the pi, the only problem i have is i have to do the dev work on a x86, which is a shame. Theres been a big interest in fasmarm on the raspberry pi forum, but not being able to run on the raspberry pi is a down side, also there a lot of OS dev's coding for the PI, with fasmarm being so easy to port this would be a big plus, if it could run native on arm. In my pi OS port, i have read/write to sd card, usb keyboard, CLI, every thing needed to port fasmarm, other than it's x86. If you were to rewrite it for arm, i would be more than willing to donate a raspberry pi, if it would help. @pelaillo, glad you like the tuts. |
|||
29 Jan 2013, 20:35 |
|
revolution 29 Jan 2013, 23:27
If you manually port the x86 version of fasmarm to ARM then you risk either having to manually make changes to keep in sync with the x86 version updates (both from Tomasz to the core or from me for the arm portion), or having a version that is stale and gets no updates.
Another possibility also might make sense here: To use some tool (as yet not in existence AFAIK) to automatically convert x86 to ARM during assembly. You would only then need to manually write the fasmarm.asm and system.inc files and the rest of the sources can be automatic. Of course this is not really a trivial task because there are considerable differences between the instruction sets, but some form of line-by-line conversion can work. Performance might suffer a bit but probably not so much that it will be too awful (and perhaps equivalent to the HLL tools currently available?). You could define a register mapping (e.g. eax == r0, ecx == r1 etc.) and use the flags directly. One problem might be the parity flag but I suppose that could be worked around somehow. |
|||
29 Jan 2013, 23:27 |
|
revolution 30 Jan 2013, 00:17
I just realised that I was thinking of the console version in the above post. If you want to use the GUI then of course that would be a much bigger undertaking to port that to whatever OS is used on the target system. And I doubt that that could be an automatic process.
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? |
|||
30 Jan 2013, 00:17 |
|
revolution 30 Jan 2013, 02:33
A selection of x86 instructions converted to ARM:
Code: ;eax ---> r0 ;ecx ---> r1 ;edx ---> r2 ;ebx ---> r3 ;esi ---> r4 ;edi ---> r5 ;ebp ---> r6 ;esp ---> r13 ;temp1 = r7 ;temp2 = r8 ;temp3 = r9 mov eax,ecx mov r0,r1 ;easy! mov al,bl bfi r0,r3,0,8 ;easy! mov ah,bh ror r7,r3,8 ;shift interesting bits into position bfi r0,r7,8,8 add ch,dh lsl r7,r1,16 ;mov byte into high position and r7,0xff shl 24 ;clear lower bits lsl r8,r2,16 and r8,0xff shl 24 ;clear lower bits adds r7,r8 ror r7,24 bfi r1,r7,8,8 ;place the result into position setc al bic r0,0xff orrcs r0,1 mov [address],immediate movw r7,immediate and 0xffff movt r7,immediate shr 16 movw r8,address and 0xffff movt r8,address shr 16 str r7,[r8] add eax,immediate movw r7,immediate and 0xffff movt r7,immediate shr 16 adds r0,r7 sub eax,immediate movw r7,immediate and 0xffff movt r7,immediate shr 16 subs r0,r7 mrs r7,cpsr ;carry is inverted so we have to adjust it eor r7,1 shl 29 msr cpsr_f,r7 sbb eax,esi mrs r7,cpsr ;invert the carry flag eor r7,1 shl 29 msr cpsr_f,r7 sbcs r0,r4 mrs r7,cpsr ;carry is inverted so we have to adjust it eor r7,1 shl 29 msr cpsr_f,r7 and [ecx+edx*8+offset],immediate movw r7,offset and 0xffff movt r7,offset shr 16 add r7,r1 ;r7=ecx+offset ldr r9,[r7,r2,lsl 3] movw r8,immediate and 0xffff movt r8,immediate shr 16 ands r9,r8 str r9,[r7,r2,lsl 3] Last edited by revolution on 30 Jan 2013, 21:25; edited 6 times in total |
|||
30 Jan 2013, 02:33 |
|
revolution 30 Jan 2013, 02:39
Hehe, that above conversions sure make the ARM look bad. But I think if we were to go the other way it would make the x86 look bad. The ISAs are not equatable so this causes a large inefficiency when we do a naive one-to-one translation.
|
|||
30 Jan 2013, 02:39 |
|
pelaillo 30 Jan 2013, 04:28
I was thinking in a new native port. Starting with a simple set and build upon it later on, like the way fasm was written by Tomasz. With an advantage: we have Tomasz work as a guide.
And of course, abandoning all legacy x86 particularities and complications. |
|||
30 Jan 2013, 04:28 |
|
revolution 30 Jan 2013, 07:42
pelaillo wrote: I was thinking in a new native port. Starting with a simple set and build upon it later on, like the way fasm was written by Tomasz. With an advantage: we have Tomasz work as a guide. |
|||
30 Jan 2013, 07:42 |
|
Tomasz Grysztar 30 Jan 2013, 11:32
revolution wrote:
This also gives me another idea for fasm 2 (though it will probably push it further into an undetermined future) - that it should be written in such a way, that even conversion for an ARM architecture would be a simple task (perhaps using fasm 2 macros). But that's just my dreaming right now, please ignore it. |
|||
30 Jan 2013, 11:32 |
|
revolution 30 Jan 2013, 13:05
Tomasz Grysztar wrote: I think that any rewrite of fasm should dispose of this legacy (fasm 2 certainly would). Tomasz Grysztar wrote: This also gives me another idea for fasm 2 (though it will probably push it further into an undetermined future) - that it should be written in such a way, that even conversion for an ARM architecture would be a simple task (perhaps using fasm 2 macros). But that's just my dreaming right now, please ignore it. |
|||
30 Jan 2013, 13:05 |
|
hopcode 30 Jan 2013, 14:28
hello people,
first of all thanks to Dex4u for this thread. i waited for it. Quote: Essentially making an HLL like ARM assembler which ports no matter what underlying architecture... fasm is for/on x86 archtecture. ARM is another architecture. because ARM is hardware, assembly is already HLL there. about the proof-code posted above by revolution, it resemble just like when managing different human language and trying to translate a concept: different mental architectures ergo, one should live among those people in that culture to understand and use that language and the meaning of it. if not in this way, inefficacy. because of the fact instructions are just like words and terms, they do not map 100% on different ISAs. dont go this way please, even if tempted. the effort is huge and the output clumsy, granted a-priori without needing the proof-code. the ARM-tool should live on ARM and compile ARM stuff. also native, native, native. 3x native. ARM compiles ARM natively on ARM. at the cost to free the tool from the fasm engine bitter truth but truth. full-stop. dont ignore it. i had this thread in mind since reading armv7.inc one week ago. one should start again on ARM reinventing the weel with a simple data-packer, to manage the memory scheme and ISA etc, eventually on RasPi. this way is worth. you say RasPi is a good dev-system for that ? what OS ? why is it good ? what the difference with other OS on RasPi ? the question is already above from revolution revolution wrote: ...point to a good ARM dev system... Cheers, _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
30 Jan 2013, 14:28 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.