flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > FASMARM v1.44 - Cross assembler for ARM CPUs

Goto page Previous  1, 2, 3 ... 15, 16, 17 ... 31, 32, 33  Next
Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Feb 2010, 02:39
Yes, but isn't this more direct?
Code:
macro adrl reg,address {
        mov     reg,address and 0xff
        add     reg,reg,address and 0xff00
        add     reg,reg,address and 0xff0000
        add     reg,reg,address and 0xff000000
}    
Post 23 Feb 2010, 02:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 23 Feb 2010, 02:41
LocoDelAssembly wrote:
Yes, but isn't this more direct?
Code:
macro adrl reg,address {
        mov     reg,address and 0xff
        add     reg,reg,address and 0xff00
        add     reg,reg,address and 0xff0000
        add     reg,reg,address and 0xff000000
}    
But this is not PC relative. The absolute address is unknown at assembly time. And relocations cannot alter those four instructions above to generate the proper value.


Last edited by revolution on 23 Feb 2010, 02:52; edited 1 time in total
Post 23 Feb 2010, 02:41
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 23 Feb 2010, 02:48
A very simple fact that I completely forgot about Confused
Post 23 Feb 2010, 02:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 23 Feb 2010, 04:11
Although the macros can indeed be extended to 4GB with 4 instructions it is generally not a good use of resources. If you need more then two instruction then there may be better ways.

One way is to place a relocatable constant in memory:
Code:
ldr reg,[pc,location_literal-$-8]
;...
location_literal dw location ;<---- this is relocatable    
This also uses two instructions. It can access the entire address space. But suffers from a memory load penalty. The cache line load may also evict other data in the dcache, potentially harming performance if that is a consideration. Plus it requires the placement of a relocation table in the binary increasing the exe size, this may also be an important consideration in some situations.

NOTE: relocations with ARM code have not been tested, use at your own risk


Last edited by revolution on 23 Feb 2010, 08:04; edited 1 time in total
Post 23 Feb 2010, 04:11
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 23 Feb 2010, 08:02
Very good project...I start to learn programming with FasmARM...

Now I'm looking for ARM disasm with debugger...Also looking for hopcodes...

Who can help me?

Thanks in advance...
Post 23 Feb 2010, 08:02
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 23 Feb 2010, 08:13
Beex wrote:
Now I'm looking for ARM disasm with debugger...Also looking for hopcodes...
For disassemblers it depends upon your platform. There is gbd for Linux, RealView (from ARM) and Keil also have some stuff.

For the opcodes see the links here:

http://infocenter.arm.com/help/advanced/indexList.jsp

Especially DDI0100I (v4-v6), DDI0406B (v7-A and v7-R), DDI0403C (v7-M) and DDI0419B (v6M).

Some documents require that you have an account, some require registration, and some are open access.
Post 23 Feb 2010, 08:13
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 23 Feb 2010, 09:11
Thanks a lot...

I find only this: http://imrannazar.com/ARM-Opcode-Map

Do You think for making ARM disfasm with debugger?
Post 23 Feb 2010, 09:11
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 23 Feb 2010, 09:26
Beex wrote:
I find only this: http://imrannazar.com/ARM-Opcode-Map
That covers up to v5TE.
Beex wrote:
Do You think for making ARM disfasm with debugger?
I have a disassembler that I wrote, but no debugger. There are a few emulators available, I've never used them so can't recommend any but have a look around and try some. Let us know what is good and what is bad.
Post 23 Feb 2010, 09:26
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 23 Feb 2010, 11:25
Quote:

I have a disassembler that I wrote, but no debugger

You see, I only start my way in programming...disasm that you've wrote can recognize the opcodеs?
And I still can't understand either FasmARM is up to date of new ARM CPU?

as disasm and debugger now I use Olly and Ida Pro, but of course it will be better to use specialized disasm-debugger which will fully support only ARM sets of instructions (Thumb, Thumb-2, Jazelle and etc.) and opcodes...Because it is'nt suitable to convert code from Ida or Olly to Fasm, may be there are plug in to convert asm code --> fasm code...I still not find such one...
Post 23 Feb 2010, 11:25
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 23 Feb 2010, 12:14
Beex wrote:
disasm that you've wrote can recognize the opcodеs?
No. The assembler recognises the opcodes. The disassembler spits out opcodes.
Beex wrote:
And I still can't understand either FasmARM is up to date of new ARM CPU?
Currently supporting up to v6. No T2 yet, but coming in a short time, development is underway.
Beex wrote:
as disasm and debugger now I use Olly and Ida Pro, but of course it will be better to use specialized disasm-debugger which will fully support only ARM sets of instructions (Thumb, Thumb-2, Jazelle and etc.) and opcodes...Because it is'nt suitable to convert code from Ida or Olly to Fasm, may be there are plug in to convert asm code --> fasm code...I still not find such one...
Unknown to me. If you find a good one then post the link here. Wink
Post 23 Feb 2010, 12:14
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 23 Feb 2010, 12:47
revolution pls check your pm, i've write mess there not to offtop here...

v7 set of instructions still not supported?
Post 23 Feb 2010, 12:47
View user's profile Send private message ICQ Number Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 01 Mar 2010, 09:51
revolution

May be you need help in up-to-date FasmARM with the newest updates of the new ARM's CPU sets of instruction?
Post 01 Mar 2010, 09:51
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 01 Mar 2010, 09:58
Beex wrote:
revolution

May be you need help in up-to-date FasmARM with the newest updates of the new ARM's CPU sets of instruction?
Thanks for the offer, but it is already well underway and will be finished and tested soon.

If you are looking for an update then I can report that all the T2 and v7 stuff is finished and in testing now. That leaves only the NEON stuff to code and test, and then it shall be ready.

What CPU are you using?
Post 01 Mar 2010, 09:58
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 02 Mar 2010, 12:28
I start from the begining...

I bought the simple cell-phone...

Everything seems good but why I can't make pda's functionality on it?

Native software is not good for me...So I start looking the way out...

I became read info about RTOS and Embedded OS's, ARM docs start learning FasmARM and asm,and etc...

I understand that I can't change anything without special flash loaders...

But now it's clear to me that I can't do this alone...

So I want now to find and to buy some device (cell-phone or smartphone or pda) without any OS on board with good documented hardware...To start my practice...

FasmARM and all this things become my favorite hobby wich takes all my free time...

and of course I need someone who can be able to help me... I know that better is to start from simple things...

Thanks for your help
Post 02 Mar 2010, 12:28
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 02 Mar 2010, 12:52
Beex: If you want to have full control don't waste your time with cell phones. Cell phones will only allow you to run apps (i.e. non system tasks). Also some phones only allow "approved" apps to run which means you can't simply write your own stuff and run it without approval from the cell phone company.

Perhaps better would be something like the Beagle Board or Gumstix. I would however recommend to avoid the Marvel CPUs (PXA line) because getting information is near impossible. The TI OMAP35xx series CPUs are a better choice IMO.

Note: I am not affiliated with any of the companies I mention above.
Post 02 Mar 2010, 12:52
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 03 Mar 2010, 13:11
Here is the large base of the pdaes and smartphones CPU's...Almost all CPU's are based on ARM arc...

So it is not a problem what CPU to choose, it's difficult to find such device...

I'm alreаdy start thinking about making such device by myself...

I know about cell-phones but there is the way out to make the pda's functionality on SE cell-phones...But there is the shortage of the hardware discriptions and docs...

SE phones CPU's have 150-300 Mhz and flash 64+ MB so it is possible to run RTOS like QNX on it...This OS will be very fast on SE-phones...

This idea is very good but SE doesn't share it... They still want to sell their devices on WM, Android, Symbian and their preopritary OS on the cell-phones based on Enea OSE...


Last edited by Beex on 03 Mar 2010, 13:47; edited 1 time in total
Post 03 Mar 2010, 13:11
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 03 Mar 2010, 13:21
Beex wrote:
So it is not a problem what CPU to choose, ...
The CPU choice is very important. Remember these chips are not just the CPU. They are (almost) system on chip devices. So if you can't get the relevant information on the chip you have then you will be stuck with not knowing how to set it up and generally have major problems getting things working.

If, instead, you are happy to use the phone's internal OS and are happy to accept all the app restrictions imposed therein then it makes almost no difference which chip you choose. They all run ARM code but you won't be able to do as much. Your apps will be in jail.


Last edited by revolution on 03 Mar 2010, 14:24; edited 1 time in total
Post 03 Mar 2010, 13:21
View user's profile Send private message Visit poster's website Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 03 Mar 2010, 14:18
revolution wrote:
Beex wrote:
They are (almost) system on chip devices.


Yes, exactly...
Here is the white paper of my phone...
But I can't find the description of the my phone's hardware...May be there is a way out with the help of some software (CPU and chip's on board serial numbers or etc...)

Only I know that my phone has very good Java(ME) support...

_________________
ImageBeJoo™(brown)
Post 03 Mar 2010, 14:18
View user's profile Send private message ICQ Number Reply with quote
Beex



Joined: 23 Feb 2010
Posts: 12
Location: Belize
Beex 03 Mar 2010, 14:25
But Java app can't access to the phone's fs
Post 03 Mar 2010, 14:25
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 03 Mar 2010, 14:27
Beex wrote:
May be there is a way out with the help of some software (CPU and chip's on board serial numbers or etc...)
I wish that were true. Unfortunately it is not that easy. Without the proper info you will have no chance.
Beex wrote:
Only I know that my phone has very good Java(ME) support...
Hehe, you can write all your apps in Java, but that is all, no assembly allowed.
Post 03 Mar 2010, 14:27
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 ... 15, 16, 17 ... 31, 32, 33  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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.