Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: inline assembler problem

  1. #21

    inline assembler problem

    Lovely, thanks for explaining how labels should be written to compile <3

    What is the correct docs to download to learn proper crossasm syntax? It's so different from Archimedes asm...

    Also, when I compile this with FPC4GP2x, I get a 1MB file. I'd like to basically just do pascal, no units/libs, just begin asm end;end.

    Someone said the .o file doesn't have to be linked, but when I rename it to .gpe (gp2x executable), it simply doesn't work.
    Henrik Erlandsson, programmer
    <br />bitBrain Studios, bitbrain.se
    <br />(Done 7 sites so far, but who's counting?)

  2. #22

    inline assembler problem

    Solved the above yesterday - however, I can't make any variant of variable access work on procedure MyProc(var1,var2:string);assembler; - I have to put the variables outside and use a local (.Ltest: .long var1) label.

    Upon reading the compiled asm source, I see FPC puts var1 and var2 in r0 and r1 before calling MyProc. However, I also see that the start of MyProc absolutely trashes those registers and don't save them anywhere.

    Should it work just by accessing r0 and r1. And if so, where can I read up on which registers FPC uses, so I don't have to save it on the stack? (And if possible, which registers are preserved/untouched by SWI calls.)
    Henrik Erlandsson, programmer
    <br />bitBrain Studios, bitbrain.se
    <br />(Done 7 sites so far, but who's counting?)

  3. #23

    inline assembler problem

    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •