flat assembler
Message board for the users of flat assembler.
  
       
      Index
      > Non-x86 architectures > Delphi + FASMARM *.obj files | 
  
| Author | 
  | 
              
| 
                  
                   DevilDevil 19 Jul 2014, 13:19 
                  Hello
 
                  
                Could you show please, how can I make a simple *.obj ARM file and link it's public function into my Delphi project (Android or iOS) Thank you  | 
              |||
                  
  | 
              
| 
                  
                   revolution 19 Jul 2014, 13:23 
                  I've never tried this but perhaps something like this:     
                  
                Code: format elf public MyFunction MyFunction: add r0,r1,r2 mov r3,12 bx lr  | 
              |||
                  
  | 
              
| 
                  
                   DevilDevil 19 Jul 2014, 13:59 
                  revolution
 
                  
                You did the magic! Thank you! It works!!! Code: {$ifdef CPUARM} function MyFunction(const X, Y, Z: integer): integer; external 'test_ARM.obj' name 'MyFunction'; {$endif} So: 1) why dont you defined any section/segment and how to define the standard sections like .code, .data, .const ? 2) how to compile thumb-2 obj files? seems like it's the standard Delphi binaries mode  | 
              |||
                  
  | 
              
| 
                  
                   revolution 19 Jul 2014, 14:16 
                  For thumb-2 just set the mode:     
                  
                Code: format elf thumb ;by default all instructions are available so thumb-2 instructions will now be active, see the 'processor' directive for details ;... The relocations could be a problem if the code uses global variables. This will affect the usage of extrn also so I don't know what will happen there.  | 
              |||
                  
  | 
              
| 
                  
                   revolution 19 Jul 2014, 14:53 
                  I think this will work:     
                  
                Code: format elf public MyFunction extrn TheirFunction:word MyFunction: push {lr} ldr r0,[TheirFunction] blx r0 pop {pc}  | 
              |||
                  
  | 
              
| 
                  
                   l_inc 19 Jul 2014, 14:54 
                  revolution
 
                  I've never used MS COFF for ARM, but I suppose Visual Studio uses it to compile for ARM. The specification does define some values specifically for ARM. _________________ Faith is a superposition of knowledge and fallacy  | 
              |||
                  
  | 
              
| 
                  
                   DevilDevil 19 Jul 2014, 15:40 
                  revolution,
 
                  
                Quote: format elf it's too weird, but the Delphi still try to call 32bit mode functions Hmmm maybe it's a Delphi or Android SDK bug so... how to define data section in FASMARM? I will try to use a thumb-2 function by the pointer  | 
              |||
                  
  | 
              
< Last Thread | Next Thread >  | 
    
Forum Rules: 
  | 
    
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.