flat assembler
Message board for the users of flat assembler.

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

Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 30, 31, 32  Next
Author
Thread Post new topic Reply to topic
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
erm, QEMU ^o) ARM, MIPS, PPC, Sparc and... x86
Post 25 Jul 2007, 13:26
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1
^o) sounds interesting! I'll try it.
Could not find anything interesting in Google search please help!
Post 25 Jul 2007, 13:29
View user's profile Send private message Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1
erm search also gave no good results!

PS: Did you joke with me Shocked
Post 25 Jul 2007, 13:32
View user's profile Send private message Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1
When I searched for ARM tutorial, Google gave me lots of links.
But they were about arm twisting tricks, and a few about ARM were just not
good enough for me.
Post 25 Jul 2007, 13:36
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Get a GBA emulator and start learning to code for the GBA and latter move on to the DS.
Heres a tut: http://www.patatersoft.info/gbaguy/gbaasm.htm
Post 25 Jul 2007, 15:02
View user's profile Send private message Reply with quote
den_po



Joined: 17 Jul 2006
Posts: 23
Location: Russia, Cheboksary
den_po
is this a bug?

source:
Code:
code32
ldr r0,[ x ]

code16
ldr r0,[ x ]

align 4
x: DW 0x12345678    


result:
Code:
                            CODE32
0C 00 90 E5                 LDR     R0, [R0,#0xC]
                            CODE16
C0 68                       LDR     R0, [R0,#0xC]
    

how else can i load data from a specified address? i don't like to use macros.
when i'm trying to use this command without brackets, fasmarm says:
error: Expecting square bracket "[".

_________________
JUST_DAn_PO
Post 15 Aug 2007, 12:58
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
Hi den_po,

Sorry for the late reply, I have been away from the PC for a while.

The above code looks like a bug. If anything, the label x should be PC based and not R0 based. I don't know why you get the result above, I also get the same result. I will look into it shortly when I have sorted out my desk and the backlog of things to do. Once I have sorted out the problem I will post back here.
Post 30 Aug 2007, 11:53
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: 17671
Location: In your JS exploiting you and your system
revolution
I have uploaded a new version v1.11 http://arm.flatassembler.net

Just a bug fix release.

FYI: The way to do what den_po mentions above is like this
Code:
code32
ldr r0,[r15,x-($+8)]
ldr r0,[y]

code16
ldr r0,[pc,x-($+4)]

virtual at r2+20
y dw 987654321
end virtual

align 4
x: DW 0x12345678     
Post 31 Aug 2007, 11:13
View user's profile Send private message Visit poster's website Reply with quote
oyzzo



Joined: 25 Sep 2007
Posts: 3
oyzzo
how can i debug the ELF binaries created with fasmarm? i'm coding for the gp2x and gdb seems to not work because of the symbol table...
Post 25 Sep 2007, 21:38
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I have written some program for the Gp2x with fasmarm. i may be able to help.


Last edited by Dex4u on 06 Oct 2007, 20:10; edited 1 time in total
Post 26 Sep 2007, 02:52
View user's profile Send private message Reply with quote
oyzzo



Joined: 25 Sep 2007
Posts: 3
oyzzo
nope, it doesn't work. gdb can show me the bytecodes of the program but can't disassm them nor trace the program, so i can't debug it :S
Post 26 Sep 2007, 13:36
View user's profile Send private message Reply with quote
oyzzo



Joined: 25 Sep 2007
Posts: 3
oyzzo
uhm, i can now debug with gdb. first i have to put a breakpoint in a place near to the entrypoint and then with display/i $pc i can do nexti. disas doesn't works but i think that's enough.

about the OS, i've read the forums about the arm port of Dex4u but there's not a lot of information. i don't have experience in OS develop but maybe i can help in something.
Post 26 Sep 2007, 16:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
oyzzo, Can you please elaborate on the problem you have with the symbols.

I have been successfully using symbolic debugging using the tools from ARM without any issue, but those tools don't include gdb so I haven't used it.

Is it the symbol table format that is causing a problem? Or some other reason?

Feel free to post some example code that illustrates the problem Wink
Post 16 Oct 2007, 16:45
View user's profile Send private message Visit poster's website Reply with quote
IronM



Joined: 01 Nov 2007
Posts: 3
Location: Russia
IronM
revolution,
Hi!
can you include some instructions in your prog:
1. adr rx, label1

2. Ability to use label in ldr instructions, e.g.
Code:
ldr r4, my_data
......
align 4
my_data: dw 0x12345678
    


Now you need to use macros.....

3. Unicode support (it's necessary for correct representation russian symbols), e.g.

Code:
ldr r2, my_string
.....
align 4
my_string: db *'Hello, World!',0
    


instead of

Code:
ldr r2, my_string
........
align 4
my_string: db 'H',0,'e',0,'l',0,'l',0,'o',0,',',0,' ',0,'W',0,'o',0,'r',0,'l',0,'d',0,'!',0,0,0
    
Post 01 Nov 2007, 05:34
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: 17671
Location: In your JS exploiting you and your system
revolution
Hi IronM,
IronM wrote:
1. adr rx, label1
You can use the macros I posted earlier in this thread.
Code:
macro adr reg,location {
        add reg,pc,location-$-8
}

macro adrl reg,location {
        sub reg,pc,(-location+$+8) and (0ffh shl 2)
        sub reg,reg,(-location+$+4) and (0ffffff00h shl 2)
}    
IronM wrote:
2. Ability to use label in ldr instructions ... Now you need to use macros.....
You don't need macros, but you do need some PC relative tricks to do it.
Code:
code32
ldr r0,[r15,x-($+8)]
ldr r0,[y]

code16
ldr r0,[pc,x-($+4)]

virtual at r2+20
y dw 987654321
end virtual

align 4
x: DW 0x12345678     
However I may look into some sort of automatic PC relative addressing for a later version.
IronM wrote:
3. Unicode support
Already there. Use du.
Code:
my_string: du 'Hello, World!',0    


Last edited by revolution on 22 Feb 2010, 12:59; edited 1 time in total
Post 01 Nov 2007, 17:43
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
However I may look into some sort of automatic PC relative addressing for a later version.

I think that would be great addition, similar to automatic RIP-relative addressing in 64bit FASM
Post 01 Nov 2007, 17:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
IronM



Joined: 01 Nov 2007
Posts: 3
Location: Russia
IronM
1. I know about this macros, but i didn't like to use such simple instruction as macros.... Any disassembler shows it as adr, not like add pc, pc,0x??

2. It will be very handy

3.It doesn't support russian symbols

And what about case instruction? e.g.

Code:
cmp r0, 0x4
bcs exit
adr r1, case
ldrb r1, [r1,r0]
add pc, r1

case:
........
    
Post 01 Nov 2007, 18:31
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: 17671
Location: In your JS exploiting you and your system
revolution
vid wrote:
I think that would be great addition, similar to automatic RIP-relative addressing in 64bit FASM
Okay, that makes two votes so far, I may put it down for inclusion in v1.12
IronM wrote:
1. I know about this macros, but i didn't like to use such simple instruction as macros.... Any disassembler shows it as adr, not like add pc, pc,0x??
Fasmarm currently supports just the instructions that the CPU's execute. This is why adr is a macro. This follows the original tradition of fasm (the x86 version). But, if you can make a strong case to include it as a pseudo instruction then I am willing to listen.
IronM wrote:
3.It doesn't support russian symbols
This is a consequence of fasm only supporting ascii encoded source files. There are also some macros from the current fasm package that does UTF encding (UTF8.INC), perhaps that is what you are looking for?
IronM wrote:
And what about case instruction? e.g.

Code:
cmp r0, 0x4
bcs exit
adr r1, case
ldrb r1, [r1,r0]
add pc, r1

case:
........
    
I'm not sure what you are asking here, "case" is not an instruction. Maybe you want a "case" macro? There are macros in the fasm package that do things like case. But you probably need some minor tweaks to convert them to fasmarm syntax compatibility.
Post 01 Nov 2007, 19:04
View user's profile Send private message Visit poster's website Reply with quote
IronM



Joined: 01 Nov 2007
Posts: 3
Location: Russia
IronM
OK. About russian symbols.... it is bearable:) Anyway i can use hex-values of russian symbols.
About case.... of course macro, but i think it'll difficult because of different variants of cases....
Post 02 Nov 2007, 04:26
View user's profile Send private message ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
IronM: russian symbols ARE supported, you just have to understand what you are doing. First, you must know how your editor encodes files. In most cases (FASMW for example) it is 8bit per character, but some editors allow UTF8.

To find difference, just look at saved file: if special characters have 2 bytes, then it is UTF8.

Next thing is to learn what character set are you using. Good chance is that it's CP1251. Include appropriate file for your encoding from INCLUDE\ENCODING\. Then, your "du" strings will support special characters.
Post 02 Nov 2007, 07:00
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 30, 31, 32  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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.