flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > FASMARM: out of memory...

Author
Thread Post new topic Reply to topic
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
Quote:

coty@coty-laptop:~/iPod$ ./fasm hello.asm
flat assembler for ARM version 1.69.35 (16384 kilobytes memory)
error: out of memory.
coty@coty-laptop:~/iPod$


wtf? The code is only 1075 bytes! And has doesn't generate padding or anything Shocked
Post 20 Jan 2012, 21:49
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Can you show the code? You could try the -m parameter to give fasmarm more memory, but 16 MB should really be enough if the code really doesn't have DUPs or any other thing that can increase the memory requirements considerably.
Post 20 Jan 2012, 21:58
View user's profile Send private message Reply with quote
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
Yeah
Code:
;=========================================================;
; Hello world example for Darwin 11 ARM.
;=========================================================;
   format ELF executable
       entry start

     segment readable executable
start:
        mov     r12, 4                 ; r12 = write text
        ldr      r1, [_hello]          ; Our message
        mov      r0, 1                 ; stdout
        mov      r2, length            ; msg length
        swi     0x80                   ; Just do it
        ;------------------------------;
        ; Syscall exit.                ;
        ;------------------------------;
        mov     r12, 1                 ; Exit
        mov      r0, 0                 ; return status 0
        swi     0x80                   ; astalavista baby
;==========================================================;
; Data area.                                               ;
;==========================================================;
_hello  rw msg
msg:    db "Hello Darwin world from assembly!",0
length  = $ - msg

        segment writeable
    

I also tried to allocate 128m and that failed (I though "if this don't do it, then nothing will!")


Last edited by Coty on 20 Jan 2012, 22:13; edited 1 time in total
Post 20 Jan 2012, 22:04
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Code:
_hello  rw msg    
Maybe you should use dw here?
Post 20 Jan 2012, 22:12
View user's profile Send private message Reply with quote
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
DO'H! Interesting that would through an out of memory error though...

Thanks Smile
Post 20 Jan 2012, 22:15
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Well, your code will take as much memory as the msg address value is, so it is not that surprising (although it is interesting how a single character can impact so much in memory consumption Laughing)
Post 20 Jan 2012, 22:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16903
Location: In your JS exploiting you and your system
revolution
Also note that the old ARM11 chip does not support all the latest instruction set additions.

Always remember to set your "processor" and "coprocessor" values to avoid disappointment with code crashing when trying to execute unsupported instructions.
Post 24 Jan 2012, 12:26
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: 16903
Location: In your JS exploiting you and your system
revolution
LocoDelAssembly wrote:
Well, your code will take as much memory as the msg address value is ...
For ELF format the default image base is 0x8048000 (about 128MB). And each pass the address of msg grows by the same amount. Even if you had enough memory, and used 64-bit addressing, you would still eventually run out of passes since the code is unresolvable.
Post 24 Jan 2012, 23:57
View user's profile Send private message Visit poster's website Reply with quote
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
revolution wrote:
Also note that the old ARM11 chip does not support all the latest instruction set additions.

Always remember to set your "processor" and "coprocessor" values to avoid disappointment with code crashing when trying to execute unsupported instructions.

Oh yeah! I forgot about that, maybe that was my problem of why it wouldn't run, I'll have to try that when I get the chance...
Post 25 Jan 2012, 16:56
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Coty, is your device jailbreak and what device is it ?.
Post 25 Jan 2012, 20:08
View user's profile Send private message Reply with quote
Coty



Joined: 17 May 2010
Posts: 546
Location: ␀
Coty
Oh sorry, missed your reply somehow dex.

It is an ipod touch 4g, with iOS 5.0, yes it's jail broken. I have written this on how one may dev for it with linux: http://my.opera.com/coty0010/blog/2012/01/20/writing-an-app-for-ios-5-with-linux
Post 15 Mar 2012, 20:02
View user's profile Send private message Send e-mail Visit poster's website AIM Address Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Coty wrote:
Oh sorry, missed your reply somehow dex.

It is an ipod touch 4g, with iOS 5.0, yes it's jail broken. I have written this on how one may dev for it with linux: http://my.opera.com/coty0010/blog/2012/01/20/writing-an-app-for-ios-5-with-linux

Cool thanks, i have one of those, i will give it a try.
Post 16 Mar 2012, 00:44
View user's profile Send private message Reply with quote
Tonymac32



Joined: 30 Nov 2009
Posts: 13
Tonymac32
Revolution: I just ran into Coty's issue while browsing the forums, your post in the thread about loading large immediate values shows the "rw" instead of "dw" usage. Just thought I'd mention it before someone else stumbles over it. Thanks for all the support you're giving the community.
Post 02 Jun 2012, 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: 16903
Location: In your JS exploiting you and your system
revolution
Tonymac32 wrote:
Revolution: I just ran into Coty's issue while browsing the forums, your post in the thread about loading large immediate values shows the "rw" instead of "dw" usage. Just thought I'd mention it before someone else stumbles over it. Thanks for all the support you're giving the community.
Good find. I have fixed it.
Post 02 Jun 2012, 04:58
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:  


< 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-2019, Tomasz Grysztar.

Powered by rwasa.