#268 assembler support macro function

open
None
5
2012-12-28
2008-11-22
steven
No

I need this feature for my work, and I think this is helpful, thanks very much.

Discussion

  • steven

    steven - 2008-11-22
    • assigned_to: nobody --> bernhardheld
     
  • steven

    steven - 2008-11-22
    • assigned_to: bernhardheld --> borutr
     
  • Maarten Brock

    Maarten Brock - 2008-11-22
    • assigned_to: borutr --> nobody
     
  • Borut Ražem

    Borut Ražem - 2008-11-22
    • status: open --> pending
     
  • Borut Ražem

    Borut Ražem - 2008-11-22

    Can you please be more specific about the request? Some additional explanation and/or example would help a lot.

    Borut

     
  • steven

    steven - 2008-11-23

    thanks, what i mean is macro replace function.

    .macro PUSHALL
    PUSH PSW
    PUSH ACC
    PUSH B
    PUSH DPL
    PUSH DPH
    .endmacro

    somelable:
    PUSHALL
    move dpl, 0x00 ;do some other thing
    ...

     
  • steven

    steven - 2008-11-23
    • status: pending --> open
     
  • steven

    steven - 2008-11-23
    • assigned_to: nobody --> borutr
     
  • steven

    steven - 2008-11-23
    • assigned_to: borutr --> nobody
     
  • Steven Borley

    Steven Borley - 2008-11-23

    Maybe the c pre-processor can provide a work-round for you

    Here is how I'd implement your example:

    /* macro.c */

    #define PUSHALL \ PUSH PSW __endasm;\ __asm PUSH ACC __endasm;\ __asm PUSH B __endasm;\ __asm PUSH DPL __endasm;\ __asm PUSH DPH

    #define POPALL \ PUSH DPH __endasm;\ __asm PUSH DPL __endasm;\ __asm PUSH B __endasm;\ __asm PUSH ACC __endasm;\ __asm PUSH PSW

    void example(void) __naked
    {
    __asm

    ; more assembly code here maybe

    somelabel:
    PUSHALL
    mov dpl, 0x00 ; do some other things
    POPALL
    ret

    ; more assembly code here maybe

    __endasm;
    }

    int main(void)
    {
    __asm
    lcall somelabel
    __endasm;
    return 0;
    }

     
  • Borut Ražem

    Borut Ražem - 2009-01-12

    Alan Baldwin wrote me a letter which includes the following information:

    ...

    The new release will include a full macro processing
    facility: named macros, indefinite repeat blocks,
    repeat blocks, argument substitution, string concatenation,
    and automatic local symbol generation.

    Final cleanup, testing, and documentation updating is
    underway. I hope to have the distribution available by
    April 2009.

     
  • Maarten Brock

    Maarten Brock - 2012-12-28

    I've ported ASxxxx v5 macro support to sdas recently.
    If you or anyone else is still interested, please verify if this works and suits your needs.

     
  • Maarten Brock

    Maarten Brock - 2012-12-28
    • assigned_to: nobody --> maartenbrock
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks