Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: inline assembler problem

  1. #1

    inline assembler problem

    hi again. :)

    my problem is that this...

    Code:
    asm
      mov r0,Variable
      ldr r1,[r0]
    end;
    ... give's me this:

    Code:
    001.s: Assembler messages:
    001.s:11011: Error: immediate expression requires a # prefix -- `mov r1,U_P$_001_Variable'

    using # of course did not do any good, it then even said "$ would be
    better", which it isn't ...

    any suggestions? i need assembler :)

  2. #2

    inline assembler problem

    What's the target? arm? avr?

    What kind of variable is Variable? What's it's scope?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    inline assembler problem

    oh sorry, i was in a hurry.

    i've tried every type, momentarily it's a word.
    target is arm, for nds (maybe a compilerswitch for ppcarmnds?)

  4. #4

    inline assembler problem

    maybe i should clarify what i want:

    How do i access a variable in inline assembler?

    (a very stupid question, actually ...)

  5. #5

    inline assembler problem

    This compiles fine here:
    [pascal]procedure MyAsmProc(Variable: word); assembler;
    asm
    mov r0,Variable
    ldr r1,[r0]
    end;[/pascal]
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  6. #6

    inline assembler problem

    Quote Originally Posted by Legolas
    This compiles fine here:
    [pascal]procedure MyAsmProc(Variable: word); assembler;
    asm
    mov r0,Variable
    ldr r1,[r0]
    end;[/pascal]
    yes, it does for me too, but this:

    [pascal]
    var
    test : word;

    procedure MyAsmProc(Variable: word); assembler;
    asm
    mov r0,test
    ldr r1,[r0]
    end;[/pascal]

    gives me the above error.

    i did not recognize it works with local (?) variables, because i had the
    code inlined in the main code.

  7. #7

    inline assembler problem

    Sorry, I rarely use asm, so I can't help
    However, try to post your question on the fpc community.
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  8. #8

    inline assembler problem

    did so.

    http://community.freepascal.org:1000...um%5fid=251924

    i always think of posting here first (in hope for a fast answer *gg*).

    btw ... i've said i'll release something. i am writing an c64-emulator (i really
    dislike frodoDS) and need assembler for more experiments with the arm
    and the whole platform (an emulator is great for learning how to get some
    speed out of a platform :D)

  9. #9

    inline assembler problem

    Quote Originally Posted by 21o6
    did so.

    http://community.freepascal.org:1000...um%5fid=251924

    i always think of posting here first (in hope for a fast answer *gg*).

    btw ... i've said i'll release something. i am writing an c64-emulator (i really
    dislike frodoDS) and need assembler for more experiments with the arm
    and the whole platform (an emulator is great for learning how to get some
    speed out of a platform )
    WOW! :shock: A c64 emulator as first big fpc4nds project will be awesome! Do you have some screenshots to show?
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  10. #10

    inline assembler problem

    no, it's really not that huge and momentarily the only thing i could show
    you is the c64-screen with READY., because my first priority lies in fast
    execution of emulated instructions.

    i only achieve ~450k emulated opcodes per sec (shame on me :( ... but
    didn't optimize as hell, most work went into learning stuff about the ds ...
    i am still in the process of getting an inner feeling for the capabilities of
    ARM9/ARM7, caches, RAM, etc etc).

    until now, the 6502 is emulated only in opcode-level with some basic
    VIC-emulation (with or without arm7-support as VIC)... basic-programs
    would work, i guess :D

    btw ... i need fpc as framework for assembler (makes life damn easy *g*)
    for being able to use ITCM/DTCM and realtime binary translation
    (don't know yet if i'll use the arm7 as support ... have tested various ways
    of letting the arm7 control arm9-execution but they all failed pretty hard speedwise).

    I could probably achieve this with normal pascal-code too, but haven't
    tested that yet as i think it's better to use assembler directly.

Page 1 of 3 123 LastLast

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
  •