Basic Macro (create a macro with basic) similar to function


+ Reply to Thread
Results 1 to 4 of 4
  1. #1

    Default Basic Macro (create a macro with basic) similar to function

    Like asm macro's but can be written in basic.
    Would not save code size, but would make program shorter and more neat.
    Put 1 line in basic code with passed values that inserts the full macro at assembly time.

    ........something like, not real code

    B1 var byte.......
    SomeMacro var macro var1,var2, etc
    B2 var word
    ......................

    ...........creating the macro..................
    VBmacro SomeMacro
    local var1, var2
    variable var1= port.pin, var2= count
    some basic code...........
    high var1
    pause count
    etc
    endmacro
    .................................................. ........

    ........using macro in some basic code...........................
    start:
    for a =1 to 50
    serout (xxxxxxxx)
    count = count +1
    SomeMacro (portB.4, 50)
    next a
    etc....etc

    Don

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: Basic Macro (create a macro with basic) similar to function

    http://support.melabs.com/threads/89...on-Start-Here)
    Might be something of use. I have not tried it yet but looking forward to it.
    Dave
    Always wear safety glasses while programming.

  3. #3

    Default Re: Basic Macro (create a macro with basic) similar to function

    Thanks !
    Looks like about what I was thinking. Brings up some questions. Now I will get PBP3. Looks like each macro can only act on 1 value at a time ? ........write basic code, build it to get code for macro in asm ?..........
    Definitely seems like advanced stuff for little basic.
    Don

  4. #4
    mohsinj677's Avatar
    mohsinj677 Guest

    Default Re: Basic Macro (create a macro with basic) similar to function

    • Would not save code size, but would make program shorter and more neat.
      Put 1 line in basic code with passed values that inserts the full macro at assembly time.



Posting Permissions

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